00001 00002 /*! 00003 *************************************************************************** 00004 * \file 00005 * ratectl.h 00006 * 00007 * \author 00008 * Zhengguo LI 00009 * 00010 * \date 00011 * 14 Jan 2003 00012 * 00013 * \brief 00014 * Headerfile for rate control 00015 ************************************************************************** 00016 */ 00017 00018 #ifndef _RATE_CTL_H_ 00019 #define _RATE_CTL_H_ 00020 00021 #include "global.h" 00022 #include "rc_quadratic.h" 00023 00024 00025 // generic functions 00026 extern int Qstep2QP ( double Qstep, int qp_offset ); 00027 extern double QP2Qstep ( int QP ); 00028 extern int ComputeMBMAD ( int diff[16][16] ); 00029 extern double ComputeFrameMAD ( ImageParameters *p_Img ); 00030 extern void rc_store_mad ( Macroblock *currMB ); 00031 00032 // rate control functions 00033 // init/copy 00034 extern void rc_alloc_generic ( ImageParameters *p_Img, RCGeneric **p_quad ); 00035 extern void rc_free_generic ( RCGeneric **p_quad ); 00036 extern void rc_copy_generic ( ImageParameters *p_Img, RCGeneric *dst, RCGeneric *src ); 00037 extern void rc_init_gop_params ( ImageParameters *p_Img, InputParameters *p_Inp ); 00038 extern void rc_init_frame ( ImageParameters *p_Img, InputParameters *p_Inp); 00039 extern void rc_init_sequence ( ImageParameters *p_Img, InputParameters *p_Inp); 00040 extern void rc_store_slice_header_bits ( ImageParameters *p_Img, InputParameters *p_Inp, int len); 00041 00042 #endif 00043