me_umhex.h File Reference

Macro definitions and global variables for UMHEX fast integer pel motion estimation and fractional pel motion estimation. More...

#include "mbuffer.h"

Include dependency graph for me_umhex.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  umhex_struct

Defines

#define EARLY_TERMINATION
#define SEARCH_ONE_PIXEL
#define SEARCH_ONE_PIXEL_BIPRED

Typedefs

typedef struct umhex_struct UMHexStruct

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)
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 UMHEXIntegerPelBlockMotionSearch (Macroblock *currMB, MotionVector *pred, 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, MEBlock *mv_block, int min_mcost, int *lambda)
int UMHEXBipredIntegerPelBlockMotionSearch (Macroblock *, int, MotionVector *, MotionVector *, MotionVector *, MotionVector *, MEBlock *, int, int, int)
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, MEBlock *mv_block)


Detailed Description

Macro definitions and global variables for UMHEX fast integer pel motion estimation and fractional pel motion estimation.

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

Definition in file me_umhex.h.


Define Documentation

#define EARLY_TERMINATION

Value:

if ((min_mcost - p_UMHex->pred_SAD)<p_UMHex->pred_SAD * betaFourth_2)                                     \
  goto fourth_2_step;                                                                 \
  else if((min_mcost - p_UMHex->pred_SAD) < p_UMHex->pred_SAD * betaFourth_1)                                 \
  goto fourth_1_step;

Definition at line 64 of file me_umhex.h.

#define SEARCH_ONE_PIXEL

Value:

if((iabs(cand.mv_x - center.mv_x)>>2) < search_range && (iabs(cand.mv_y - center.mv_y)>>2)< search_range)\
  {                                                                                   \
    if(!p_UMHex->McostState[((cand.mv_y - center.mv_y) >> 2)+ search_range][((cand.mv_x-center.mv_x)>>2)+search_range])       \
    {                                                                                 \
      mcost = mv_cost (p_Img, lambda_factor, &cand, &pred);                           \
      if(mcost<min_mcost)                                                             \
      {                                                                               \
        mcost += mv_block->computePredFPel(ref_picture, mv_block,                     \
        min_mcost - mcost, &cand);                                     \
        p_UMHex->McostState[((cand.mv_y - center.mv_y) >> 2) + search_range][((cand.mv_x - center.mv_x) >> 2) + search_range] = 1;   \
        if (mcost < min_mcost)                                                        \
        {                                                                             \
          best = cand;                                                                \
          min_mcost = mcost;                                                          \
        }                                                                             \
      }                                                                               \
    }                                                                                 \
   }

Definition at line 70 of file me_umhex.h.

#define SEARCH_ONE_PIXEL_BIPRED

Value:

if((iabs(cand.mv_x - center2.mv_x) >> 2) < search_range && (iabs(cand.mv_y - center2.mv_y) >> 2) < search_range)     \
{                                                                                                       \
  if(!p_UMHex->McostState[((cand.mv_y - center2.mv_y) >> 2) + search_range][((cand.mv_x-center2.mv_x) >> 2)+search_range])         \
  {                                                                                                     \
    mcost  = mv_cost (p_Img, lambda_factor, &center1, &pred1);                                          \
    mcost += mv_cost (p_Img, lambda_factor, &cand, &pred2);                                             \
    if(mcost<min_mcost)                                                                                   \
    {                                                                                                     \
      mcost  += mv_block->computeBiPredFPel(ref_picture1, ref_picture2,                                 \
      mv_block, min_mcost - mcost, &center1, &cand);                                                \
      p_UMHex->McostState[((cand.mv_y - center2.mv_y) >> 2) + search_range][((cand.mv_x - center2.mv_x) >> 2) + search_range] = 1; \
      if (mcost < min_mcost)                                                                            \
      {                                                                                                 \
        best = cand;                                                                                    \
        min_mcost = mcost;                                                                              \
      }                                                                                                 \
    }                                                                                                   \
  }                                                                                                     \
}                                                                                                       \

Definition at line 90 of file me_umhex.h.


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  bl_x,
int  bl_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