mc_prediction.c File Reference

Motion Compensation. More...

#include "contributors.h"
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <math.h>
#include "global.h"
#include "macroblock.h"
#include "mc_prediction.h"
#include "refbuf.h"
#include "image.h"
#include "mb_access.h"

Include dependency graph for mc_prediction.c:

Go to the source code of this file.

Functions

static void MCWeightedBiPrediction (imgpel **mb_pred, imgpel *l0pred, imgpel *l1pred, int block_size_y, int block_x, int block_size_x, int max_imgpel_value, int wbp0, int wbp1, int offset, int wp_round, int weight_denom)
static void MCWeightedPrediction (imgpel **mb_pred, imgpel *lpred, int block_size_y, int block_x, int block_size_x, int max_imgpel_value, int wp, int offset, int wp_round, int weight_denom)
static void MCBiPrediction (imgpel **mb_pred, imgpel *l0pred, imgpel *l1pred, int block_size_y, int block_x, int block_size_x)
static void MCPrediction (imgpel **mb_pred, imgpel *lpred, int block_size_y, int block_x, int block_size_x)
static void OneComponentLumaPrediction (imgpel *mpred, int pic_pix_x, int pic_pix_y, int block_size_x, int block_size_y, StorablePicture *list)
void LumaPrediction (Macroblock *currMB, int block_x, int block_y, int block_size_x, int block_size_y, int p_dir, int l0_mode, int l1_mode, short l0_ref_idx, short l1_ref_idx, short bipred_me)
void LumaPredictionBi (Macroblock *currMB, int block_x, int block_y, int block_size_x, int block_size_y, int l0_mode, int l1_mode, short l0_ref_idx, short l1_ref_idx, int list)
void OneComponentChromaPrediction4x4_regenerate (imgpel *mpred, int block_c_x, int block_c_y, short ***mv, StorablePicture *list, int uv)
void OneComponentChromaPrediction4x4_retrieve (imgpel *mpred, int block_c_x, int block_c_y, short ***mv, StorablePicture *list, int uv)
static void OneComponentChromaPrediction (imgpel *mpred, int pic_pix_x, int pic_pix_y, int block_size_x, int block_size_y, StorablePicture *list, int uv)
static void IntraChromaPrediction4x4 (Macroblock *currMB, int uv, int block_x, int block_y)
void ChromaPrediction (Macroblock *currMB, int uv, int block_x, int block_y, int block_size_x, int block_size_y, int p_dir, int l0_mode, int l1_mode, short l0_ref_idx, short l1_ref_idx, short bipred_me)
void ChromaPrediction4x4 (Macroblock *currMB, int uv, int block_x, int block_y, int p_dir, int l0_mode, int l1_mode, short l0_ref_idx, short l1_ref_idx, short bipred_me)
void IntraChromaPrediction (Macroblock *currMB, int *mb_up, int *mb_left, int *mb_up_left)
void ComputeResidue (imgpel **curImg, imgpel **mpr, int **mb_rres, int mb_y, int mb_x, int opix_y, int opix_x, int width, int height)
void SampleReconstruct (imgpel **curImg, imgpel **mpr, int **mb_rres, int mb_y, int mb_x, int opix_y, int opix_x, int width, int height, int max_imgpel_value, int dq_bits)

Variables

static int diff [16]
static imgpel l0_pred [MB_PIXELS]
static imgpel l1_pred [MB_PIXELS]


Detailed Description

Motion Compensation.

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

Definition in file mc_prediction.c.


Function Documentation

void ChromaPrediction ( Macroblock *  currMB,
int  uv,
int  block_x,
int  block_y,
int  block_size_x,
int  block_size_y,
int  p_dir,
int  l0_mode,
int  l1_mode,
short  l0_ref_idx,
short  l1_ref_idx,
short  bipred_me 
)

void ChromaPrediction4x4 ( Macroblock *  currMB,
int  uv,
int  block_x,
int  block_y,
int  p_dir,
int  l0_mode,
int  l1_mode,
short  l0_ref_idx,
short  l1_ref_idx,
short  bipred_me 
)

void IntraChromaPrediction ( Macroblock *  currMB,
int *  mb_up,
int *  mb_left,
int *  mb_up_left 
)

static void IntraChromaPrediction4x4 ( Macroblock *  currMB,
int  uv,
int  block_x,
int  block_y 
) [inline, static]

Predict an intra chroma 4x4 block.

Parameters:
currMB  Current Macroblock
uv  color component
block_x  relative horizontal block coordinate of 4x4 block
block_y  relative vertical block coordinate of 4x4 block

Definition at line 442 of file mc_prediction.c.

References macroblock::c_ipred_mode, ImageParameters::mb_pred, and ImageParameters::mpr_16x16.

Referenced by ChromaPrediction(), and ChromaPrediction4x4().

void LumaPrediction ( Macroblock *  currMB,
int  block_x,
int  block_y,
int  block_size_x,
int  block_size_y,
int  p_dir,
int  l0_mode,
int  l1_mode,
short  l0_ref_idx,
short  l1_ref_idx,
short  bipred_me 
)

Predict one Luma block.

Parameters:
currMB  Current Macroblock
block_x  relative horizontal block coordinate of block
block_y  relative vertical block coordinate of block
block_size_x  relative horizontal block coordinate of block
block_size_y  relative vertical block coordinate of block
p_dir  prediction direction (0=list0, 1=list1, 2=bipred)
l0_mode  list0 prediction mode (1-7, 0=DIRECT if l1_mode=0)
l1_mode  list1 prediction mode (1-7, 0=DIRECT if l0_mode=0)
l0_ref_idx  reference frame for list0 prediction (-1: Intra4x4 pred. with l0_mode)
l1_ref_idx  reference frame for list1 prediction
bipred_me  use bi prediction mv (0=no bipred, 1 = use set 1, 2 = use set 2)

Definition at line 146 of file mc_prediction.c.

References ImageParameters::all_mv, ImageParameters::bipred_mv, IMG_PAD_SIZE_TIMES4, is_bipred_enabled(), macroblock::list_offset, ImageParameters::max_imgpel_value, ImageParameters::mb_pred, MCBiPrediction(), MCPrediction(), MCWeightedBiPrediction(), MCWeightedPrediction(), OneComponentLumaPrediction(), ImageParameters::opix_x, ImageParameters::opix_y, and ImageParameters::type.

Referenced by BIDPartitionCost(), GetDirectCost8x8(), GetSkipCostMB(), LumaResidualCoding8x8(), and TransformDecision().

Here is the call graph for this function:

void LumaPredictionBi ( Macroblock *  currMB,
int  block_x,
int  block_y,
int  block_size_x,
int  block_size_y,
int  l0_mode,
int  l1_mode,
short  l0_ref_idx,
short  l1_ref_idx,
int  list 
)

Predict one Luma block.

Parameters:
currMB  Current Macroblock
block_x  relative horizontal block coordinate of 4x4 block
block_y  relative vertical block coordinate of 4x4 block
block_size_x  horizontal block size
block_size_y  vertical block size
l0_mode  list0 prediction mode (1-7, 0=DIRECT if l1_mode=0)
l1_mode  list1 prediction mode (1-7, 0=DIRECT if l0_mode=0)
l0_ref_idx  reference frame for list0 prediction (-1: Intra4x4 pred. with l0_mode)
l1_ref_idx  reference frame for list1 prediction
list  current list for prediction.

Definition at line 239 of file mc_prediction.c.

References ImageParameters::bipred_mv, IMG_PAD_SIZE_TIMES4, macroblock::list_offset, ImageParameters::max_imgpel_value, ImageParameters::mb_pred, MCBiPrediction(), MCWeightedBiPrediction(), OneComponentLumaPrediction(), ImageParameters::opix_x, ImageParameters::opix_y, and ImageParameters::type.

Referenced by BPredPartitionCost().

Here is the call graph for this function:

static void MCBiPrediction ( imgpel **  mb_pred,
imgpel *  l0pred,
imgpel *  l1pred,
int  block_size_y,
int  block_x,
int  block_size_x 
) [inline, static]

BiPrediction.

Definition at line 85 of file mc_prediction.c.

Referenced by ChromaPrediction(), ChromaPrediction4x4(), LumaPrediction(), and LumaPredictionBi().

static void MCPrediction ( imgpel **  mb_pred,
imgpel *  lpred,
int  block_size_y,
int  block_x,
int  block_size_x 
) [inline, static]

BiPrediction.

Definition at line 104 of file mc_prediction.c.

Referenced by ChromaPrediction(), ChromaPrediction4x4(), and LumaPrediction().

static void MCWeightedBiPrediction ( imgpel **  mb_pred,
imgpel *  l0pred,
imgpel *  l1pred,
int  block_size_y,
int  block_x,
int  block_size_x,
int  max_imgpel_value,
int  wbp0,
int  wbp1,
int  offset,
int  wp_round,
int  weight_denom 
) [inline, static]

Weighted BiPrediction.

Definition at line 41 of file mc_prediction.c.

Referenced by ChromaPrediction(), ChromaPrediction4x4(), LumaPrediction(), and LumaPredictionBi().

static void MCWeightedPrediction ( imgpel **  mb_pred,
imgpel *  lpred,
int  block_size_y,
int  block_x,
int  block_size_x,
int  max_imgpel_value,
int  wp,
int  offset,
int  wp_round,
int  weight_denom 
) [inline, static]

Weighted Prediction.

Definition at line 63 of file mc_prediction.c.

Referenced by ChromaPrediction(), ChromaPrediction4x4(), and LumaPrediction().

static void OneComponentChromaPrediction ( imgpel *  mpred,
int  pic_pix_x,
int  pic_pix_y,
int  block_size_x,
int  block_size_y,
StorablePicture *  list,
int  uv 
) [inline, static]

Retrieve one component of a chroma block from the buffer.

Parameters:
mpred  array to store prediction values
pic_pix_x  motion shifted horizontal coordinate of block
pic_pix_y  motion shifted vertical block
block_size_x  horizontal block size
block_size_y  vertical block size
list  reference picture list
uv  chroma component

Definition at line 416 of file mc_prediction.c.

References storable_picture::imgUV_sub, storable_picture::size_x_cr_pad, storable_picture::size_y_cr_pad, and UMVLine4X().

Referenced by ChromaPrediction().

Here is the call graph for this function:

void OneComponentChromaPrediction4x4_regenerate ( imgpel *  mpred,
int  block_c_x,
int  block_c_y,
short ***  mv,
StorablePicture *  list,
int  uv 
)

Predict (on-the-fly) one component of a chroma 4x4 block.

Parameters:
mpred  array to store prediction values
block_c_x  horizontal pixel coordinate of 4x4 block
block_c_y  vertical pixel coordinate of 4x4 block
mv  motion vector array
list  image components (color planes)
uv  chroma component

Definition at line 288 of file mc_prediction.c.

References storable_picture::chroma_vector_adjustment, ImageParameters::current_mb_nr, ImageParameters::height_cr, storable_picture::imgUV, macroblock::list_offset, ImageParameters::mb_cr_size_x, ImageParameters::mb_cr_size_y, ImageParameters::mb_data, ImageParameters::opix_c_x, ImageParameters::opix_c_y, and ImageParameters::width_cr.

Referenced by PatchInp().

void OneComponentChromaPrediction4x4_retrieve ( imgpel *  mpred,
int  block_c_x,
int  block_c_y,
short ***  mv,
StorablePicture *  list,
int  uv 
)

Retrieve one component of a chroma 4x4 block from the buffer.

Parameters:
mpred  array to store prediction values
block_c_x  horizontal pixel coordinate of 4x4 block
block_c_y  vertical pixel coordinate of 4x4 block
mv  motion vector array
list  image components (color planes)
uv  chroma component

Definition at line 354 of file mc_prediction.c.

References storable_picture::chroma_vector_adjustment, IMG_PAD_SIZE_TIMES4, storable_picture::imgUV_sub, ImageParameters::opix_c_x, ImageParameters::opix_c_y, storable_picture::size_x_cr_pad, storable_picture::size_y_cr_pad, and UMVLine8X_chroma().

Referenced by PatchInp().

Here is the call graph for this function:

static void OneComponentLumaPrediction ( imgpel *  mpred,
int  pic_pix_x,
int  pic_pix_y,
int  block_size_x,
int  block_size_y,
StorablePicture *  list 
) [inline, static]

Predict Luma block.

Parameters:
mpred  array of prediction values (row by row)
pic_pix_x  motion shifted horizontal coordinate of block
pic_pix_y  motion shifted vertical coordinate of block
block_size_x  horizontal block size
block_size_y  vertical block size
list  reference picture list

Definition at line 120 of file mc_prediction.c.

References storable_picture::p_curr_img_sub, storable_picture::size_x_pad, storable_picture::size_y_pad, and UMVLine4X().

Referenced by LumaPrediction(), and LumaPredictionBi().

Here is the call graph for this function:


Documentation generated with DoxyGen