me_umhex.c File Reference

Fast integer pel motion estimation and fractional pel motion estimation algorithms are described in this file. 1. UMHEX_get_mem() and UMHEX_free_mem() are functions for allocation and release of memories about motion estimation 2. UMHEX_BlockMotionSearch() is the function for fast integer pel motion estimation and fractional pel motion estimation 3. UMHEX_DefineThreshold() defined thresholds for early termination. More...

#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 "macroblock.h"
#include "me_distortion.h"
#include "mv_search.h"
#include "me_fullsearch.h"

Include dependency graph for me_umhex.c:

Go to the source code of this file.

Defines

#define Q_BITS   15
#define MIN_IMG_WIDTH   176

Functions

void UMHEX_DefineThreshold (ImageParameters *p_Img)
void UMHEX_DefineThresholdMB (ImageParameters *p_Img, InputParameters *p_Inp)
int UMHEX_get_mem (ImageParameters *p_Img, InputParameters *p_Inp)
void UMHEX_free_mem (ImageParameters *p_Img, InputParameters *p_Inp)
int UMHEXIntegerPelBlockMotionSearch (Macroblock *currMB, MotionVector *pred_mv, MEBlock *mv_block, int min_mcost, int lambda_factor)
int UMHEXSubPelBlockMotionSearch (Macroblock *currMB, MotionVector *pred_mv, MEBlock *mv_block, int min_mcost, int lambda_factor)
int UMHEXSubPelBlockME (Macroblock *currMB, MotionVector *pred_mv, MEBlock *mv_block, int min_mcost, int *lambda)
void UMHEX_decide_intrabk_SAD (Macroblock *currMB)
void UMHEX_skip_intrabk_SAD (Macroblock *currMB, int ref_max)
void UMHEX_setup (Macroblock *currMB, short ref, int list, int block_y, int block_x, int blocktype, short ******all_mv)
int UMHEXBipredIntegerPelBlockMotionSearch (Macroblock *currMB, int list, MotionVector *pred_mv1, MotionVector *pred_mv2, MotionVector *mv1, MotionVector *mv2, MEBlock *mv_block, int search_range, int min_mcost, int lambda_factor)
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, MEBlock *mv_block)

Variables

static const MotionVector Diamond [4] = {{-4, 0}, {4, 0}, {0, -4}, {0, 4}}
static const MotionVector Hexagon [6] = {{-8, 0}, {8, 0},{-4, -8}, {4, 8}, {-4, 8}, {4 , -8}}
static const short Big_Hexagon_X [16] = {0,-8, -16,-16,-16, -16, -16, -8, 0, 8, 16, 16, 16, 16, 16, 8}
static const short Big_Hexagon_Y [16] = {8, 12, 8, 4, 0, -4, -8, -12, -16, -12, -8, -4, 0, 4, 8, 12}
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}


Detailed Description

Fast integer pel motion estimation and fractional pel motion estimation algorithms are described in this file. 1. UMHEX_get_mem() and UMHEX_free_mem() are functions for allocation and release of memories about motion estimation 2. UMHEX_BlockMotionSearch() is the function for fast integer pel motion estimation and fractional pel motion estimation 3. UMHEX_DefineThreshold() defined thresholds for early termination.

Author:
Main contributors: (see contributors.h for copyright, address and affiliation details)
Date:
2006.1

Definition in file me_umhex.c.


Function Documentation

void UMHEX_decide_intrabk_SAD ( Macroblock currMB  ) 

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.

Date:
2003.4

Definition at line 643 of file me_umhex.c.

References macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, and slice::slice_type.

Referenced by init_enc_mb_params().

void UMHEX_DefineThresholdMB ( ImageParameters p_Img,
InputParameters p_Inp 
)

Set MB thresholds for fast motion estimation Those thresholds may be adjusted to trade off rate-distortion performance and UMHEX speed.

Definition at line 93 of file me_umhex.c.

References inp_par_enc::qp, and img_par::width.

Referenced by init_enc_mb_params().

void UMHEX_free_mem ( ImageParameters p_Img,
InputParameters p_Inp 
)

Free space for fast motion estimation.

Definition at line 169 of file me_umhex.c.

References inp_par_enc::BiPredMotionEstimation, free_mem2D(), free_mem2Dint(), free_mem3Dint(), and free_mem4Dint().

Referenced by free_global_buffers().

Here is the call graph for this function:

int UMHEX_get_mem ( ImageParameters p_Img,
InputParameters p_Inp 
)

Allocation of space for fast motion estimation.

Definition at line 140 of file me_umhex.c.

References inp_par_enc::BiPredMotionEstimation, get_mem2D(), get_mem2Dint(), get_mem3Dint(), get_mem4Dint(), img_par::height, img_par::max_num_references, no_mem_exit(), inp_par_enc::search_range, and img_par::width.

Referenced by init_global_buffers().

Here is the call graph for this function:

int UMHEXBipredIntegerPelBlockMotionSearch ( Macroblock currMB,
int  list,
MotionVector pred_mv1,
MotionVector pred_mv2,
MotionVector mv1,
MotionVector mv2,
MEBlock *  mv_block,
int  search_range,
int  min_mcost,
int  lambda_factor 
)

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.

Author:
Main contributors: (see contributors.h for copyright, address and affiliation details)
Date:
: 2006.1

Definition at line 826 of file me_umhex.c.

References slice::bipred_mv, macroblock::block_x, macroblock::block_y, inp_par_enc::NumberBFrames, macroblock::p_Img, macroblock::p_slice, and inp_par_enc::search_range.

Referenced by init_ME_engine().

int UMHEXIntegerPelBlockMotionSearch ( Macroblock currMB,
MotionVector pred_mv,
MEBlock *  mv_block,
int  min_mcost,
int  lambda_factor 
)

UMHEXIntegerPelBlockMotionSearch: fast pixel block motion search this algorithm is called UMHexagonS(see JVT-D016),which includes four steps with different kinds of search patterns.

Input:
imgpel* orig_pic, // <-- original picture int ref, // <-- reference frame (0... or -1 (backward)) int pic_pix_x, // <-- absolute x-coordinate of regarded AxB block int pic_pix_y, // <-- absolute y-coordinate of regarded AxB block int blocktype, // <-- block type (1-16x16 ... 7-4x4) int pred_mv[2], // <-- motion vector predictor (x|y) in sub-pel units MotionVector *mv, // --> motion vector (x|y) - in pel units int search_range, // <-- 1-d search range in pel units int min_mcost, // <-- minimum motion cost (cost for center or huge value) int lambda_factor // <-- lagrangian parameter for determining motion cost
Two macro definitions defined in this program: 1. EARLY_TERMINATION: early termination algrithm, refer to JVT-D016.doc 2. SEARCH_ONE_PIXEL: search one pixel in search range
Author:
Main contributors: (see contributors.h for copyright, address and affiliation details)
Date:
: 2006.1

Definition at line 218 of file me_umhex.c.

References slice::all_mv, macroblock::block_x, macroblock::block_y, macroblock::p_Img, macroblock::p_slice, and inp_par_enc::search_range.

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,
MEBlock *  mv_block 
)

Set motion vector predictor.

Definition at line 1112 of file me_umhex.c.

References inp_par_enc::BiPredMotionEstimation, get4x4Neighbour(), img_par::mb_data, macroblock::mbAddrX, img_par::MbaffFrameFlag, macroblock::p_Img, and inp_par_enc::search_range.

Referenced by BiPredBlockMotionSearch(), and BlockMotionSearch().

Here is the call graph for this function:


Documentation generated with DoxyGen