#include "mbuffer.h"


Go to the source code of this file.
Defines | |
| #define | EARLY_TERMINATION |
| #define | SEARCH_ONE_PIXEL |
| #define | SEARCH_ONE_PIXEL_BIPRED |
Functions | |
| void | UMHEX_DefineThreshold (void) |
| void | UMHEX_DefineThresholdMB (void) |
| int | UMHEX_get_mem (void) |
| void | UMHEX_free_mem (void) |
| void | UMHEX_decide_intrabk_SAD (void) |
| void | UMHEX_skip_intrabk_SAD (int best_mode, int ref_max) |
| void | UMHEX_setup (short ref, int list, int block_y, int block_x, int blocktype, short ******all_mv) |
| int | UMHEXIntegerPelBlockMotionSearch (Macroblock *currMB, imgpel *orig_pic, short ref, int list, char ***refPic, short ****tmp_mv, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred, MotionVector *mv, int search_range, int min_mcost, int lambda_factor, int apply_weights) |
| int | UMHEXSubPelBlockMotionSearch (imgpel *orig_pic, short ref, int list, int list_offset, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred, MotionVector *mv, int search_pos2, int search_pos4, int min_mcost, int lambda_factor, int apply_weights) |
| int | UMHEXSubPelBlockME (imgpel *orig_pic, short ref, int list, int list_offset, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred, MotionVector *mv, int search_pos2, int search_pos4, int min_mcost, int *lambda, int apply_weights) |
| int | SubPelBlockMotionSearch (imgpel *orig_pic, short ref, int list, int list_offset, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred, MotionVector *mv, int search_pos2, int search_pos4, int min_mcost, int *lambda_factor, int apply_weights) |
| int | UMHEXBipredIntegerPelBlockMotionSearch (Macroblock *currMB, imgpel *orig_pic, short ref, int list, char ***refPic, short ****tmp_mv, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred1, MotionVector *pred2, MotionVector *mv1, MotionVector *mv2, int search_range, int min_mcost, int iteration_no, int lambda_factor, int apply_weights) |
| void | UMHEXSetMotionVectorPredictor (Macroblock *currMB, short pmv[2], char **refPic, short ***tmp_mv, short ref_frame, int list, int mb_x, int mb_y, int bl_x, int bl_y, int *search_range) |
Variables | |
| byte ** | McostState |
| byte ** | SearchState |
| int **** | fastme_ref_cost |
| int *** | fastme_l0_cost |
| int *** | fastme_l1_cost |
| int *** | fastme_l0_cost_bipred |
| int *** | fastme_l1_cost_bipred |
| int | bipred_flag |
| int ** | fastme_best_cost |
| int | pred_SAD |
| int | pred_MV_ref [2] |
| int | pred_MV_uplayer [2] |
| int | UMHEX_blocktype |
| int | predict_point [5][2] |
| int | SAD_a |
| int | SAD_b |
| int | SAD_c |
| int | SAD_d |
| int | Threshold_DSR_MB [8] |
| float | Bsize [8] |
| float | AlphaFourth_1 [8] |
| float | AlphaFourth_2 [8] |
| byte * | flag_intra |
| int | flag_intra_SAD |
Definition in file me_umhex.h.
| #define EARLY_TERMINATION |
| #define SEARCH_ONE_PIXEL |
Value:
if(iabs(cand_x - center_x) <=search_range && iabs(cand_y - center_y)<= search_range)\ { \ if(!McostState[cand_y-center_y+search_range][cand_x-center_x+search_range]) \ { \ mcost = MV_COST (lambda_factor, mvshift, cand_x, cand_y, pred_x, pred_y); \ if(mcost<min_mcost) \ { \ mcost += computeUniPred[dist_method](orig_pic, \ blocksize_y,blocksize_x, min_mcost - mcost, \ (cand_x << 2) + IMG_PAD_SIZE_TIMES4, (cand_y << 2) + IMG_PAD_SIZE_TIMES4); \ McostState[cand_y-center_y+search_range][cand_x-center_x+search_range] = 1; \ if (mcost < min_mcost) \ { \ best_x = cand_x; \ best_y = cand_y; \ min_mcost = mcost; \ } \ } \ } \ }
Definition at line 34 of file me_umhex.h.
| #define SEARCH_ONE_PIXEL_BIPRED |
Value:
if(iabs(cand_x - center2_x) <=search_range && iabs(cand_y - center2_y)<= search_range)\ { \ if(!McostState[cand_y-center2_y+search_range][cand_x-center2_x+search_range]) \ { \ mcost = MV_COST (lambda_factor, mvshift, center1_x, center1_y, pred_x1, pred_y1);\ mcost += MV_COST (lambda_factor, mvshift, cand_x, cand_y, pred_x2, pred_y2); \ if(mcost<min_mcost) \ { \ mcost += computeBiPred(cur_pic, blocksize_y, blocksize_x, \ min_mcost - mcost, \ (center1_x << 2) + IMG_PAD_SIZE_TIMES4, \ (center1_y << 2) + IMG_PAD_SIZE_TIMES4, \ (cand_x << 2) + IMG_PAD_SIZE_TIMES4, \ (cand_y << 2) + IMG_PAD_SIZE_TIMES4); \ McostState[cand_y-center2_y+search_range][cand_x-center2_x+search_range] = 1; \ if (mcost < min_mcost) \ { \ best_x = cand_x; \ best_y = cand_y; \ min_mcost = mcost; \ } \ } \ } \ }
Definition at line 56 of file me_umhex.h.
| int SubPelBlockMotionSearch | ( | imgpel * | orig_pic, | |
| short | ref, | |||
| int | list, | |||
| int | list_offset, | |||
| int | pic_pix_x, | |||
| int | pic_pix_y, | |||
| int | blocktype, | |||
| MotionVector * | pred, | |||
| MotionVector * | mv, | |||
| int | search_pos2, | |||
| int | search_pos4, | |||
| int | min_mcost, | |||
| int * | lambda_factor, | |||
| int | apply_weights | |||
| ) |
Sub pixel block motion search.
Definition at line 248 of file me_fullsearch.c.
References InputParameters::blc_size, H_PEL, IMG_PAD_SIZE, storable_picture::imgUV_sub, storable_picture::p_curr_img_sub, Q_PEL, InputParameters::rdopt, storable_picture::size_x_cr_pad, storable_picture::size_x_pad, storable_picture::size_y_cr_pad, storable_picture::size_y_pad, and ImageParameters::type.
| void UMHEX_decide_intrabk_SAD | ( | void | ) |
Functions for SAD prediction of intra block cases. 1. void UMHEX_decide_intrabk_SAD() judges the block coding type(intra/inter) of neibouring blocks 2. void UMHEX_skip_intrabk_SAD() set the SAD to zero if neigouring block coding type is intra.
Definition at line 748 of file me_umhex.c.
References ImageParameters::pix_x, ImageParameters::pix_y, and ImageParameters::type.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
| void UMHEX_DefineThresholdMB | ( | void | ) |
Set MB thresholds for fast motion estimation Those thresholds may be adjusted to trade off rate-distortion performance and UMHEX speed.
Definition at line 110 of file me_umhex.c.
References f, InputParameters::qp, Threshold_DSR_MB, InputParameters::UMHexScale, and ImageParameters::width.
| void UMHEX_free_mem | ( | void | ) |
Free space for fast motion estimation.
Definition at line 182 of file me_umhex.c.
References InputParameters::BiPredMotionEstimation, fastme_best_cost, fastme_l0_cost, fastme_l0_cost_bipred, fastme_l1_cost, fastme_l1_cost_bipred, fastme_ref_cost, free_mem2D(), free_mem2Dint(), free_mem3Dint(), free_mem4Dint(), McostState, and SearchState.
Referenced by free_global_buffers().

| int UMHEX_get_mem | ( | void | ) |
Allocation of space for fast motion estimation.
Definition at line 156 of file me_umhex.c.
References InputParameters::BiPredMotionEstimation, fastme_best_cost, fastme_l0_cost, fastme_l0_cost_bipred, fastme_l1_cost, fastme_l1_cost_bipred, fastme_ref_cost, get_mem2D(), get_mem2Dint(), get_mem3Dint(), get_mem4Dint(), ImageParameters::height, ImageParameters::max_num_references, McostState, no_mem_exit(), InputParameters::search_range, SearchState, and ImageParameters::width.
Referenced by init_global_buffers().

| int UMHEXBipredIntegerPelBlockMotionSearch | ( | Macroblock * | currMB, | |
| imgpel * | cur_pic, | |||
| short | ref, | |||
| int | list, | |||
| char *** | refPic, | |||
| short **** | tmp_mv, | |||
| int | pic_pix_x, | |||
| int | pic_pix_y, | |||
| int | blocktype, | |||
| MotionVector * | pred_mv1, | |||
| MotionVector * | pred_mv2, | |||
| MotionVector * | mv1, | |||
| MotionVector * | mv2, | |||
| int | search_range, | |||
| int | min_mcost, | |||
| int | iteration_no, | |||
| int | lambda_factor, | |||
| int | apply_weights | |||
| ) |
UMHEXBipredIntegerPelBlockMotionSearch: fast pixel block motion search for bipred mode this algrithm is called UMHexagonS(see JVT-D016),which includes four steps with different kinds of search patterns.
Definition at line 919 of file me_umhex.c.
References ImageParameters::bipred_mv, InputParameters::blc_size, computeBiPredSAD1(), computeBiPredSAD2(), fastme_l0_cost_bipred, fastme_l1_cost_bipred, ImageParameters::field_picture, IMG_PAD_SIZE_TIMES4, storable_picture::imgUV_sub, macroblock::list_offset, McostState, InputParameters::NumberBFrames, ImageParameters::opix_x, ImageParameters::opix_y, storable_picture::p_curr_img_sub, ImageParameters::pix_x, ImageParameters::pix_y, pred_SAD, InputParameters::search_range, storable_picture::size_x, storable_picture::size_x_cr_pad, storable_picture::size_x_pad, storable_picture::size_y, storable_picture::size_y_cr_pad, and storable_picture::size_y_pad.
Referenced by init_ME_engine().

| int UMHEXIntegerPelBlockMotionSearch | ( | Macroblock * | currMB, | |
| imgpel * | orig_pic, | |||
| short | ref, | |||
| int | list, | |||
| char *** | refPic, | |||
| short **** | tmp_mv, | |||
| int | pic_pix_x, | |||
| int | pic_pix_y, | |||
| int | blocktype, | |||
| MotionVector * | pred_mv, | |||
| MotionVector * | mv, | |||
| int | search_range, | |||
| int | min_mcost, | |||
| int | lambda_factor, | |||
| int | apply_weights | |||
| ) |
UMHEXIntegerPelBlockMotionSearch: fast pixel block motion search this algorithm is called UMHexagonS(see JVT-D016),which includes four steps with different kinds of search patterns.
< motion vector shift for getting sub-pel units
< vertical block size
< horizontal block size
< predicted position x (in sub-pel units)
< predicted position y (in sub-pel units)
< center position x (in pel units)
< center position y (in pel units)
Definition at line 229 of file me_umhex.c.
References ImageParameters::all_mv, InputParameters::blc_size, F_PEL, fastme_best_cost, fastme_l0_cost, fastme_l1_cost, fastme_ref_cost, IMG_PAD_SIZE_TIMES4, storable_picture::imgUV_sub, macroblock::list_offset, McostState, ImageParameters::opix_x, ImageParameters::opix_y, storable_picture::p_curr_img_sub, ImageParameters::pix_x, ImageParameters::pix_y, pred_MV_uplayer, pred_SAD, InputParameters::search_range, storable_picture::size_x, storable_picture::size_x_cr_pad, storable_picture::size_x_pad, storable_picture::size_y, storable_picture::size_y_cr_pad, storable_picture::size_y_pad, and ImageParameters::structure.
Referenced by init_ME_engine().
| void UMHEXSetMotionVectorPredictor | ( | Macroblock * | currMB, | |
| short | pmv[2], | |||
| char ** | refPic, | |||
| short *** | tmp_mv, | |||
| short | ref_frame, | |||
| int | list, | |||
| int | mb_x, | |||
| int | mb_y, | |||
| int | bl_x, | |||
| int | bl_y, | |||
| int * | search_range | |||
| ) |
Set motion vector predictor.
Definition at line 1278 of file me_umhex.c.
References pix_pos::available, bipred_flag, InputParameters::BiPredMotionEstimation, ImageParameters::current_mb_nr, dsr_new_search_range, fastme_l0_cost, fastme_l0_cost_bipred, fastme_l1_cost, fastme_l1_cost_bipred, InputParameters::full_search, get4x4Neighbour(), pix_pos::mb_addr, ImageParameters::mb_data, macroblock::mb_field, ImageParameters::mb_size, ImageParameters::MbaffFrameFlag, pix_pos::pos_x, pix_pos::pos_y, InputParameters::search_range, Threshold_DSR_MB, UMHEX_blocktype, and InputParameters::UMHexDSR.
Referenced by BiPredBlockMotionSearch(), and BlockMotionSearch().

| int bipred_flag |
flag for bipred
Definition at line 90 of file me_umhex.h.
Referenced by BiPredBlockMotionSearch(), BlockMotionSearch(), and UMHEXSetMotionVectorPredictor().
| int** fastme_best_cost |
for multi ref early termination threshold
Definition at line 91 of file me_umhex.h.
Referenced by UMHEX_free_mem(), UMHEX_get_mem(), and UMHEXIntegerPelBlockMotionSearch().
| int*** fastme_l0_cost |
store SAD information needed for forward median and uplayer prediction
Definition at line 86 of file me_umhex.h.
Referenced by UMHEX_free_mem(), UMHEX_get_mem(), UMHEXIntegerPelBlockMotionSearch(), and UMHEXSetMotionVectorPredictor().
| int*** fastme_l0_cost_bipred |
store SAD information for bipred mode
Definition at line 88 of file me_umhex.h.
Referenced by UMHEX_free_mem(), UMHEX_get_mem(), UMHEXBipredIntegerPelBlockMotionSearch(), and UMHEXSetMotionVectorPredictor().
| int*** fastme_l1_cost |
store SAD information needed for backward median and uplayer prediction
Definition at line 87 of file me_umhex.h.
Referenced by UMHEX_free_mem(), UMHEX_get_mem(), UMHEXIntegerPelBlockMotionSearch(), and UMHEXSetMotionVectorPredictor().
| int*** fastme_l1_cost_bipred |
store SAD information for bipred mode
Definition at line 89 of file me_umhex.h.
Referenced by UMHEX_free_mem(), UMHEX_get_mem(), UMHEXBipredIntegerPelBlockMotionSearch(), and UMHEXSetMotionVectorPredictor().
| int**** fastme_ref_cost |
store SAD information needed for forward ref-frame prediction
Definition at line 85 of file me_umhex.h.
Referenced by UMHEX_free_mem(), UMHEX_get_mem(), and UMHEXIntegerPelBlockMotionSearch().
state for integer pel search
Definition at line 82 of file me_umhex.h.
Referenced by UMHEX_free_mem(), UMHEX_get_mem(), UMHEXBipredIntegerPelBlockMotionSearch(), and UMHEXIntegerPelBlockMotionSearch().
| int pred_MV_uplayer[2] |
pred motion vector by space or temporal correlation,Median is provided
Definition at line 93 of file me_umhex.h.
Referenced by UMHEXIntegerPelBlockMotionSearch().
| int pred_SAD |
SAD prediction in use.
Definition at line 92 of file me_umhex.h.
Referenced by UMHEXBipredIntegerPelBlockMotionSearch(), and UMHEXIntegerPelBlockMotionSearch().
state for fractional pel search
Definition at line 83 of file me_umhex.h.
Referenced by UMHEX_free_mem(), and UMHEX_get_mem().
| int Threshold_DSR_MB[8] |
Threshold for usage of DSR. DSR refer to JVT-Q088.
Definition at line 98 of file me_umhex.h.
Referenced by UMHEX_DefineThresholdMB(), and UMHEXSetMotionVectorPredictor().
| int UMHEX_blocktype |
blocktype for UMHEX SetMotionVectorPredictor
Definition at line 95 of file me_umhex.h.
Referenced by BlockMotionSearch(), and UMHEXSetMotionVectorPredictor().