#include <limits.h>
#include "global.h"
#include "memalloc.h"
#include "me_umhex.h"
#include "refbuf.h"
#include "mb_access.h"
#include "image.h"
#include "enc_statistics.h"
#include "me_distortion.h"
#include "mv-search.h"

Go to the source code of this file.
Defines | |
| #define | Q_BITS 15 |
| #define | MIN_IMG_WIDTH 176 |
Functions | |
| void | UMHEX_DefineThreshold () |
| void | UMHEX_DefineThresholdMB () |
| int | UMHEX_get_mem () |
| void | UMHEX_free_mem () |
| 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) |
| int | UMHEXSubPelBlockMotionSearch (imgpel *orig_pic, short ref, int list, int list_offset, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred_mv, 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_mv, MotionVector *mv, int search_pos2, int search_pos4, int min_mcost, int *lambda, int apply_weights) |
| void | UMHEX_decide_intrabk_SAD () |
| 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 | 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) |
| void | UMHEXSetMotionVectorPredictor (Macroblock *currMB, short pmv[2], char **refPic, short ***tmp_mv, short ref_frame, int list, int mb_x, int mb_y, int blockshape_x, int blockshape_y, int *search_range) |
Variables | |
| int * | byte_abs |
| short * | spiral_search_x |
| short * | spiral_search_y |
| static const int | Diamond_x [4] = {-1, 0, 1, 0} |
| static const int | Diamond_y [4] = {0, 1, 0, -1} |
| static const int | Hexagon_x [6] = {2, 1, -1, -2, -1, 1} |
| static const int | Hexagon_y [6] = {0, -2, -2, 0, 2, 2} |
| static const int | Big_Hexagon_x [16] = {0,-2, -4,-4,-4, -4, -4, -2, 0, 2, 4, 4, 4, 4, 4, 2} |
| static const int | Big_Hexagon_y [16] = {4, 3, 2, 1, 0, -1, -2, -3, -4, -3, -2, -1, 0, 1, 2, 3} |
| static int | pred_MV_ref_flag |
| static int | dist_method |
| static StorablePicture * | ref_pic_ptr |
| static const int | Multi_Ref_Thd [8] = {0, 300, 120, 120, 60, 30, 30, 15} |
| static const int | Big_Hexagon_Thd [8] = {0, 3000, 1500, 1500, 800, 400, 400, 200} |
| static const int | Median_Pred_Thd [8] = {0, 750, 350, 350, 170, 80, 80, 40} |
| static const int | Threshold_DSR [8] = {0, 2200, 1000, 1000, 500, 250, 250, 120} |
| static int | BlockType_LUT [4][4] |
| static int | Median_Pred_Thd_MB [8] |
| static int | Big_Hexagon_Thd_MB [8] |
| static int | Multi_Ref_Thd_MB [8] |
| const int | quant_coef [6][4][4] |
Definition in file me_umhex.c.
| 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 | blockshape_x, | |||
| int | blockshape_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().
