Go to the source code of this file.
Functions | |
int | BIDPartitionCost (Macroblock *currMB, int, int, char[2], int) |
int | BPredPartitionCost (Macroblock *currMB, int, int, short, short, int, int) |
void | StoreMV8x8 (Slice *currSlice, int dir) |
void | RestoreMV8x8 (Slice *currSlice, int dir) |
void | store_macroblock_parameters (Macroblock *currMB, int) |
void | SetModesAndRefframeForBlocks (Macroblock *currMB, short) |
void | StoreNewMotionVectorsBlock8x8 (Slice *currSlice, int, int, Info8x8 *) |
void | assign_enc_picture_params (Macroblock *currMB, int mode, Info8x8 *best, int block) |
void | set_subblock8x8_info (Block8x8Info *, int, int, RD_8x8DATA *) |
void | set_block8x8_info (Block8x8Info *, int, int, Info8x8 *best) |
void | update_refresh_map (Macroblock *currMB, int intra, int intra1) |
void | SetCoeffAndReconstruction8x8 (Macroblock *currMB) |
void | get_bipred_cost (Macroblock *currMB, int mode, int block, int i, int j, Info8x8 *best, RD_PARAMS *enc_mb, int bmcost[5]) |
short | I16Offset (int, short) |
int | CheckReliabilityOfRef (Macroblock *currMB, int block, int list_idx, int ref, int mode) |
int | Mode_Decision_for_Intra4x4Macroblock (Macroblock *currMB, double, double *) |
int | RDCost_for_macroblocks (Macroblock *currMB, double, short) |
double | RDCost_for_8x8blocks (Macroblock *currMB, RD_8x8DATA *dataTr, int *, int64 *, double, int, short, Info8x8 *, double) |
void | rc_store_diff (int diff[16][16], imgpel **p_curImg, int cpix_x, imgpel **prediction) |
void | submacroblock_mode_decision (Macroblock *currMB, RD_PARAMS *, RD_8x8DATA *, int ****, int, int *) |
void | submacroblock_mode_decision_low (Macroblock *currMB, RD_PARAMS *, RD_8x8DATA *, int ****, int *, int, int *, int *, int *, int) |
void | init_enc_mb_params (Macroblock *currMB, RD_PARAMS *enc_mb, int intra) |
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[5], Info8x8 *, int *) |
void | compute_mode_RD_cost (Macroblock *currMB, RD_PARAMS *enc_mb, short mode, short *inter_skip) |
int | transform_termination_control (Macroblock *currMB, int mode) |
int | bslice_16x16_termination_control (InputParameters *p_Inp, Block8x8Info *b8x8info, int *ctr16x16, int mode, int bslice) |
int | iminarray (int arr[], int size, int *minind) |
void | update_lambda_costs (Macroblock *currMB, RD_PARAMS *enc_mb, int lambda_mf[3]) |
void | get_initial_mb16x16_cost (Macroblock *currMB) |
void | adjust_mb16x16_cost (Macroblock *currMB, int cost) |
void | reset_adaptive_rounding (ImageParameters *p_Img) |
int64 | distortionSSE (Macroblock *currMB) |
Variables | |
static const int | b8_mode_table [6] = {0, 4, 5, 6, 7} |
static const char | mb_mode_table [9] = {0, 1, 2, 3, P8x8, I16MB, I4MB, I8MB, IPCM} |
Definition in file mode_decision.h.
int BIDPartitionCost | ( | Macroblock * | currMB, | |
int | , | |||
int | , | |||
char | [2], | |||
int | ||||
) |
Motion Cost for Bidirectional modes.
Definition at line 1138 of file mv_search.c.
References slice::all_mv, luma_prediction(), slice::mb_pred, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, img_par::pCurImg, and macroblock::pix_x.
Referenced by list_prediction_cost().
int BPredPartitionCost | ( | Macroblock * | currMB, | |
int | , | |||
int | , | |||
short | , | |||
short | , | |||
int | , | |||
int | ||||
) |
Motion Cost for Bidirectional modes.
Definition at line 581 of file mv_search.c.
References slice::bipred_mv, luma_prediction_bi(), slice::mb_pred, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, img_par::pCurImg, and macroblock::pix_x.
Referenced by list_prediction_cost().
int bslice_16x16_termination_control | ( | InputParameters * | p_Inp, | |
Block8x8Info * | b8x8info, | |||
int * | ctr16x16, | |||
int | mode, | |||
int | bslice | |||
) |
Update prediction direction for mode P16x16 to check all prediction directions.
Definition at line 1424 of file mode_decision.c.
References inp_par_enc::BiPredMotionEstimation, and error().
Referenced by compute_mode_RD_cost().
int CheckReliabilityOfRef | ( | Macroblock * | currMB, | |
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.
Definition at line 351 of file rdopt.c.
References slice::all_mv, macroblock::block_x, macroblock::block_y, img_par::height, macroblock::p_Img, macroblock::p_slice, img_par::pixel_map, and img_par::width.
Referenced by list_prediction_cost().
void compute_mode_RD_cost | ( | Macroblock * | currMB, | |
RD_PARAMS * | enc_mb, | |||
short | mode, | |||
short * | inter_skip | |||
) |
RD decision process.
Definition at line 385 of file mode_decision.c.
References img_par::AdaptiveRounding, img_par::ARCofAdj4x4, img_par::ARCofAdj8x8, img_par::b8x8info, bslice_16x16_termination_control(), macroblock::c_ipred_mode, slice::cofAC, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, img_par::pCurImg, macroblock::pix_x, macroblock::qp_scaled, rc_store_diff(), inp_par_enc::RCEnable, RDCost_for_macroblocks(), reset_adaptive_rounding_direct(), SetModesAndRefframeForBlocks(), slice::slice_type, store_macroblock_parameters(), transform_termination_control(), and update_adaptive_rounding_16x16().
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), and encode_one_macroblock_highloss().
void determine_prediction_list | ( | int | [5], | |
Info8x8 * | , | |||
int * | ||||
) |
Determination of prediction list based on simple distortion computation.
Definition at line 358 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().
int64 distortionSSE | ( | Macroblock * | currMB | ) |
SSE distortion calculation for a macroblock.
Definition at line 158 of file md_distortion.c.
References compute_SSE16x16(), storable_picture::imgUV, macroblock::opix_c_y, macroblock::opix_y, storable_picture::p_curr_img, macroblock::p_Img, img_par::pCurImg, macroblock::pix_c_x, macroblock::pix_c_y, macroblock::pix_x, macroblock::pix_y, and YUV400.
void get_bipred_cost | ( | Macroblock * | currMB, | |
int | mode, | |||
int | block, | |||
int | i, | |||
int | j, | |||
Info8x8 * | best, | |||
RD_PARAMS * | enc_mb, | |||
int | bmcost[5] | |||
) |
Compute bipred costs.
Definition at line 1480 of file mode_decision.c.
References slice::all_mv, slice::bipred_mv, list_prediction_cost(), and macroblock::p_slice.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and submacroblock_mode_decision().
int iminarray | ( | int | arr[], | |
int | size, | |||
int * | minind | |||
) |
Return array's minimum and its index.
Definition at line 1332 of file mode_decision.c.
Referenced by determine_prediction_list().
void init_enc_mb_params | ( | Macroblock * | currMB, | |
RD_PARAMS * | enc_mb, | |||
int | intra | |||
) |
Initialize Encoding parameters for Macroblock.
Definition at line 120 of file mode_decision.c.
References macroblock::c_ipred_mode, check_for_SI16(), F_PEL, H_PEL, img_par::lambda_md, img_par::lambda_me, img_par::lambda_mf, img_par::masterQP, macroblock::mbAddrX, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, Q_PEL, img_par::qp, reset_valid_modes(), slice::slice_type, smpUMHEX_decide_intrabk_SAD(), UMHEX_decide_intrabk_SAD(), and UMHEX_DefineThresholdMB().
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
void list_prediction_cost | ( | Macroblock * | currMB, | |
int | list, | |||
int | block, | |||
int | mode, | |||
RD_PARAMS * | enc_mb, | |||
int | bmcost[5], | |||
char | best_ref[2] | |||
) |
computation of prediction list (including biprediction) cost
Definition at line 279 of file mode_decision.c.
References BIDPartitionCost(), BPredPartitionCost(), CheckReliabilityOfRef(), macroblock::p_Img, macroblock::p_slice, Q_PEL, slice::slice_type, inp_par_enc::sp2_frame_indicator, inp_par_enc::sp_output_indicator, and slice::wbp_weight.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), encode_one_macroblock_low(), get_bipred_cost(), submacroblock_mode_decision(), and submacroblock_mode_decision_low().
int Mode_Decision_for_Intra4x4Macroblock | ( | Macroblock * | currMB, | |
double | , | |||
double * | ||||
) |
4x4 Intra mode decision for an macroblock
Definition at line 388 of file rd_intra_jm.c.
References Mode_Decision_for_IntraSubMBlocks(), and macroblock::p_slice.
Referenced by encode_one_macroblock_low(), and RDCost_for_macroblocks().
void rc_store_diff | ( | int | diff[16][16], | |
imgpel ** | p_curImg, | |||
int | cpix_x, | |||
imgpel ** | prediction | |||
) |
Update Rate Control Difference.
Definition at line 375 of file ratectl.c.
Referenced by compute_mode_RD_cost(), encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
double RDCost_for_8x8blocks | ( | Macroblock * | currMB, | |
RD_8x8DATA * | dataTr, | |||
int * | , | |||
int64 * | , | |||
double | , | |||
int | , | |||
short | , | |||
Info8x8 * | , | |||
double | ||||
) |
R-D Cost for an 8x8 Partition.
Definition at line 664 of file rdopt.c.
References macroblock::ar_mode, arienco_bits_written(), assignSE2partition, B8Mode2Value(), macroblock::block_x, macroblock::block_y, compute_residue_block(), compute_SSE8x8(), decode_one_b8block(), slice::direct_pdir, slice::direct_ref_idx, storable_picture::imgUV, storable_picture::imgY, syntaxelement::len, luma_residual_coding_8x8(), luma_residual_coding_p444_8x8(), slice::mb_pred, macroblock::opix_y, storable_picture::p_dec_img, storable_picture::p_img, macroblock::p_Img, macroblock::p_slice, slice::partArr, img_par::pCurImg, macroblock::pix_x, macroblock::pix_y, decoders::res_img, slice::slice_type, slice::tex_ctx, syntaxelement::type, ue_linfo(), syntaxelement::value1, slice::wbp_weight, writeCBP_BIT_CABAC(), writeCoeff8x8(), writeMotionVector8x8(), and writeReferenceFrame().
Referenced by submacroblock_mode_decision().
int RDCost_for_macroblocks | ( | Macroblock * | currMB, | |
double | , | |||
short | ||||
) |
R-D Cost for a macroblock.
Definition at line 1459 of file rdopt.c.
References slice::all_mv, chroma_residual_coding(), img_par::cod_counter, compute_residue_block(), compute_SSE16x16(), copy_image_data(), copy_image_data_16x16(), decode_one_mb(), field_flag_inference(), storable_picture::imgUV, storable_picture::imgY, Intra16x16_Mode_Decision444(), Intra16x16_Mode_Decision_RDopt(), Intra16x16_Mode_Decision_SAD(), luma_residual_coding(), luma_residual_coding_p444(), slice::mb_pred, macroblock::mb_type, macroblock::mbAddrX, Mode_Decision_for_Intra4x4Macroblock(), Mode_Decision_for_Intra8x8Macroblock(), storable_picture::motion, slice::mpr_16x16, img_par::nz_coeff, macroblock::opix_c_y, macroblock::opix_y, out_of_bounds_mvs(), storable_picture::p_curr_img, storable_picture::p_dec_img, macroblock::p_Img, macroblock::p_slice, img_par::pCurImg, macroblock::pix_c_x, macroblock::pix_c_y, macroblock::pix_x, macroblock::pix_y, inp_par_enc::ProfileIDC, macroblock::qp_scaled, inp_par_enc::RCEnable, decoders::res_img, SetCoeffAndReconstruction8x8(), SetModesAndRefframeForBlocks(), slice::slice_type, ue_linfo(), YUV400, and YUV444.
Referenced by compute_mode_RD_cost().
void reset_adaptive_rounding | ( | ImageParameters * | p_Img | ) |
resets adaptive rounding p_Inp to zero
Definition at line 232 of file q_around.c.
References img_par::ARCofAdj4x4, img_par::ARCofAdj8x8, and YUV400.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
void RestoreMV8x8 | ( | Slice * | currSlice, | |
int | dir | |||
) |
Restore motion vectors of 8x8 partitions of one macroblock.
Definition at line 2971 of file rdopt.c.
References RestoreMVBlock8x8().
Referenced by set_stored_macroblock_parameters(), set_stored_macroblock_parameters_mpass(), set_stored_macroblock_parameters_sp(), and SetCoeffAndReconstruction8x8().
void set_block8x8_info | ( | Block8x8Info * | , | |
int | , | |||
int | , | |||
Info8x8 * | best | |||
) |
Set block 8x8 mode information.
Definition at line 3306 of file rdopt.c.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
void set_subblock8x8_info | ( | Block8x8Info * | , | |
int | , | |||
int | , | |||
RD_8x8DATA * | ||||
) |
Set block 8x8 mode information for P8x8 mode.
Definition at line 3339 of file rdopt.c.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
void SetCoeffAndReconstruction8x8 | ( | Macroblock * | currMB | ) |
Sets Coefficients and reconstruction for an 8x8 block.
Definition at line 1181 of file rdopt.c.
References _LUMA_8x8_COEFF_COST_, macroblock::block_x, macroblock::block_y, macroblock::cbp_blk, slice::cofAC, copy_image_data_16x16(), decoders::dec_mb_pred_best8x8, decoders::dec_mbY_best8x8, errdo_get_best_block(), storable_picture::imgUV, storable_picture::imgY, storable_picture::motion, storable_picture::p_dec_img, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, macroblock::qp_scaled, pic_motion_params::ref_idx, pic_motion_params::ref_pic_id, RestoreMV8x8(), slice::slice_type, and StoreMV8x8().
Referenced by encode_one_macroblock_low(), and RDCost_for_macroblocks().
void SetModesAndRefframeForBlocks | ( | Macroblock * | currMB, | |
short | ||||
) |
Sets modes and reference frames for a macroblock.
Definition at line 884 of file rdopt.c.
References macroblock::ar_mode, img_par::b8x8info, macroblock::block_x, macroblock::block_y, slice::direct_pdir, slice::direct_ref_idx, macroblock::mb_type, storable_picture::motion, macroblock::p_Img, macroblock::p_slice, pic_motion_params::ref_idx, pic_motion_params::ref_pic_id, and slice::slice_type.
Referenced by compute_mode_RD_cost(), encode_one_macroblock_low(), and RDCost_for_macroblocks().
void store_macroblock_parameters | ( | Macroblock * | currMB, | |
int | ||||
) |
Store macroblock parameters.
Definition at line 1729 of file rdopt.c.
References img_par::AdaptiveRounding, img_par::ARCofAdj4x4, img_par::ARCofAdj8x8, macroblock::block_x, macroblock::block_y, macroblock::c_ipred_mode, macroblock::cbp_blk, slice::cofAC, slice::cofDC, copy_image_data(), copy_image_data_16x16(), decoders::dec_mbY_best, errdo_store_best_block(), storable_picture::imgUV, storable_picture::imgY, macroblock::intra_pred_modes8x8, img_par::ipredmode, img_par::ipredmode8x8, storable_picture::motion, storable_picture::p_dec_img, macroblock::p_Img, macroblock::p_slice, macroblock::pix_c_x, macroblock::pix_c_y, macroblock::pix_x, macroblock::pix_y, pic_motion_params::ref_idx, slice::slice_type, store_adaptive_rounding_16x16(), and YUV400.
Referenced by compute_mode_RD_cost().
void StoreMV8x8 | ( | Slice * | currSlice, | |
int | dir | |||
) |
Store motion vectors of 8x8 partitions of one macroblock.
Definition at line 2894 of file rdopt.c.
References StoreMVBlock8x8().
Referenced by SetCoeffAndReconstruction8x8().
Store predictors for 8x8 partition.
Definition at line 2987 of file rdopt.c.
References slice::all_mv, slice::bipred_mv, and slice::slice_type.
Referenced by submacroblock_mode_decision(), and submacroblock_mode_decision_low().
void submacroblock_mode_decision | ( | Macroblock * | currMB, | |
RD_PARAMS * | , | |||
RD_8x8DATA * | , | |||
int **** | , | |||
int | , | |||
int * | ||||
) |
Mode Decision for an 8x8 sub-macroblock.
Definition at line 509 of file mode_decision.c.
References slice::all_mv, img_par::ARCofAdj4x4, img_par::ARCofAdj8x8, slice::bipred_mv, macroblock::block_x, macroblock::block_y, slice::cofAC, copy_image_data_8x8(), inp_par_enc::CtxAdptLagrangeMult, decoders::dec_mb_pred, decoders::dec_mb_pred_best8x8, decoders::dec_mbY_best8x8, determine_prediction_list(), slice::direct_pdir, slice::direct_ref_idx, errdo_get_best_block(), errdo_store_best_block(), F_PEL, get_bipred_cost(), H_PEL, storable_picture::imgUV, storable_picture::imgY, is_bipred_enabled(), list_prediction_cost(), slice::mb_pred, macroblock::mbAddrX, storable_picture::motion, pic_motion_params::mv, img_par::nz_coeff, storable_picture::p_dec_img, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, Q_PEL, RDCost_for_8x8blocks(), pic_motion_params::ref_idx, pic_motion_params::ref_pic_id, slice::slice_type, StoreNewMotionVectorsBlock8x8(), SubPartitionMotionSearch(), and update_adaptive_rounding_8x8().
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), and encode_one_macroblock_highloss().
void submacroblock_mode_decision_low | ( | Macroblock * | currMB, | |
RD_PARAMS * | , | |||
RD_8x8DATA * | , | |||
int **** | , | |||
int * | , | |||
int | , | |||
int * | , | |||
int * | , | |||
int * | , | |||
int | ||||
) |
Low Complexity Mode Decision for an 8x8 sub-macroblock.
Definition at line 862 of file mode_decision.c.
References macroblock::ar_mode, img_par::ARCofAdj4x4, img_par::ARCofAdj8x8, B8Mode2Value(), macroblock::block_x, macroblock::block_y, slice::cofAC, copy_image_data_8x8(), inp_par_enc::CtxAdptLagrangeMult, determine_prediction_list(), slice::direct_pdir, slice::direct_ref_idx, F_PEL, GetDirectCost8x8(), H_PEL, storable_picture::imgUV, storable_picture::imgY, is_bipred_enabled(), img_par::lambda_mf, list_prediction_cost(), luma_residual_coding_8x8(), luma_residual_coding_p444_8x8(), slice::mb_pred, macroblock::mbAddrX, storable_picture::motion, img_par::nz_coeff, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, Q_PEL, pic_motion_params::ref_idx, pic_motion_params::ref_pic_id, slice::slice_type, StoreNewMotionVectorsBlock8x8(), SubPartitionMotionSearch(), and update_adaptive_rounding_8x8().
Referenced by encode_one_macroblock_low().
int transform_termination_control | ( | Macroblock * | currMB, | |
int | mode | |||
) |
Decides whether to perform tranform 8x8 for this mode.
Definition at line 1384 of file mode_decision.c.
References macroblock::p_Img, macroblock::p_slice, and slice::slice_type.
Referenced by compute_mode_RD_cost().