#include "global.h"
#include "rdopt_coding_state.h"
Go to the source code of this file.
Data Structures | |
struct | BestMode |
struct | rdo_structure |
Functions | |
int | GetBestTransformP8x8 (Macroblock *currMB) |
byte | field_flag_inference (Macroblock *currMB) |
double | rdcost_for_4x4_intra_blocks (Macroblock *currMB, int *nonzero, int b8, int b4, int ipmode, double lambda, int mostProbableMode, double min_rdcost) |
double | rdcost_for_4x4_intra_blocks_444 (Macroblock *currMB, int *nonzero, int b8, int b4, int ipmode, double lambda, int mostProbableMode, double min_rdcost) |
int | valid_intra_mode (Slice *currSlice, int ipmode) |
void | init_md_best (BestMode *best) |
void | generate_pred_error_4x4 (imgpel **cur_img, imgpel **prd_img, imgpel **cur_prd, int **mb_rres, int pic_opix_x, int block_x) |
void | generate_pred_error_8x8 (imgpel **cur_img, imgpel **prd_img, imgpel **cur_prd, int **mb_rres, int pic_opix_x, int block_x) |
void | clear_rdopt (Slice *currSlice) |
void | init_rdopt (Slice *currSlice) |
void | UpdatePixelMap (ImageParameters *p_Img, InputParameters *p_Inp) |
void | update_qp_cbp (Macroblock *currMB) |
void | update_qp_cbp_tmp (Macroblock *currMB, int cbp) |
void | alloc_rd8x8data (RD_8x8DATA *rd_data) |
void | free_rd8x8data (RD_8x8DATA *rd_data) |
void | restore_nz_coeff (Macroblock *currMB) |
void | end_encode_one_macroblock (Macroblock *currMB) |
void | encode_one_macroblock_low (Macroblock *currMB) |
void | encode_one_macroblock_high (Macroblock *currMB) |
void | encode_one_macroblock_highfast (Macroblock *currMB) |
void | encode_one_macroblock_highloss (Macroblock *currMB) |
static void | copy_4x4block (imgpel **oblock, imgpel **iblock, int o_xoffset, int i_xoffset) |
Definition in file rdopt.h.
void clear_rdopt | ( | Slice * | currSlice | ) |
delete structure for RD-optimized mode decision
Definition at line 92 of file rdopt.c.
References delete_coding_state(), EXTENDED, free_mem2D(), free_mem2Dint(), free_mem2Dpel(), free_mem3Dint(), free_mem3Dpel(), free_mem5Dshort(), free_mem_ACcoeff(), free_mem_ACcoeff_new(), free_mem_DCcoeff(), and inp_par_enc::ProfileIDC.
Referenced by free_slice().
static void copy_4x4block | ( | imgpel ** | oblock, | |
imgpel ** | iblock, | |||
int | o_xoffset, | |||
int | i_xoffset | |||
) | [inline, static] |
copy data in iblock to oblock
Definition at line 122 of file rdopt.h.
Referenced by Mode_Decision_for_4x4IntraBlocks_JM_High(), and Mode_Decision_for_4x4IntraBlocks_JM_High444().
void encode_one_macroblock_high | ( | Macroblock * | currMB | ) |
Mode Decision for a macroblock.
Definition at line 37 of file md_high.c.
References inp_par_enc::AdaptiveRounding, img_par::b8x8info, macroblock::c_ipred_mode, compute_mode_RD_cost(), inp_par_enc::CtxAdptLagrangeMult, determine_prediction_list(), FindSkipModeMotionVector(), get_bipred_cost(), init_enc_mb_params(), init_md_best(), is_bipred_enabled(), list_prediction_cost(), slice::mb_pred, macroblock::mb_y, img_par::mb_y_intra, macroblock::mbAddrX, storable_picture::motion, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, PartitionMotionSearch(), img_par::pCurImg, macroblock::pix_x, RandomIntra(), rc_store_diff(), rc_store_mad(), inp_par_enc::RCEnable, reset_adaptive_rounding(), reset_mb_nz_coeff(), restore_nz_coeff(), set_block8x8_info(), set_subblock8x8_info(), SetChromaPredMode(), inp_par_enc::SkipIntraInInterSlices, slice::slice_type, submacroblock_mode_decision(), and YUV400.
Referenced by init_rdopt().
void encode_one_macroblock_highfast | ( | Macroblock * | currMB | ) |
Mode Decision for a macroblock.
Definition at line 94 of file md_highfast.c.
References inp_par_enc::AdaptiveRounding, slice::all_mv, img_par::b8x8info, macroblock::block_x, macroblock::block_y, macroblock::c_ipred_mode, compute_mode_RD_cost(), inp_par_enc::CtxAdptLagrangeMult, determine_prediction_list(), fast_mode_intra_decision(), FindSkipModeMotionVector(), get_bipred_cost(), init_enc_mb_params(), init_md_best(), is_bipred_enabled(), list_prediction_cost(), slice::mb_pred, macroblock::mb_y, img_par::mb_y_intra, macroblock::mbAddrX, storable_picture::motion, pic_motion_params::mv, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, PartitionMotionSearch(), img_par::pCurImg, macroblock::pix_x, inp_par_enc::ProfileIDC, RandomIntra(), rc_store_diff(), rc_store_mad(), inp_par_enc::RCEnable, pic_motion_params::ref_idx, reset_adaptive_rounding(), reset_mb_nz_coeff(), restore_nz_coeff(), set_block8x8_info(), set_subblock8x8_info(), SetChromaPredMode(), inp_par_enc::SkipIntraInInterSlices, slice::slice_type, submacroblock_mode_decision(), and YUV400.
Referenced by init_rdopt().
void encode_one_macroblock_highloss | ( | Macroblock * | currMB | ) |
Mode Decision for a macroblock with error resilience.
Definition at line 37 of file md_highloss.c.
References inp_par_enc::AdaptiveRounding, img_par::b8x8info, macroblock::c_ipred_mode, compute_mode_RD_cost(), inp_par_enc::CtxAdptLagrangeMult, determine_prediction_list(), FindSkipModeMotionVector(), get_bipred_cost(), init_enc_mb_params(), init_md_best(), is_bipred_enabled(), list_prediction_cost(), slice::mb_pred, macroblock::mb_y, img_par::mb_y_intra, macroblock::mbAddrX, storable_picture::motion, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, PartitionMotionSearch(), img_par::pCurImg, macroblock::pix_x, RandomIntra(), rc_store_diff(), rc_store_mad(), inp_par_enc::RCEnable, reset_adaptive_rounding(), reset_mb_nz_coeff(), restore_nz_coeff(), set_block8x8_info(), set_subblock8x8_info(), SetChromaPredMode(), inp_par_enc::SkipIntraInInterSlices, slice::slice_type, submacroblock_mode_decision(), and YUV400.
Referenced by init_rdopt().
void encode_one_macroblock_low | ( | Macroblock * | currMB | ) |
Mode Decision for a macroblock.
have_direct
Definition at line 42 of file md_low.c.
References img_par::AdaptiveRounding, inp_par_enc::AdaptiveRounding, slice::all_mv, macroblock::ar_mode, img_par::b8x8info, macroblock::block_x, macroblock::block_y, chroma_residual_coding(), slice::cofAC, copy_image_data_16x16(), inp_par_enc::CtxAdptLagrangeMult, determine_prediction_list(), FindSkipModeMotionVector(), free_mem3Dpel(), get_mem3Dpel(), GetBestTransformP8x8(), GetDirectCostMB(), storable_picture::imgUV, storable_picture::imgY, init_enc_mb_params(), init_md_best(), intra_chroma_prediction(), macroblock::intra_pred_modes8x8, intrapred_16x16(), img_par::ipredmode, img_par::ipredmode8x8, is_bipred_enabled(), list_prediction_cost(), luma_residual_coding(), luma_residual_coding_p444(), slice::mb_pred, macroblock::mb_type, macroblock::mb_y, img_par::mb_y_intra, macroblock::mbAddrX, Mode_Decision_for_Intra4x4Macroblock(), Mode_Decision_for_Intra8x8Macroblock(), storable_picture::motion, slice::mpr_16x16, pic_motion_params::mv, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, PartitionMotionSearch(), img_par::pCurImg, macroblock::pix_x, macroblock::pix_y, RandomIntra(), rc_store_diff(), rc_store_mad(), inp_par_enc::RCEnable, pic_motion_params::ref_idx, reset_adaptive_rounding(), reset_mb_nz_coeff(), select_plane(), set_block8x8_info(), set_mbaff_parameters(), set_subblock8x8_info(), SetCoeffAndReconstruction8x8(), SetModesAndRefframeForBlocks(), slice::slice_type, submacroblock_mode_decision_low(), TransformDecision(), update_offset_params(), YUV400, and YUV444.
Referenced by init_rdopt().
void end_encode_one_macroblock | ( | Macroblock * | currMB | ) |
Update parameters after encoding a macroblock.
Definition at line 74 of file mode_decision.c.
References field_flag_inference(), macroblock::mb_type, macroblock::mbAddrX, macroblock::p_Img, macroblock::p_slice, slice::slice_type, smpUMHEX_skip_intrabk_SAD(), update_qp_cbp(), and inp_par_enc::UseConstrainedIntraPred.
Referenced by encode_one_slice(), and encode_one_slice_MBAFF().
byte field_flag_inference | ( | Macroblock * | currMB | ) |
skip macroblock field inference
Definition at line 2803 of file rdopt.c.
References img_par::mb_data, and macroblock::p_Img.
Referenced by end_encode_one_macroblock(), RDCost_for_macroblocks(), writeMBLayerBSlice(), and writeMBLayerPSlice().
int GetBestTransformP8x8 | ( | Macroblock * | currMB | ) |
Makes the decision if 8x8 tranform will be used (for RD-off).
Definition at line 3061 of file rdopt.c.
References macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, img_par::pCurImg, and macroblock::pix_x.
Referenced by encode_one_macroblock_low().
void init_md_best | ( | BestMode * | best | ) |
Initialize best mode information.
Definition at line 1711 of file rdopt.c.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
void init_rdopt | ( | Slice * | currSlice | ) |
create structure for RD-optimized mode decision
Definition at line 178 of file rdopt.c.
References create_coding_state(), inp_par_enc::CtxAdptLagrangeMult, encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), encode_one_macroblock_low(), EXTENDED, find_sad_16x16_JM(), get_mem2D(), get_mem2Dint(), get_mem2Dpel(), get_mem3Dint(), get_mem3Dpel(), get_mem5Dshort(), get_mem_ACcoeff(), get_mem_ACcoeff_new(), get_mem_DCcoeff(), Mode_Decision_for_4x4IntraBlocks_JM_High(), Mode_Decision_for_4x4IntraBlocks_JM_High444(), Mode_Decision_for_4x4IntraBlocks_JM_Low(), Mode_Decision_for_4x4IntraBlocks_JM_Low444(), Mode_Decision_for_8x8IntraBlocks_JM_High(), Mode_Decision_for_8x8IntraBlocks_JM_High444(), Mode_Decision_for_8x8IntraBlocks_JM_Low(), Mode_Decision_for_8x8IntraBlocks_JM_Low444(), no_mem_exit(), inp_par_enc::ProfileIDC, rdcost_for_4x4_intra_blocks(), rdcost_for_4x4_intra_blocks_444(), rdcost_for_8x8_intra_blocks(), rdcost_for_8x8_intra_blocks_444(), set_ref_and_motion_vectors_B_slice(), set_ref_and_motion_vectors_P_slice(), set_stored_macroblock_parameters(), set_stored_macroblock_parameters_mpass(), set_stored_macroblock_parameters_sp(), slice::slice_type, and YUV444.
Referenced by init_slice().
double rdcost_for_4x4_intra_blocks | ( | Macroblock * | currMB, | |
int * | nonzero, | |||
int | b8, | |||
int | b4, | |||
int | ipmode, | |||
double | lambda, | |||
int | mostProbableMode, | |||
double | min_rdcost | |||
) |
R-D Cost for an 4x4 Intra block.
Definition at line 498 of file rdopt.c.
References assignSE2partition, compute_SSE4x4(), syntaxelement::context, storable_picture::imgY, syntaxelement::len, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, slice::partArr, img_par::pCurImg, macroblock::pix_x, macroblock::pix_y, syntaxelement::type, syntaxelement::value1, and writeCoeff4x4_CABAC().
Referenced by init_rdopt().
double rdcost_for_4x4_intra_blocks_444 | ( | Macroblock * | currMB, | |
int * | nonzero, | |||
int | b8, | |||
int | b4, | |||
int | ipmode, | |||
double | lambda, | |||
int | mostProbableMode, | |||
double | min_rdcost | |||
) |
R-D Cost for an 4x4 Intra block.
Definition at line 573 of file rdopt.c.
References assignSE2partition, compute_SSE4x4(), syntaxelement::context, storable_picture::imgY, syntaxelement::len, macroblock::opix_y, storable_picture::p_curr_img, macroblock::p_Img, macroblock::p_slice, slice::partArr, img_par::pCurImg, macroblock::pix_x, macroblock::pix_y, select_plane(), syntaxelement::type, syntaxelement::value1, and writeCoeff4x4_CABAC().
Referenced by init_rdopt().
void restore_nz_coeff | ( | Macroblock * | currMB | ) |
Restore Non zero coefficients.
Definition at line 1441 of file rdopt.c.
References macroblock::mbAddrX, img_par::nz_coeff, and macroblock::p_Img.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), and encode_one_macroblock_highloss().
void update_qp_cbp | ( | Macroblock * | currMB | ) |
Update QP Parameters (in case of SKIP MBs or MBAFF).
Definition at line 3542 of file rdopt.c.
References inp_par_enc::MbInterlace, macroblock::p_Img, macroblock::p_slice, img_par::qp, macroblock::qp, and update_qp().
Referenced by end_encode_one_macroblock().
void UpdatePixelMap | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp | |||
) |
Updates the pixel map that shows, which reference frames are reliable for each MB-area of the picture.
Definition at line 302 of file rdopt.c.
References img_par::height, inp_par_enc::num_ref_frames, img_par::pixel_map, img_par::refresh_map, and img_par::width.
Referenced by encode_one_frame().