00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _MODE_DECISION_H_
00019 #define _MODE_DECISION_H_
00020
00021
00022 static const int b8_mode_table[6] = {0, 4, 5, 6, 7};
00023 static const char mb_mode_table[9] = {0, 1, 2, 3, P8x8, I16MB, I4MB, I8MB, IPCM};
00024
00025 extern int BIDPartitionCost (Macroblock *currMB, int, int, char[2], int);
00026 extern int BPredPartitionCost (Macroblock *currMB, int, int, short, short, int, int);
00027 extern void StoreMV8x8 (Slice *currSlice, int dir);
00028 extern void RestoreMV8x8 (Slice *currSlice, int dir);
00029 extern void store_macroblock_parameters (Macroblock *currMB, int);
00030 extern void SetModesAndRefframeForBlocks (Macroblock *currMB, short);
00031 extern void StoreNewMotionVectorsBlock8x8 (Slice *currSlice, int, int, Info8x8 *);
00032 extern void assign_enc_picture_params (Macroblock *currMB, int mode, Info8x8 *best, int block);
00033 extern void set_subblock8x8_info (Block8x8Info*, int, int, RD_8x8DATA*);
00034 extern void set_block8x8_info (Block8x8Info*, int, int, Info8x8 *best);
00035 extern void update_refresh_map (Macroblock *currMB, int intra, int intra1);
00036 extern void SetCoeffAndReconstruction8x8 (Macroblock *currMB);
00037 extern void get_bipred_cost (Macroblock *currMB, int mode, int block, int i, int j, Info8x8 *best, RD_PARAMS *enc_mb, int bmcost[5]);
00038
00039 extern short I16Offset (int, short);
00040 extern int CheckReliabilityOfRef (Macroblock *currMB, int block, int list_idx, int ref, int mode);
00041 extern int Mode_Decision_for_Intra4x4Macroblock (Macroblock *currMB, double, double*);
00042 extern int RDCost_for_macroblocks (Macroblock *currMB, double, short);
00043 extern double RDCost_for_8x8blocks (Macroblock *currMB, RD_8x8DATA *dataTr, int*, int64*, double, int, short, Info8x8 *, double);
00044
00045
00046 extern void rc_store_diff (int diff[16][16], imgpel **p_curImg, int cpix_x,imgpel **prediction);
00047 extern void submacroblock_mode_decision (Macroblock *currMB, RD_PARAMS *, RD_8x8DATA *, int ****, int, int *);
00048 extern void submacroblock_mode_decision_low(Macroblock *currMB, RD_PARAMS *, RD_8x8DATA *, int ****, int *, int, int *, int *, int *, int);
00049 extern void init_enc_mb_params (Macroblock* currMB, RD_PARAMS *enc_mb, int intra);
00050 extern void list_prediction_cost (Macroblock *currMB, int list, int block, int mode, RD_PARAMS *enc_mb, int bmcost[5], char best_ref[2]);
00051 extern void determine_prediction_list (int [5], Info8x8 *, int *);
00052 extern void compute_mode_RD_cost (Macroblock *currMB, RD_PARAMS *enc_mb, short mode, short *inter_skip);
00053
00054 extern int transform_termination_control (Macroblock* currMB, int mode);
00055 extern int bslice_16x16_termination_control(InputParameters *p_Inp, Block8x8Info *b8x8info, int *ctr16x16, int mode, int bslice);
00056
00057 extern int iminarray ( int arr[], int size, int *minind );
00058
00059 extern void update_lambda_costs(Macroblock *currMB, RD_PARAMS *enc_mb, int lambda_mf[3]);
00060
00061 extern void get_initial_mb16x16_cost(Macroblock *currMB);
00062 extern void adjust_mb16x16_cost (Macroblock *currMB, int cost);
00063
00064 extern void reset_adaptive_rounding(ImageParameters *p_Img);
00065
00066 extern int64 distortionSSE ( Macroblock *currMB );
00067
00068
00069
00070 #endif
00071