me_epzs.h File Reference

Headerfile for EPZS motion estimation. More...

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

Go to the source code of this file.

Data Structures

struct  EPZSColocParams
struct  SPoint
struct  MEPatternNode

Defines

#define CHECK_RANGE   ((cand.mv_x >= 0) && (cand.mv_x < img_width - blocksize_x) &&(cand.mv_y >= 0) && (cand.mv_y < img_height - blocksize_y))

Typedefs

typedef struct MEPatternNode EPZSStructure

Enumerations

enum  EPZSPatterns {
  SDIAMOND = 0, SQUARE = 1, EDIAMOND = 2, LDIAMOND = 3,
  SBDIAMOND = 4
}

Functions

int EPZSInit (InputParameters *params, ImageParameters *img)
void EPZSDelete (InputParameters *params)
void EPZSOutputStats (InputParameters *params, FILE *stat, short stats_file)
void EPZSSliceInit (InputParameters *params, ImageParameters *img, EPZSColocParams *p, StorablePicture **listX[6])
int EPZSPelBlockMotionSearch (Macroblock *, imgpel *, short, int, char ***, short ****, int, int, int, MotionVector *, MotionVector *, int, int, int, int)
int EPZSBiPredBlockMotionSearch (Macroblock *, imgpel *, short, int, char ***, short ****, int, int, int, MotionVector *, MotionVector *, MotionVector *, MotionVector *, int, int, int, int, int)
int EPZSSubPelBlockMotionSearch (imgpel *, short, int, int, int, int, int, MotionVector *, MotionVector *, int, int, int, int *, int)
int EPZSSubPelBlockSearchBiPred (imgpel *orig_pic, short ref, int list, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred_mv1, MotionVector *pred_mv2, MotionVector *mv1, MotionVector *mv2, int search_pos2, int search_pos4, int min_mcost, int *lambda_factor, int apply_weights)

Variables

EPZSColocParams * EPZSCo_located
int *** EPZSDistortion


Detailed Description

Headerfile for EPZS motion estimation.

me_epzs.h

Author:
Alexis Michael Tourapis <alexis.tourapis@dolby.com>
Date:
11. August 2006

Definition in file me_epzs.h.


Function Documentation

int EPZSBiPredBlockMotionSearch ( Macroblock *  ,
imgpel *  ,
short  ,
int  ,
char ***  ,
short ****  ,
int  ,
int  ,
int  ,
MotionVector *  ,
MotionVector *  ,
MotionVector *  ,
MotionVector *  ,
int  ,
int  ,
int  ,
int  ,
int   
)

FAST Motion Estimation using EPZS AMT/HYC.

If medthres satisfied, then terminate, otherwise generate Predictors

Add Spatial Predictors in predictor list. Scheme adds zero, left, top-left, top, top-right. Note that top-left adds very little in terms of performance and could be removed with little penalty if any.

Check all predictors

Refine using EPZS pattern if needed Note that we are using a conservative threshold method. Threshold could be tested after checking only a certain number of predictors instead of the full set. Code could be easily modified for this task.

Adapt pattern based on different conditions.

center on best predictor

Check Second best predictor with EPZS pattern

Second best. Note that following code is identical as for best predictor.

Definition at line 1995 of file me_epzs.c.

References InputParameters::blc_size, EPZSBiDistortion, EPZSDetermineStopCriterion(), InputParameters::EPZSDual, InputParameters::EPZSGrid, EPZSMap, InputParameters::EPZSPattern, EPZSSpatialPredictors(), F_PEL, get_neighbors(), IMG_PAD_SIZE_TIMES4, storable_picture::imgUV_sub, macroblock::list_offset, ImageParameters::mb_x, ImageParameters::mb_y, ImageParameters::opix_x, ImageParameters::opix_y, storable_picture::p_curr_img_sub, 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:

void EPZSDelete ( InputParameters *  params  ) 

int EPZSInit ( InputParameters *  params,
ImageParameters *  img 
)

EPZS Global Initialization.

In this implementation we keep threshold limits fixed. However one could adapt these limits based on lagrangian optimization considerations (i.e. qp), while also allow adaptation of the limits themselves based on content or complexity.

Definition of pottential EPZS patterns. It is possible to also define other patterns, or even use resizing patterns (such as the PMVFAST scheme. These patterns are only shown here as reference, while the same also holds for this implementation (i.e. new conditions could be added on adapting predictors, or thresholds etc. Note that search could also be performed on subpel positions directly while pattern needs not be restricted on integer positions only.

Allocate memory and assign search patterns

Allocate and assign window based predictors. Other window types could also be used, while method could be made a bit more adaptive (i.e. patterns could be assigned based on neighborhood

Also assing search predictor memory

Finally assign memory for all other elements (distortion, EPZSMap, and temporal predictors)

Definition at line 368 of file me_epzs.c.

References allocEPZScolocated(), allocEPZSpattern(), InputParameters::BiPredMESearchRange, InputParameters::BiPredMotionEstimation, ImageParameters::bitdepth_chroma, ImageParameters::bitdepth_luma, InputParameters::ChromaMEEnable, InputParameters::ChromaMEWeight, EPZS_Motion, EPZSBiDistortion, EPZSDistortion, InputParameters::EPZSDual, InputParameters::EPZSGrid, EPZSMap, InputParameters::EPZSMaxThresScale, InputParameters::EPZSMedThresScale, InputParameters::EPZSMinThresScale, InputParameters::EPZSPattern, InputParameters::EPZSSpatialMem, InputParameters::EPZSSubPelGrid, InputParameters::EPZSSubPelThresScale, InputParameters::EPZSTemporal, EPZSWindowPredictorInit(), get_mem2Dshort(), get_mem3Dint(), get_mem4Dmv(), get_mem5Dmv(), ImageParameters::height, ImageParameters::height_cr, ImageParameters::max_num_references, RoundLog2(), InputParameters::search_range, ImageParameters::width, and ImageParameters::width_cr.

Referenced by init_global_buffers().

Here is the call graph for this function:

void EPZSOutputStats ( InputParameters *  params,
FILE *  stat,
short  stats_file 
)

int EPZSPelBlockMotionSearch ( Macroblock *  ,
imgpel *  ,
short  ,
int  ,
char ***  ,
short ****  ,
int  ,
int  ,
int  ,
MotionVector *  ,
MotionVector *  ,
int  ,
int  ,
int  ,
int   
)

FAST Motion Estimation using EPZS AMT/HYC.

If medthres satisfied, then terminate, otherwise generate Predictors Condition could be strengthened by consideration distortion of adjacent partitions.

Add Spatial Predictors in predictor list. Scheme adds zero, left, top-left, top, top-right. Note that top-left adds very little in terms of performance and could be removed with little penalty if any.

Window Size Based Predictors Basically replaces a Hierarchical ME concept and helps escaping local minima, or determining large motion variations. Following predictors can be adjusted further (i.e. removed, conditioned etc) based on distortion, correlation of adjacent MVs, complexity etc. These predictors and their conditioning could also be moved after all other predictors have been tested. Adaptation could also be based on type of material and coding mode (i.e. field/frame coding,MBAFF etc considering the higher dependency with opposite parity field

Blocktype/Reference dependent predictors. Since already mvs for other blocktypes/references have been computed, we can reuse them in order to easier determine the optimal point. Use of predictors could depend on cost,

Check all predictors

Refine using EPZS pattern if needed Note that we are using a conservative threshold method. Threshold could be tested after checking only a certain number of predictors instead of the full set. Code could be easily modified for this task.

Adapt pattern based on different conditions.

center on best predictor

Check Second best predictor with EPZS pattern

Second best. Note that following code is identical as for best predictor.

Definition at line 1577 of file me_epzs.c.

References pix_pos::available, InputParameters::blc_size, EPZS_Motion, InputParameters::EPZSBlockType, EPZSBlockTypePredictors(), EPZSDetermineStopCriterion(), EPZSDistortion, InputParameters::EPZSDual, InputParameters::EPZSFixed, InputParameters::EPZSGrid, EPZSMap, InputParameters::EPZSPattern, InputParameters::EPZSSpatialMem, EPZSSpatialMemPredictors(), EPZSSpatialPredictors(), InputParameters::EPZSTemporal, EPZSTemporalPredictors(), EPZSWindowPredictors(), F_PEL, get_neighbors(), IMG_PAD_SIZE_TIMES4, storable_picture::imgUV_sub, macroblock::list_offset, macroblock::mb_nr, ImageParameters::mb_x, ImageParameters::mb_y, ImageParameters::opix_x, ImageParameters::opix_y, storable_picture::p_curr_img_sub, 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, ImageParameters::structure, and ImageParameters::type.

Referenced by init_ME_engine().

Here is the call graph for this function:

void EPZSSliceInit ( InputParameters *  params,
ImageParameters *  img,
EPZSColocParams *  p,
StorablePicture **  listX[6] 
)

For ME purposes restricting the co-located partition is not necessary.

EPZS Slice Level Initialization

Assign frame buffers for field MBs Check whether we should use top or bottom field mvs. Depending on the assigned poc values.

Generate field MVs from Frame MVs

Use inference flag to remap mvs/references Frame with field co-located

Definition at line 541 of file me_epzs.c.

References storable_picture::bottom_field, storable_picture::bottom_poc, storable_picture::coded_frame, InputParameters::EPZSTemporal, pic_motion_params::field_frame, storable_picture::frame, ImageParameters::MbaffFrameFlag, storable_picture::motion, pic_motion_params::mv, ImageParameters::num_ref_idx_l0_active, storable_picture::poc, pic_motion_params::ref_id, storable_picture::ref_pic_num, storable_picture::size_x, storable_picture::size_y, storable_picture::structure, ImageParameters::structure, storable_picture::top_field, storable_picture::top_poc, and ImageParameters::type.

Referenced by init_slice().

int EPZSSubPelBlockMotionSearch ( imgpel *  ,
short  ,
int  ,
int  ,
int  ,
int  ,
int  ,
MotionVector *  ,
MotionVector *  ,
int  ,
int  ,
int  ,
int *  ,
int   
)

int EPZSSubPelBlockSearchBiPred ( imgpel *  orig_pic,
short  ref,
int  list,
int  pic_pix_x,
int  pic_pix_y,
int  blocktype,
MotionVector *  pred_mv1,
MotionVector *  pred_mv2,
MotionVector *  mv1,
MotionVector *  mv2,
int  search_pos2,
int  search_pos4,
int  min_mcost,
int *  lambda_factor,
int  apply_weights 
)


Variable Documentation

Array for storing SAD Values.

Definition at line 89 of file me_epzs.c.

Referenced by BlockMotionSearch(), EPZSDelete(), EPZSInit(), and EPZSPelBlockMotionSearch().


Documentation generated with DoxyGen