mode_decision.h
上传用户:hjq518
上传日期:2021-12-09
资源大小:5084k
文件大小:4k
源码类别:

Audio

开发平台:

Visual C++

  1. /*!
  2.  ***************************************************************************
  3.  * file
  4.  *    mode_decision.h
  5.  *
  6.  * author
  7.  *    Main contributors (see contributors.h for copyright, address and affiliation details)
  8.  *     - Alexis Michael Tourapis         <alexismt@ieee.org>
  9.  *
  10.  * date
  11.  *    21. February 2005
  12.  *
  13.  * brief
  14.  *    Headerfile for mode decision
  15.  **************************************************************************
  16.  */
  17. #ifndef _MODE_DECISION_H_
  18. #define _MODE_DECISION_H_
  19. extern CSptr cs_mb, cs_b8, cs_cm, cs_ib8, cs_ib4;
  20. extern RD_8x8DATA tr4x4, tr8x8;
  21. // Adaptive Lagrangian variables
  22. extern double mb16x16_cost;
  23. extern double lambda_mf_factor;
  24. extern int    ****cofAC8x8ts[3];        // [8x8block][4x4block][level/run][scan_pos]
  25. extern int    ****cofAC, ****cofAC8x8;        // [8x8block][4x4block][level/run][scan_pos]
  26. extern int   ****cofAC8x8CbCr[2];
  27. extern int    QP2QUANT[40];
  28. extern int    cbp_blk8x8;
  29. extern int    cbp, cbp8x8, cnt_nonz_8x8;
  30. extern int64  cbp_blk8_8x8ts;
  31. extern int    cbp8_8x8ts;
  32. extern int    cnt_nonz8_8x8ts;
  33. // Residue Color Transform
  34. extern char   b4_ipredmode[16], b4_intra_pred_modes[16];
  35. extern short  best_mode;
  36. extern imgpel pred[16][16];
  37. extern void   set_stored_macroblock_parameters (Macroblock *currMB);
  38. extern void   StoreMV8x8(int);
  39. extern void   RestoreMV8x8(int);
  40. extern void   store_macroblock_parameters (Macroblock *currMB, int);
  41. extern void   SetModesAndRefframeForBlocks (Macroblock *currMB, int);
  42. extern void   SetRefAndMotionVectors (Macroblock *currMB, int, int, int, int, int, short);
  43. extern void   StoreNewMotionVectorsBlock8x8(int, int, int, int, int, int, int, int);
  44. extern void   assign_enc_picture_params(int, char, int, int, int, int, int, short);
  45. extern void   set_subblock8x8_info(Block8x8Info*, int, int, RD_8x8DATA*);
  46. extern void   set_block8x8_info(Block8x8Info*, int, int, char[2], char, short);
  47. extern void   update_prediction_for_mode16x16(Block8x8Info*, int, int*);
  48. extern void   update_refresh_map(int intra, int intra1, Macroblock *currMB);
  49. extern void   SetMotionVectorsMB (Macroblock*, int);
  50. extern void   SetCoeffAndReconstruction8x8 (Macroblock*);
  51. extern int    GetBestTransformP8x8(void);
  52. extern int    I16Offset (int, int);
  53. extern int    CheckReliabilityOfRef (int, int, int, int);
  54. extern int    Mode_Decision_for_Intra4x4Macroblock (Macroblock *currMB, double, double*, int is_cavlc);
  55. extern int    RDCost_for_macroblocks (Macroblock  *currMB, double, int, double*, double*, double*, int, int);
  56. extern double RDCost_for_8x8blocks (Macroblock  *currMB, int*, int64*, double, int, int, short, short, short, short, int);
  57. extern double *mb16x16_cost_frame;
  58. extern const int  b8_mode_table[6];
  59. extern const int  mb_mode_table[9];
  60. void rc_store_diff(int cpix_x, int cpix_y, imgpel prediction[16][16]);
  61. void submacroblock_mode_decision(RD_PARAMS *, RD_8x8DATA *, Macroblock *,int ***, int ***, int ***, int *, short, int, int *, int *, int *, int, int);
  62. void init_enc_mb_params(Macroblock* currMB, RD_PARAMS *enc_mb, int intra, int bslice);
  63. void list_prediction_cost(Macroblock *currMB, int list, int block, int mode, RD_PARAMS *enc_mb, int bmcost[5], char best_ref[2]);
  64. void determine_prediction_list(int, int [5], char [2], char *, int *, short *);
  65. void compute_mode_RD_cost(int mode, Macroblock *currMB, RD_PARAMS *enc_mb,
  66.                                double *min_rdcost, double *min_dcost, double *min_rate,
  67.                                int i16mode, short bslice, short *inter_skip, int is_cavlc);
  68. int iminarray ( int arr[], int size, int *minind ); 
  69. extern void update_lambda_costs(RD_PARAMS *enc_mb, int lambda_mf[3]);
  70. void get_initial_mb16x16_cost(Macroblock* currMB);
  71. void adjust_mb16x16_cost(int);
  72. int64 (*getDistortion)( Macroblock *currMB );
  73. int64 distortionSSE   ( Macroblock *currMB );
  74. #endif