#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"
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] |
Definition in file transform8x8.c.
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_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().
void compute_sse8x8_cost | ( | ImageParameters * | p_Img, | |
imgpel ** | cur_img, | |||
imgpel ** | mpr8x8, | |||
int | pic_opix_x, | |||
int * | cost, | |||
int | min_cost | |||
) |
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.
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.
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.
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.
static int Inv_Residual_DPCM_8x8 | ( | Macroblock * | currMB, | |
int ** | m7, | |||
int | block_y, | |||
int | block_x | |||
) | [static] |
Inverse residual DPCM for Intra lossless coding.
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 | |||
) |
R-D Cost for an 8x8 Intra block.
Definition at line 287 of file transform8x8.c.
References assignSE2partition, compute_SSE8x8(), syntaxelement::context, storable_picture::imgY, syntaxelement::len, macroblock::opix_y, macroblock::p_Img, macroblock::p_slice, slice::partArr, img_par::pCurImg, macroblock::pix_x, macroblock::pix_y, slice::slice_type, syntaxelement::type, syntaxelement::value1, and writeCoeff8x8_CABAC().
Referenced by init_rdopt().
double rdcost_for_8x8_intra_blocks_444 | ( | Macroblock * | currMB, | |
int * | nonzero, | |||
int | b8, | |||
int | ipmode, | |||
double | lambda, | |||
double | min_rdcost, | |||
int | mostProbableMode | |||
) |
R-D Cost for an 8x8 Intra block.
Definition at line 367 of file transform8x8.c.
References assignSE2partition, compute_SSE8x8(), syntaxelement::context, storable_picture::imgY, syntaxelement::len, macroblock::opix_y, storable_picture::p_curr_img, macroblock::p_Img, macroblock::p_slice, slice::partArr, img_par::pCurImg, macroblock::pix_x, macroblock::pix_y, select_plane(), slice::slice_type, syntaxelement::type, syntaxelement::value1, and writeCoeff8x8_CABAC().
Referenced by init_rdopt().
static int Residual_DPCM_8x8 | ( | int | ipmode, | |
int ** | ores, | |||
int ** | rres, | |||
int | block_y, | |||
int | block_x | |||
) | [static] |
Residual DPCM for Intra lossless coding.
Definition at line 121 of file transform8x8.c.
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} }
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} }
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} }
Definition at line 43 of file transform8x8.c.
Referenced by dct_8x8(), and dct_8x8_cavlc().