00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _RDO_H_
00018 #define _RDO_H_
00019
00020 extern int *****coefAC8x8;
00021 extern int ****cofAC;
00022 extern int ***cofDC;
00023 extern int **cofAC4x4;
00024 extern int cbp, cbp8x8, cnt_nonz_8x8;
00025 extern int cbp_blk8x8;
00026 extern char **l0_refframe, **l1_refframe;
00027 extern short b8mode[4], b8pdir[4];
00028
00029
00030 extern int best_c_imode;
00031 extern int best_i16offset;
00032 extern short best_mode;
00033
00034
00035 extern int luma_transform_size_8x8_flag;
00036
00037 extern int *****cofAC8x8ts;
00038 extern int **cofAC4x4CbCr[2];
00039
00040 extern int64 cbp_blk8_8x8ts;
00041 extern int cbp8_8x8ts;
00042 extern int cost8_8x8ts;
00043 extern int cnt_nonz8_8x8ts;
00044
00045
00046 extern double mb16x16_cost;
00047 extern double lambda_mf_factor;
00048
00049 int (*Mode_Decision_for_4x4IntraBlocks) (Slice *currSlice, Macroblock *currMB, int b8, int b4, double lambda, double* min_cost, int cr_cbp[3], int is_cavlc);
00050 double RDCost_for_4x4IntraBlocks (Slice *currSlice, Macroblock *currMB, int* nonzero, int b8, int b4, int ipmode, double lambda, int mostProbableMode, int c_nzCbCr[3], int is_cavlc);
00051 int valid_intra_mode(int ipmode);
00052 void compute_comp_cost(imgpel **cur_img, imgpel **prd_img, int pic_opix_x, int *cost);
00053 void generate_pred_error(imgpel **cur_img, imgpel **prd_img, imgpel **cur_prd,
00054 int **mb_rres, int pic_opix_x, int block_x);
00055
00056
00057 void clear_rdopt (InputParameters *params);
00058 void init_rdopt (InputParameters *params);
00059
00060 void copy_4x4block(imgpel **oblock, imgpel **iblock, int o_xoffset, int i_xoffset);
00061
00062 void update_qp_cbp (Macroblock *currMB, short best_mode);
00063 void update_qp_cbp_tmp (Macroblock *currMB, int cbp, int best_mode);
00064
00065
00066 #endif
00067