mode_decision.h File Reference

Headerfile for mode decision. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void set_stored_macroblock_parameters (Macroblock *currMB)
void StoreMV8x8 (int)
void store_macroblock_parameters (Macroblock *currMB, int)
void SetModesAndRefframeForBlocks (Macroblock *currMB, int)
void SetRefAndMotionVectors (PicMotionParams *motion, Macroblock *currMB, int, int, int, int, int, short)
void StoreNewMotionVectorsBlock8x8 (int, int, int, int, int, int, int, int)
void assign_enc_picture_params (int, char, int, int, int, int, int, short)
void set_subblock8x8_info (Block8x8Info *, int, int, RD_8x8DATA *)
void set_block8x8_info (Block8x8Info *, int, int, char[2], char, short)
void update_refresh_map (int intra, int intra1, Macroblock *currMB)
void SetCoeffAndReconstruction8x8 (Macroblock *)
int GetBestTransformP8x8 (void)
int I16Offset (int, int)
int CheckReliabilityOfRef (int, int, int, int)
int Mode_Decision_for_Intra4x4Macroblock (Slice *currSlice, Macroblock *currMB, double, double *, int is_cavlc)
int RDCost_for_macroblocks (Slice *currSlice, Macroblock *currMB, double, int, double *, double *, double *, int, int)
double RDCost_for_8x8blocks (Slice *currSlice, Macroblock *currMB, int *, int64 *, double, int, int, short, short, short, short, int)
void rc_store_diff (int cpix_x, int cpix_y, imgpel **prediction)
void submacroblock_mode_decision (Slice *currSlice, RD_PARAMS *, RD_8x8DATA *, Macroblock *, int ****, int *, short, int, int *, int *, int *, int, int)
void submacroblock_mode_decision_low (Slice *currSlice, RD_PARAMS *, RD_8x8DATA *, Macroblock *, int ****, int *, short, int, int *, int *, int *, int, int)
void init_enc_mb_params (Macroblock *currMB, RD_PARAMS *enc_mb, int intra, int bslice)
void list_prediction_cost (Macroblock *currMB, int list, int block, int mode, RD_PARAMS *enc_mb, int bmcost[5], char best_ref[2])
void determine_prediction_list (int, int[5], char[2], char *, int *, short *)
void compute_mode_RD_cost (Slice *currSlice, Macroblock *currMB, RD_PARAMS *enc_mb, int mode, double *min_rdcost, double *min_dcost, double *min_rate, int i16mode, short bslice, short *inter_skip, int is_cavlc)
int transform_termination_control (Macroblock *currMB, int mode, int bslice)
int bslice_16x16_termination_control (Block8x8Info *b8x8info, int *ctr16x16, int mode, int bslice)
int iminarray (int arr[], int size, int *minind)
void update_lambda_costs (RD_PARAMS *enc_mb, int lambda_mf[3])
void get_initial_mb16x16_cost (Macroblock *currMB)
void adjust_mb16x16_cost (int)
void reset_adaptive_rounding ()
int64 distortionSSE (Macroblock *currMB)

Variables

CSptr cs_mb
CSptr cs_b8
CSptr cs_cm
CSptr cs_ib8
CSptr cs_ib4
RD_8x8DATA tr4x4
RD_8x8DATA tr8x8
double mb16x16_cost
double lambda_mf_factor
int ***** coefAC8x8
int ***** cofAC8x8ts
int **** cofAC
int QP2QUANT [40]
int cbp_blk8x8
int cbp
int cbp8x8
int cnt_nonz_8x8
int64 cbp_blk8_8x8ts
int cbp8_8x8ts
int cnt_nonz8_8x8ts
char b4_ipredmode [16]
char b4_intra_pred_modes [16]
short best_mode
imgpel ** pred
imgpel *** rec4x4
imgpel *** rec4x4CbCr
double * mb16x16_cost_frame
const int b8_mode_table [6]
const int mb_mode_table [9]
int64(* getDistortion )(Macroblock *currMB)


Detailed Description

Headerfile for mode decision.

mode_decision.h

Author:
Main contributors (see contributors.h for copyright, address and affiliation details)
Date:
21. February 2005

Definition in file mode_decision.h.


Function Documentation

int bslice_16x16_termination_control ( Block8x8Info *  b8x8info,
int *  ctr16x16,
int  mode,
int  bslice 
)

Update prediction direction for mode P16x16 to check all prediction directions.

Definition at line 1342 of file mode_decision.c.

References Block8x8Info::best8x8pdir, Block8x8Info::bipred8x8me, InputParameters::BiPredMotionEstimation, and error().

Referenced by compute_mode_RD_cost().

Here is the call graph for this function:

int CheckReliabilityOfRef ( int  block,
int  list_idx,
int  ref,
int  mode 
)

Checks if a given reference frame is reliable for the current macroblock, given the motion vectors that the motion search has returned.

Returns:
If the return value is 1, the reference frame is reliable. If it is 0, then it is not reliable.
Note:
A specific area in each reference frame is assumed to be unreliable if the same area has been intra-refreshed in a subsequent frame. The information about intra-refreshed areas is kept in the pixel_map.

Definition at line 324 of file rdopt.c.

References ImageParameters::all_mv, ImageParameters::block_x, ImageParameters::block_y, ImageParameters::height, pixel_map, and ImageParameters::width.

Referenced by list_prediction_cost().

void compute_mode_RD_cost ( Slice *  currSlice,
Macroblock *  currMB,
RD_PARAMS *  enc_mb,
int  mode,
double *  min_rdcost,
double *  min_dcost,
double *  min_rate,
int  i16mode,
short  bslice,
short *  inter_skip,
int  is_cavlc 
)

void determine_prediction_list ( int  ,
int  [5],
char  [2],
char *  ,
int *  ,
short *   
)

Determination of prediction list based on simple distortion computation.

Definition at line 284 of file mode_decision.c.

References iminarray().

Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), encode_one_macroblock_low(), submacroblock_mode_decision(), and submacroblock_mode_decision_low().

Here is the call graph for this function:

int64 distortionSSE ( Macroblock *  currMB  ) 

int GetBestTransformP8x8 ( void   ) 

Makes the decision if 8x8 tranform will be used (for RD-off).

Definition at line 2405 of file rdopt.c.

References distortion4x4(), distortion8x8(), ImageParameters::opix_x, ImageParameters::opix_y, pCurImg, and InputParameters::Transform8x8Mode.

Referenced by encode_one_macroblock_low().

Here is the call graph for this function:

int I16Offset ( int  ,
int   
)

Gets mode offset for intra16x16 mode.

Definition at line 739 of file rdopt.c.

Referenced by encode_one_macroblock_low(), and RDCost_for_macroblocks().

int iminarray ( int  arr[],
int  size,
int *  minind 
)

Return array's minimum and its index.

Definition at line 1256 of file mode_decision.c.

Referenced by determine_prediction_list().

void init_enc_mb_params ( Macroblock *  currMB,
RD_PARAMS *  enc_mb,
int  intra,
int  bslice 
)

void list_prediction_cost ( Macroblock *  currMB,
int  list,
int  block,
int  mode,
RD_PARAMS *  enc_mb,
int  bmcost[5],
char  best_ref[2] 
)

int Mode_Decision_for_Intra4x4Macroblock ( Slice *  currSlice,
Macroblock *  currMB,
double  ,
double *  ,
int  is_cavlc 
)

4x4 Intra mode decision for an macroblock

Definition at line 437 of file rd_intra_jm.c.

References Mode_Decision_for_IntraSubMBlocks().

Referenced by encode_one_macroblock_low(), and RDCost_for_macroblocks().

Here is the call graph for this function:

void rc_store_diff ( int  cpix_x,
int  cpix_y,
imgpel **  prediction 
)

double RDCost_for_8x8blocks ( Slice *  currSlice,
Macroblock *  currMB,
int *  ,
int64 *  ,
double  ,
int  ,
int  ,
short  ,
short  ,
short  ,
short  ,
int   
)

int RDCost_for_macroblocks ( Slice *  currSlice,
Macroblock *  currMB,
double  ,
int  ,
double *  ,
double *  ,
double *  ,
int  ,
int   
)

R-D Cost for a macroblock.

Definition at line 1310 of file rdopt.c.

References ImageParameters::all_mv, ImageParameters::block_x, ImageParameters::block_y, macroblock::cbp, ChromaResidualCoding(), ImageParameters::cod_counter, compute_residue_block(), decode_one_mb(), direct_pdir, field_flag_inference(), I16Offset(), ImageParameters::i16offset, storable_picture::imgUV, storable_picture::imgY, Intra16x16_Mode_Decision(), ImageParameters::lossless_qpprime_flag, LumaResidualCoding(), ImageParameters::mb_cr_size_x, ImageParameters::mb_cr_size_y, macroblock::mb_field, macroblock::mb_nr, ImageParameters::mb_pred, macroblock::mb_type, ImageParameters::MbaffFrameFlag, Mode_Decision_for_Intra4x4Macroblock(), Mode_Decision_for_Intra8x8Macroblock(), storable_picture::motion, ImageParameters::mpr_16x16, InputParameters::NoOfDecoders, ImageParameters::num_blk8x8_uv, ImageParameters::nz_coeff, ImageParameters::opix_c_x, ImageParameters::opix_c_y, ImageParameters::opix_x, ImageParameters::opix_y, out_of_bounds_mvs(), storable_picture::p_curr_img, storable_picture::p_dec_img, pCurImg, ImageParameters::pix_c_x, ImageParameters::pix_c_y, ImageParameters::pix_y, macroblock::PrevMB, InputParameters::ProfileIDC, macroblock::qp_scaled, InputParameters::RCEnable, InputParameters::rdopt, Decoders::res_img, reset_coding_state(), SetCoeffAndReconstruction8x8(), SetModesAndRefframeForBlocks(), SetMotionVectorsMB(), store_coding_state(), ImageParameters::type, ue_linfo(), writeMBLayer(), YUV400, YUV444, and ImageParameters::yuv_format.

Referenced by compute_mode_RD_cost().

Here is the call graph for this function:

void reset_adaptive_rounding (  ) 

void set_block8x8_info ( Block8x8Info *  ,
int  ,
int  ,
char  [2],
char  ,
short   
)

void set_stored_macroblock_parameters ( Macroblock *  currMB  ) 

Set stored macroblock parameters.

Definition at line 1669 of file rdopt.c.

References ImageParameters::AdaptiveRounding, ImageParameters::all_mv, RD_DATA::b8mode, macroblock::b8mode, RD_DATA::b8pdir, macroblock::b8pdir, macroblock::bipred_me, ImageParameters::bipred_mv, ImageParameters::block_x, ImageParameters::block_y, RD_DATA::c_ipred_mode, macroblock::c_ipred_mode, RD_DATA::cbp, macroblock::cbp, RD_DATA::cbp_blk, macroblock::cbp_blk, RD_DATA::cofAC, ImageParameters::cofAC, RD_DATA::cofDC, ImageParameters::cofDC, Decoders::dec_mbY_best, macroblock::delta_qp, RD_DATA::delta_qp, errdo_get_best_block(), ImageParameters::i16offset, RD_DATA::i16offset, storable_picture::imgUV, storable_picture::imgY, RD_DATA::intra_pred_modes, macroblock::intra_pred_modes, RD_DATA::intra_pred_modes8x8, macroblock::intra_pred_modes8x8, RD_DATA::ipredmode, ImageParameters::ipredmode, ImageParameters::ipredmode8x8, is_bipred_enabled(), macroblock::list_offset, RD_DATA::luma_transform_size_8x8_flag, macroblock::luma_transform_size_8x8_flag, ImageParameters::mb_cr_size_x, ImageParameters::mb_cr_size_y, RD_DATA::mb_type, macroblock::mb_type, ImageParameters::MbaffFrameFlag, RD_DATA::mode, storable_picture::motion, pic_motion_params::mv, ImageParameters::num_blk8x8_uv, ImageParameters::P444_joined, storable_picture::p_dec_img, ImageParameters::pix_c_x, ImageParameters::pix_c_y, ImageParameters::pix_x, ImageParameters::pix_y, macroblock::prev_cbp, RD_DATA::prev_cbp, macroblock::prev_dqp, RD_DATA::prev_dqp, macroblock::prev_qp, RD_DATA::prev_qp, macroblock::qp, RD_DATA::qp, InputParameters::rdopt, InputParameters::RDOQ_QP_Num, RD_DATA::rec_mb_cr, RD_DATA::rec_mbY, pic_motion_params::ref_idx, pic_motion_params::ref_pic_id, storable_picture::ref_pic_num, RD_DATA::refar, RestoreMV8x8(), SetMotionVectorsMB(), InputParameters::Transform8x8Mode, ImageParameters::type, update_offset_params(), InputParameters::UseRDOQuant, macroblock::valid_8x8, YUV400, and ImageParameters::yuv_format.

Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), and encode_one_macroblock_highloss().

Here is the call graph for this function:

void set_subblock8x8_info ( Block8x8Info *  ,
int  ,
int  ,
RD_8x8DATA *   
)

void SetCoeffAndReconstruction8x8 ( Macroblock *   ) 

void SetModesAndRefframeForBlocks ( Macroblock *  currMB,
int   
)

void SetRefAndMotionVectors ( PicMotionParams *  motion,
Macroblock *  currMB,
int  ,
int  ,
int  ,
int  ,
int  ,
short   
)

void store_macroblock_parameters ( Macroblock *  currMB,
int   
)

void StoreMV8x8 ( int  dir  ) 

Store motion vectors of 8x8 partitions of one macroblock.

Definition at line 2242 of file rdopt.c.

References StoreMVBlock8x8(), and ImageParameters::type.

Referenced by SetCoeffAndReconstruction8x8().

Here is the call graph for this function:

void StoreNewMotionVectorsBlock8x8 ( int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int   
)

Store predictors for 8x8 partition.

Definition at line 2338 of file rdopt.c.

References ImageParameters::all_mv, and ImageParameters::bipred_mv.

Referenced by submacroblock_mode_decision(), and submacroblock_mode_decision_low().

void submacroblock_mode_decision ( Slice *  currSlice,
RD_PARAMS *  ,
RD_8x8DATA *  ,
Macroblock *  ,
int ****  ,
int *  ,
short  ,
int  ,
int *  ,
int *  ,
int *  ,
int  ,
int   
)

void submacroblock_mode_decision_low ( Slice *  currSlice,
RD_PARAMS *  ,
RD_8x8DATA *  ,
Macroblock *  ,
int ****  ,
int *  ,
short  ,
int  ,
int *  ,
int *  ,
int *  ,
int  ,
int   
)

int transform_termination_control ( Macroblock *  currMB,
int  mode,
int  bslice 
)

Decides whether to perform tranform 8x8 for this mode.

Definition at line 1308 of file mode_decision.c.

References macroblock::luma_transform_size_8x8_flag, and InputParameters::Transform8x8Mode.

Referenced by compute_mode_RD_cost().


Variable Documentation

int QP2QUANT[40]

convert from H.263 QP to H.264 quant given by: quant=pow(2,QP/6)

Definition at line 59 of file slice.c.


Documentation generated with DoxyGen