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.

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


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-pred_SAD)<pred_SAD*betaFourth_2)                                     \
  goto fourth_2_step;                                                                 \
  else if((min_mcost-pred_SAD)<pred_SAD*betaFourth_1)                                 \
  goto fourth_1_step;

Definition at line 28 of file me_umhex.h.

#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.


Function Documentation

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 
)

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.

Date:
2003.4

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().

Here is the call graph for this function:

int UMHEX_get_mem ( void   ) 

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.

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

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().

Here is the call graph for this function:

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.

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

< 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 
)


Variable Documentation

flag for bipred

Definition at line 90 of file me_umhex.h.

Referenced by BiPredBlockMotionSearch(), BlockMotionSearch(), and UMHEXSetMotionVectorPredictor().

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().

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().

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().

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().

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().

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().

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().

blocktype for UMHEX SetMotionVectorPredictor

Definition at line 95 of file me_umhex.h.

Referenced by BlockMotionSearch(), and UMHEXSetMotionVectorPredictor().


Documentation generated with DoxyGen