Go to the source code of this file.
Functions | |
void | get_neighbors (Macroblock *currMB, PixelPos *block, int mb_x, int mb_y, int blockshape_x) |
void | set_access_method (int *access_method, MotionVector *blk, int min_x, int min_y, int max_x, int max_y) |
void | PrepareMEParams (Slice *currSlice, MEBlock *mv_block, int ChromaMEEnable, int list, int ref) |
void | PrepareBiPredMEParams (Slice *currSlice, MEBlock *mv_block, int ChromaMEEnable, int list, int list_offset, int ref) |
void | Init_Motion_Search_Module (ImageParameters *p_Img, InputParameters *p_Inp) |
void | Clear_Motion_Search_Module (ImageParameters *p_Img, InputParameters *p_Inp) |
void | PartitionMotionSearch (Macroblock *currMB, int, int, int *) |
void | SubPartitionMotionSearch (Macroblock *currMB, int, int, int *) |
void | Get_Direct_MV_Spatial_MBAFF (Macroblock *currMB) |
void | Get_Direct_MV_Spatial_Normal (Macroblock *currMB) |
void | Get_Direct_MV_Temporal (Macroblock *currMB) |
void | FindSkipModeMotionVector (Macroblock *currMB) |
void | init_ME_engine (Macroblock *currMB) |
int | BlockMotionSearch (Macroblock *currMB, MEBlock *mv_block, int, int, int *) |
void | init_mv_block (Macroblock *currMB, MEBlock *mv_block, short blocktype, int list, char ref_idx, short mb_x, short mb_y) |
void | get_original_block (ImageParameters *p_Img, InputParameters *p_Inp, MEBlock *mv_block) |
void | free_mv_block (InputParameters *p_Inp, MEBlock *mv_block) |
void | update_mv_block (Macroblock *currMB, MEBlock *mv_block, int h, int v) |
void | get_search_range (MEBlock *mv_block, InputParameters *p_Inp, short ref, int blocktype) |
static void | add_mvs (MotionVector *mv0, const MotionVector *mv1) |
static MotionVector | add_MVs (MotionVector mv0, const MotionVector *mv1) |
static MotionVector | pad_MVs (MotionVector mv0, MEBlock *mv_block) |
static int | weight_cost (int lambda, int bits) |
static int | mv_cost (const ImageParameters *p_Img, int lambda, const MotionVector *mv, const MotionVector *pmv) |
static int | ref_cost (const ImageParameters *p_Img, int lambda, short ref, int list_offset) |
Definition in file mv_search.h.
int BlockMotionSearch | ( | Macroblock * | currMB, | |
MEBlock * | mv_block, | |||
int | mb_x, | |||
int | mb_y, | |||
int * | lambda_factor | |||
) |
Block motion search.
< minimum motion cost after search
currMB | Current Macroblock | |
mv_block | Motion estimation information block | |
mb_x | x-coordinate inside macroblock | |
mb_y | y-coordinate inside macroblock | |
lambda_factor | lagrangian parameter for determining motion cost |
Definition at line 835 of file mv_search.c.
References slice::all_mv, BiPredBlockMotionSearch(), clip_mv_range(), inp_par_enc::DisableSubpelME, F_PEL, FindSkipModeMotionVector(), get_neighbors(), GetSkipCostMB(), is_bipred_enabled(), storable_picture::motion, pic_motion_params::mv, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, PrepareMEParams(), Q_PEL, pic_motion_params::ref_idx, slice::slice_type, smpUMHEX_setup(), img_par::start_me_refinement_hp, and UMHEXSetMotionVectorPredictor().
Referenced by PartitionMotionSearch(), and SubPartitionMotionSearch().
void Clear_Motion_Search_Module | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp | |||
) |
Free memory used by motion search.
Definition at line 503 of file mv_search.c.
References ClearFastFullIntegerSearch(), free_mem4Dint(), inp_par_enc::IntraProfile, and inp_par_enc::search_range.
Referenced by free_encoder_memory().
void FindSkipModeMotionVector | ( | Macroblock * | currMB | ) |
Find motion vector for the Skip mode.
Definition at line 1307 of file mv_search.c.
References slice::all_mv, get_neighbors(), img_par::mb_data, storable_picture::motion, pic_motion_params::mv, macroblock::p_Img, macroblock::p_slice, and pic_motion_params::ref_idx.
Referenced by BlockMotionSearch(), encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
void free_mv_block | ( | InputParameters * | p_Inp, | |
MEBlock * | mv_block | |||
) |
free motion vector block
Definition at line 777 of file mv_search.c.
References free_mem1Dpel().
Referenced by PartitionMotionSearch(), and SubPartitionMotionSearch().
void Get_Direct_MV_Spatial_MBAFF | ( | Macroblock * | currMB | ) |
Calculate Spatial Direct Mode Motion Vectors.
Definition at line 2072 of file mv_search.c.
References slice::all_mv, macroblock::block_x, macroblock::block_y, slice::direct_pdir, slice::direct_ref_idx, get_neighbors(), img_par::mb_data, macroblock::mbAddrX, storable_picture::motion, pic_motion_params::mv, macroblock::opix_y, out_of_bounds_mvs(), macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, pic_motion_params::ref_idx, slice::wbp_weight, and YUV400.
Referenced by init_slice().
void Get_Direct_MV_Spatial_Normal | ( | Macroblock * | currMB | ) |
Calculate Spatial Direct Mode Motion Vectors.
Definition at line 1917 of file mv_search.c.
References slice::all_mv, macroblock::block_x, macroblock::block_y, slice::direct_pdir, slice::direct_ref_idx, get_neighbors(), macroblock::mbAddrX, storable_picture::motion, pic_motion_params::mv, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, pic_motion_params::ref_idx, slice::wbp_weight, and YUV400.
Referenced by init_slice().
void Get_Direct_MV_Temporal | ( | Macroblock * | currMB | ) |
Calculate Temporal Direct Mode Motion Vectors.
invalid index. Default to zero even though this case should not happen
Definition at line 1775 of file mv_search.c.
References slice::all_mv, macroblock::block_x, macroblock::block_y, slice::direct_pdir, slice::direct_ref_idx, macroblock::mbAddrX, motion_params::mv, macroblock::opix_y, out_of_bounds_mvs(), macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, motion_params::ref_idx, motion_params::ref_pic_id, slice::wbp_weight, and YUV400.
Referenced by init_slice().
void get_neighbors | ( | Macroblock * | currMB, | |
PixelPos * | block, | |||
int | mb_x, | |||
int | mb_y, | |||
int | blockshape_x | |||
) |
Get current block spatial neighbors.
Definition at line 280 of file mv_search.c.
References get4x4Neighbour(), and macroblock::p_Img.
Referenced by BlockMotionSearch(), FindSkipModeMotionVector(), Get_Direct_MV_Spatial_MBAFF(), Get_Direct_MV_Spatial_Normal(), SetupFastFullPelSearch(), and writeMotionVector8x8().
void get_search_range | ( | MEBlock * | mv_block, | |
InputParameters * | p_Inp, | |||
short | ref, | |||
int | blocktype | |||
) |
Set search range. This needs to be changed to provide 2D support.
Definition at line 68 of file mv_search.c.
Referenced by PartitionMotionSearch(), and SubPartitionMotionSearch().
void init_ME_engine | ( | Macroblock * | currMB | ) |
Initialize ME engine.
Definition at line 140 of file mv_search.c.
References EPZSBiPredBlockMotionSearch(), EPZSIntBiPredBlockMotionSearch(), EPZSIntPelBlockMotionSearch(), EPZSPelBlockMotionSearch(), EPZSSubPelBlockMotionSearch(), EPZSSubPelBlockSearchBiPred(), FastFullPelBlockMotionSearch(), FullPelBlockMotionBiPred(), FullPelBlockMotionSearch(), smpUMHEXBipredIntegerPelBlockMotionSearch(), smpUMHEXIntegerPelBlockMotionSearch(), SubPelBlockMotionSearch(), SubPelBlockSearchBiPred(), UMHEXBipredIntegerPelBlockMotionSearch(), and UMHEXIntegerPelBlockMotionSearch().
Referenced by start_macroblock().
void Init_Motion_Search_Module | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp | |||
) |
Initialize the motion search.
Definition at line 327 of file mv_search.c.
References computeBiPredSAD1(), computeBiPredSAD2(), computeBiPredSATD1(), computeBiPredSATD2(), computeBiPredSSE1(), computeBiPredSSE2(), computeSAD(), computeSADWP(), computeSATD(), computeSATDWP(), computeSSE(), computeSSEWP(), F_PEL, get_mem4Dint(), H_PEL, InitializeFastFullIntegerSearch(), inp_par_enc::IntraProfile, img_par::max_num_references, img_par::max_pel_value_comp, no_mem_exit(), Q_PEL, inp_par_enc::search_range, img_par::start_me_refinement_hp, and img_par::start_me_refinement_qp.
Referenced by init_encoder().
void init_mv_block | ( | Macroblock * | currMB, | |
MEBlock * | mv_block, | |||
short | blocktype, | |||
int | list, | |||
char | ref_idx, | |||
short | mb_x, | |||
short | mb_y | |||
) |
Init motion vector block.
Definition at line 706 of file mv_search.c.
References F_PEL, get_mem1Dpel(), H_PEL, no_mem_exit(), macroblock::p_Img, macroblock::p_slice, Q_PEL, slice::slice_type, inp_par_enc::UseWeightedReferenceME, and slice::weighted_prediction.
Referenced by PartitionMotionSearch(), and SubPartitionMotionSearch().
void PartitionMotionSearch | ( | Macroblock * | currMB, | |
int | , | |||
int | , | |||
int * | ||||
) |
Motion search for a macroblock partition.
Definition at line 1502 of file mv_search.c.
References slice::all_mv, macroblock::block_x, macroblock::block_y, BlockMotionSearch(), EPZSIntPelBlockMotionSearch(), EPZSPelBlockMotionSearch(), free_mv_block(), get_search_range(), init_mv_block(), storable_picture::motion, pic_motion_params::mv, macroblock::p_Img, macroblock::p_slice, pic_motion_params::ref_idx, set_me_parameters(), and slice::slice_type.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
void PrepareBiPredMEParams | ( | Slice * | currSlice, | |
MEBlock * | mv_block, | |||
int | ChromaMEEnable, | |||
int | list, | |||
int | list_offset, | |||
int | ref | |||
) |
Prepare Motion Estimation parameters for bipred list ME.
Definition at line 218 of file mv_search.c.
References slice::wbp_weight, and slice::wp_offset.
Referenced by BiPredBlockMotionSearch().
void PrepareMEParams | ( | Slice * | currSlice, | |
MEBlock * | mv_block, | |||
int | ChromaMEEnable, | |||
int | list, | |||
int | ref | |||
) |
Prepare Motion Estimation parameters for single list ME.
Definition at line 195 of file mv_search.c.
References slice::wp_offset, and slice::wp_weight.
Referenced by BlockMotionSearch().
void set_access_method | ( | int * | access_method, | |
MotionVector * | blk, | |||
int | min_x, | |||
int | min_y, | |||
int | max_x, | |||
int | max_y | |||
) |
Set ME access method.
Definition at line 122 of file mv_search.c.
References FAST_ACCESS, and UMV_ACCESS.
void SubPartitionMotionSearch | ( | Macroblock * | currMB, | |
int | , | |||
int | , | |||
int * | ||||
) |
Motion search for a submacroblock partition.
Definition at line 1613 of file mv_search.c.
References slice::all_mv, macroblock::block_x, macroblock::block_y, BlockMotionSearch(), EPZSIntPelBlockMotionSearch(), EPZSIntPelBlockMotionSearchSubMB(), EPZSPelBlockMotionSearch(), EPZSPelBlockMotionSearchSubMB(), free_mv_block(), get_search_range(), init_mv_block(), storable_picture::motion, pic_motion_params::mv, macroblock::p_slice, pic_motion_params::ref_idx, set_me_parameters(), and slice::slice_type.
Referenced by submacroblock_mode_decision(), and submacroblock_mode_decision_low().