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

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] |
Definition in file mc_prediction.c.
| 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 | |||
| ) |
Predict one chroma block.
Definition at line 462 of file mc_prediction.c.
References ImageParameters::all_mv, ImageParameters::bipred_mv, IMG_PAD_SIZE_TIMES4, IntraChromaPrediction4x4(), is_bipred_enabled(), macroblock::list_offset, ImageParameters::max_imgpel_value_comp, ImageParameters::mb_pred, MCBiPrediction(), MCPrediction(), MCWeightedBiPrediction(), MCWeightedPrediction(), OneComponentChromaPrediction(), ImageParameters::opix_c_x, ImageParameters::opix_c_y, and ImageParameters::type.
Referenced by LumaResidualCoding8x8().

| 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 | |||
| ) |
Predict one chroma 4x4 block.
Definition at line 562 of file mc_prediction.c.
References ImageParameters::all_mv, ImageParameters::bipred_mv, IntraChromaPrediction4x4(), is_bipred_enabled(), macroblock::list_offset, ImageParameters::max_imgpel_value_comp, ImageParameters::mb_pred, MCBiPrediction(), MCPrediction(), MCWeightedBiPrediction(), MCWeightedPrediction(), and ImageParameters::type.
Referenced by ChromaResidualCoding().

| void IntraChromaPrediction | ( | Macroblock * | currMB, | |
| int * | mb_up, | |||
| int * | mb_left, | |||
| int * | mb_up_left | |||
| ) |
Intra prediction of the chrminance layers of one macroblock.
< pixel position p(0,-1)
< pixel positions p(-1, -1..15)
Definition at line 656 of file mc_prediction.c.
References pix_pos::available, macroblock::c_ipred_mode, InputParameters::ChromaIntraDisable, ImageParameters::dc_pred_value_comp, distortion4x4(), ImageParameters::field_mode, storable_picture::imgUV, ImageParameters::intra_block, InputParameters::IntraDisableInterOnly, ImageParameters::max_imgpel_value_comp, pix_pos::mb_addr, ImageParameters::mb_cr_size_x, ImageParameters::mb_cr_size_y, ImageParameters::mb_size, ImageParameters::MbaffFrameFlag, ImageParameters::mpr_16x16, ImageParameters::num_blk8x8_uv, pix_pos::pos_x, pix_pos::pos_y, InputParameters::rdopt, subblk_offset_x, ImageParameters::type, InputParameters::UseConstrainedIntraPred, and ImageParameters::yuv_format.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().

| static void IntraChromaPrediction4x4 | ( | Macroblock * | currMB, | |
| int | uv, | |||
| int | block_x, | |||
| int | block_y | |||
| ) | [inline, static] |
Predict an intra chroma 4x4 block.
| 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.
| 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().

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

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

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

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