transform8x8.c File Reference

8x8 transform functions More...

#include <math.h>
#include <limits.h>
#include "global.h"
#include "image.h"
#include "mb_access.h"
#include "elements.h"
#include "vlc.h"
#include "transform8x8.h"
#include "transform.h"
#include "macroblock.h"
#include "symbol.h"
#include "mc_prediction.h"
#include "md_distortion.h"
#include "quant8x8.h"
#include "rdoq.h"
#include "q_matrix.h"
#include "q_offsets.h"
#include "rdopt.h"
#include "md_common.h"
#include "intra8x8.h"
#include "rdopt_coding_state.h"

Include dependency graph for transform8x8.c:

Go to the source code of this file.

Defines

#define P_Z   (PredPel[0])
#define P_A   (PredPel[1])
#define P_B   (PredPel[2])
#define P_C   (PredPel[3])
#define P_D   (PredPel[4])
#define P_E   (PredPel[5])
#define P_F   (PredPel[6])
#define P_G   (PredPel[7])
#define P_H   (PredPel[8])
#define P_I   (PredPel[9])
#define P_J   (PredPel[10])
#define P_K   (PredPel[11])
#define P_L   (PredPel[12])
#define P_M   (PredPel[13])
#define P_N   (PredPel[14])
#define P_O   (PredPel[15])
#define P_P   (PredPel[16])
#define P_Q   (PredPel[17])
#define P_R   (PredPel[18])
#define P_S   (PredPel[19])
#define P_T   (PredPel[20])
#define P_U   (PredPel[21])
#define P_V   (PredPel[22])
#define P_W   (PredPel[23])
#define P_X   (PredPel[24])

Functions

static int Residual_DPCM_8x8 (int ipmode, int **ores, int **rres, int block_y, int block_x)
static int Inv_Residual_DPCM_8x8 (Macroblock *currMB, int **m7, int block_y, int block_x)
int Mode_Decision_for_Intra8x8Macroblock (Macroblock *currMB, double lambda, double *min_cost)
double rdcost_for_8x8_intra_blocks (Macroblock *currMB, int *nonzero, int b8, int ipmode, double lambda, double min_rdcost, int mostProbableMode)
double rdcost_for_8x8_intra_blocks_444 (Macroblock *currMB, int *nonzero, int b8, int ipmode, double lambda, double min_rdcost, int mostProbableMode)
static int check_zero (int **mb_ores, int block_x)
int dct_8x8 (Macroblock *currMB, ColorPlane pl, int b8, int *coeff_cost, int intra)
int dct_8x8_cavlc (Macroblock *currMB, ColorPlane pl, int b8, int *coeff_cost, int intra)
int dct_8x8_ls (Macroblock *currMB, ColorPlane pl, int b8, int *coeff_cost, int intra)
void compute_comp8x8_cost (ImageParameters *p_Img, imgpel **cur_img, imgpel **mpr8x8, int pic_opix_x, int *cost, int min_cost)
void compute_sad8x8_cost (ImageParameters *p_Img, imgpel **cur_img, imgpel **mpr8x8, int pic_opix_x, int *cost, int min_cost)
void compute_sse8x8_cost (ImageParameters *p_Img, imgpel **cur_img, imgpel **mpr8x8, int pic_opix_x, int *cost, int min_cost)
void compute_satd8x8_cost (ImageParameters *p_Img, imgpel **cur_img, imgpel **mpr8x8, int pic_opix_x, int *cost, int min_cost)

Variables

static const byte SNGL_SCAN8x8 [64][2]
static const byte FIELD_SCAN8x8 [64][2]
static const byte COEFF_COST8x8 [2][64]


Detailed Description

8x8 transform functions

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

Definition in file transform8x8.c.


Function Documentation

void compute_comp8x8_cost ( ImageParameters p_Img,
imgpel **  cur_img,
imgpel **  mpr8x8,
int  pic_opix_x,
int *  cost,
int  min_cost 
)

distortion for an 8x8 Intra block

Definition at line 780 of file transform8x8.c.

void compute_sad8x8_cost ( ImageParameters p_Img,
imgpel **  cur_img,
imgpel **  mpr8x8,
int  pic_opix_x,
int *  cost,
int  min_cost 
)

SAD distortion for an 8x8 Intra block.

Definition at line 810 of file transform8x8.c.

void compute_satd8x8_cost ( ImageParameters p_Img,
imgpel **  cur_img,
imgpel **  mpr8x8,
int  pic_opix_x,
int *  cost,
int  min_cost 
)

SATD distortion for an 8x8 Intra block.

Definition at line 862 of file transform8x8.c.

References HadamardSAD8x8().

Here is the call graph for this function:

void compute_sse8x8_cost ( ImageParameters p_Img,
imgpel **  cur_img,
imgpel **  mpr8x8,
int  pic_opix_x,
int *  cost,
int  min_cost 
)

SSE distortion for an 8x8 Intra block.

Definition at line 836 of file transform8x8.c.

int dct_8x8 ( Macroblock currMB,
ColorPlane  pl,
int  b8,
int *  coeff_cost,
int  intra 
)

The routine performs transform,quantization,inverse transform, adds the diff. to the prediction and writes the result to the decoded luma frame. Includes the RD constrained quantization also.

Input:
b8: Block position inside a macro block (0,1,2,3).
Output:
nonzero: 0 if no levels are nonzero. 1 if there are nonzero levels. coeff_cost: Counter for nonzero coefficients, used to discard expensive levels.

Definition at line 519 of file transform8x8.c.

References img_par::AdaptiveRounding, macroblock::ar_mode, img_par::ARCofAdj8x8, COEFF_COST8x8, copy_image_data_8x8(), FIELD_SCAN8x8, img_par::max_imgpel_value, storable_picture::p_curr_img, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, macroblock::qp_scaled, and SNGL_SCAN8x8.

Here is the call graph for this function:

int dct_8x8_cavlc ( Macroblock currMB,
ColorPlane  pl,
int  b8,
int *  coeff_cost,
int  intra 
)

The routine performs transform,quantization,inverse transform, adds the diff. to the prediction and writes the result to the decoded luma frame. Includes the RD constrained quantization also. Used for CAVLC.

Input:
b8: Block position inside a macro block (0,1,2,3).
Output:
nonzero: 0 if no levels are nonzero. 1 if there are nonzero levels. coeff_cost: Counter for nonzero coefficients, used to discard expensive levels.

Definition at line 601 of file transform8x8.c.

References img_par::AdaptiveRounding, macroblock::ar_mode, img_par::ARCofAdj8x8, COEFF_COST8x8, slice::cofAC, copy_image_data_8x8(), FIELD_SCAN8x8, img_par::max_imgpel_value, slice::mb_ores, slice::mb_pred, slice::mb_rres, storable_picture::p_curr_img, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, macroblock::qp_scaled, and SNGL_SCAN8x8.

Here is the call graph for this function:

static int Inv_Residual_DPCM_8x8 ( Macroblock currMB,
int **  m7,
int  block_y,
int  block_x 
) [static]

Inverse residual DPCM for Intra lossless coding.

Input:
block_x,block_y: Block position inside a macro block (0,8).

Definition at line 166 of file transform8x8.c.

int Mode_Decision_for_Intra8x8Macroblock ( Macroblock currMB,
double  lambda,
double *  min_cost 
)

8x8 Intra mode decision for a macroblock

Definition at line 228 of file transform8x8.c.

References macroblock::p_slice.

Referenced by encode_one_macroblock_low(), and RDCost_for_macroblocks().

double rdcost_for_8x8_intra_blocks ( Macroblock currMB,
int *  nonzero,
int  b8,
int  ipmode,
double  lambda,
double  min_rdcost,
int  mostProbableMode 
)

double rdcost_for_8x8_intra_blocks_444 ( Macroblock currMB,
int *  nonzero,
int  b8,
int  ipmode,
double  lambda,
double  min_rdcost,
int  mostProbableMode 
)

static int Residual_DPCM_8x8 ( int  ipmode,
int **  ores,
int **  rres,
int  block_y,
int  block_x 
) [static]

Residual DPCM for Intra lossless coding.

Input:
block_x,block_y: Block position inside a macro block (0,8).

Definition at line 121 of file transform8x8.c.


Variable Documentation

const byte COEFF_COST8x8[2][64] [static]

Initial value:

{
  {3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,
   1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
   9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
   9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
   9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9}
}
array used to find expensive coefficients

Definition at line 69 of file transform8x8.c.

Referenced by dct_8x8(), and dct_8x8_cavlc().

const byte FIELD_SCAN8x8[64][2] [static]

Initial value:

 {   
  {0,0}, {0,1}, {0,2}, {1,0}, {1,1}, {0,3}, {0,4}, {1,2},
  {2,0}, {1,3}, {0,5}, {0,6}, {0,7}, {1,4}, {2,1}, {3,0},
  {2,2}, {1,5}, {1,6}, {1,7}, {2,3}, {3,1}, {4,0}, {3,2},
  {2,4}, {2,5}, {2,6}, {2,7}, {3,3}, {4,1}, {5,0}, {4,2},
  {3,4}, {3,5}, {3,6}, {3,7}, {4,3}, {5,1}, {6,0}, {5,2},
  {4,4}, {4,5}, {4,6}, {4,7}, {5,3}, {6,1}, {6,2}, {5,4},
  {5,5}, {5,6}, {5,7}, {6,3}, {7,0}, {7,1}, {6,4}, {6,5},
  {6,6}, {6,7}, {7,2}, {7,3}, {7,4}, {7,5}, {7,6}, {7,7}
}
field scan pattern

Definition at line 56 of file transform8x8.c.

Referenced by dct_8x8(), and dct_8x8_cavlc().

const byte SNGL_SCAN8x8[64][2] [static]

Initial value:

 {
  {0,0}, {1,0}, {0,1}, {0,2}, {1,1}, {2,0}, {3,0}, {2,1},
  {1,2}, {0,3}, {0,4}, {1,3}, {2,2}, {3,1}, {4,0}, {5,0},
  {4,1}, {3,2}, {2,3}, {1,4}, {0,5}, {0,6}, {1,5}, {2,4},
  {3,3}, {4,2}, {5,1}, {6,0}, {7,0}, {6,1}, {5,2}, {4,3},
  {3,4}, {2,5}, {1,6}, {0,7}, {1,7}, {2,6}, {3,5}, {4,4},
  {5,3}, {6,2}, {7,1}, {7,2}, {6,3}, {5,4}, {4,5}, {3,6},
  {2,7}, {3,7}, {4,6}, {5,5}, {6,4}, {7,3}, {7,4}, {6,5},
  {5,6}, {4,7}, {5,7}, {6,6}, {7,5}, {7,6}, {6,7}, {7,7}
}
single scan pattern

Definition at line 43 of file transform8x8.c.

Referenced by dct_8x8(), and dct_8x8_cavlc().


Documentation generated with DoxyGen