#include "contributors.h"
#include <math.h>
#include "global.h"
#include "mbuffer.h"
#include "elements.h"
#include "errorconcealment.h"
#include "macroblock.h"
#include "fmo.h"
#include "cabac.h"
#include "vlc.h"
#include "image.h"
#include "mb_access.h"
#include "biaridecod.h"
#include "block.h"
#include "transform8x8.h"
#include "transform.h"
#include "mc_prediction.h"
#include "quant.h"
#include "intra4x4_pred.h"
#include "intra8x8_pred.h"
#include "intra16x16_pred.h"

Go to the source code of this file.
Defines | |
| #define | TRACE_STRING(s) |
| #define | TRACE_DECBITS(i) |
| #define | TRACE_PRINTF(s) |
| #define | TRACE_STRING_P(s) |
| #define | ZERO_P8x8 (mbmode==5) |
| #define | MODE_IS_P8x8 (mbmode==4 || mbmode==5) |
| #define | MODE_IS_I4x4 (mbmode==6) |
| #define | I16OFFSET (mbmode-7) |
| #define | MODE_IS_IPCM (mbmode==31) |
Functions | |
| void | dectracebitcnt (int count) |
| static void | readMotionInfoFromNAL (ImageParameters *img, Slice *currSlice, Macroblock *currMB) |
| static void | read_ipred_modes (ImageParameters *img, Slice *currSlice, Macroblock *currMB) |
| static void | readCBPandCoeffsFromNAL (ImageParameters *img, Slice *currSlice, Macroblock *currMB) |
| static void | readIPCMcoeffsFromNAL (ImageParameters *img, struct datapartition *dP) |
| int | BType2CtxRef (int btype) |
| static char | readRefPictureIdx_VLC (SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) |
| static char | readRefPictureIdx_FLC (SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) |
| static char | readRefPictureIdx_Null (SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) |
| static void | prepareListforRefIdx (SyntaxElement *currSE, DataPartition *dP, int num_ref_idx_active, int refidx_present) |
| void | set_chroma_qp (ImageParameters *img, Macroblock *currMB) |
| void | update_qp (ImageParameters *img, Macroblock *currMB, int qp) |
| static void | read_delta_quant (SyntaxElement *currSE, DataPartition *dP, Slice *currSlice, ImageParameters *img, Macroblock *currMB, byte *partMap, int type) |
| static void | readMBRefPictureIdx (SyntaxElement *currSE, DataPartition *dP, Macroblock *currMB, ImageParameters *img, char **cur_ref_idx, int list, int step_v0, int step_h0) |
| static void | readMBMotionVectors (SyntaxElement *currSE, DataPartition *dP, Macroblock *currMB, ImageParameters *img, int list, int step_h0, int step_v0) |
| void | invScaleCoeff (ImageParameters *img, Macroblock *currMB, int level, int run, int qp_per, int i, int j, int i0, int j0, int coef_ctr, const byte(*pos_scan4x4)[2], int(*InvLevelScale4x4)[4]) |
| void | start_macroblock (ImageParameters *img, Macroblock **currMB) |
| Boolean | exit_macroblock (ImageParameters *img, int eos_bit) |
| static void | interpret_mb_mode_P (Macroblock *currMB) |
| static void | interpret_mb_mode_I (Macroblock *currMB) |
| static void | interpret_mb_mode_B (Macroblock *currMB) |
| static void | interpret_mb_mode_SI (Macroblock *currMB) |
| void | set_interpret_mb_mode (int slice_type) |
| static void | init_macroblock (ImageParameters *img) |
| void | SetB8Mode (ImageParameters *img, Macroblock *currMB, int value, int i) |
| void | reset_coeffs (void) |
| void | field_flag_inference (Macroblock *currMB) |
| void | skip_macroblock (ImageParameters *img, Macroblock *currMB) |
| static void | concealIPCMcoeffs (ImageParameters *img) |
| void | read_one_macroblock (ImageParameters *img, Slice *currSlice, Macroblock *currMB) |
| static void | init_decoding_engine_IPCM (ImageParameters *img) |
| void | get_neighbors (Macroblock *currMB, PixelPos *block_a, PixelPos *block_b, PixelPos *block_c, PixelPos *block_d, int mb_x, int mb_y, int blockshape_x) |
| void | GetMotionVectorPredictor (Macroblock *currMB, PixelPos *block_a, PixelPos *block_b, PixelPos *block_c, short pmv[2], char ref_frame, char **refPic, short ***tmp_mv, int mb_x, int mb_y, int blockshape_x, int blockshape_y) |
| int | predict_nnz (Macroblock *currMB, int block_type, ImageParameters *img, int i, int j) |
| int | predict_nnz_chroma (Macroblock *currMB, ImageParameters *img, int i, int j) |
| static void | readCoeff4x4_CAVLC (Slice *currSlice, Macroblock *currMB, ImageParameters *img, int block_type, int i, int j, int levarr[16], int runarr[16], int *number_coefficients) |
| static void | readCompCoeff4x4SMB_CABAC (ImageParameters *img, Slice *currSlice, Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl, int block_y, int block_x, int start_scan, int64 *cbp_blk) |
| static void | readCompCoeff4x4MB_CABAC (ImageParameters *img, Slice *currSlice, Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl, int intra, int(*InvLevelScale4x4)[4], int qp_per, int cbp) |
| static void | readCompCoeff8x8_CABAC (ImageParameters *img, Slice *currSlice, Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl, int b8) |
| static void | readCompCoeff8x8MB_CABAC (ImageParameters *img, Slice *currSlice, Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl) |
| static void | readCompCoeff4x4MB_CAVLC (ImageParameters *img, Slice *currSlice, Macroblock *currMB, ColorPlane pl, int(*InvLevelScale4x4)[4], int qp_per, int cbp, byte **nzcoeff) |
| static void | readCompCoeff8x8MB_CAVLC (ImageParameters *img, Slice *currSlice, Macroblock *currMB, ColorPlane pl, int(*InvLevelScale8x8)[8], int qp_per, int cbp, byte **nzcoeff) |
| static void | check_dp_neighbors (Macroblock *currMB) |
| void | decode_ipcm_mb (ImageParameters *img, Macroblock *currMB) |
| int | decode_one_component (ImageParameters *img, ColorPlane curr_plane, imgpel **currImg, Macroblock *currMB, StorablePicture *dec_picture, MotionParams *colocated, int list_offset) |
| int | decode_one_macroblock (ImageParameters *img, Macroblock *currMB, StorablePicture *dec_picture) |
| void | change_plane_JV (int nplane) |
| void | make_frame_picture_JV () |
Variables | |
| static const byte | SNGL_SCAN [16][2] |
| static const byte | FIELD_SCAN [16][2] |
| static const int | BLOCK_STEP [8][2] |
| const byte | QP_SCALE_CR [52] |
| const byte | SNGL_SCAN8x8 [64][2] |
| const byte | FIELD_SCAN8x8 [64][2] |
| static const byte | SCAN_YUV422 [8][2] |
| static unsigned char | cbp_blk_chroma [8][4] |
| const unsigned char | subblk_offset_x [3][8][4] |
| const unsigned char | subblk_offset_y [3][8][4] |
| const unsigned char | cofuv_blk_x [3][8][4] |
| static const unsigned char | cofuv_blk_y [3][8][4] |
| int | last_dquant |
| ColocatedParams * | Co_located |
| ColocatedParams * | Co_located_JV [MAX_PLANE] |
| static void(* | interpret_mb_mode )(Macroblock *currMB) |
| static char(* | readRefPictureIdx )(SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) |
Definition in file macroblock.c.
| int BType2CtxRef | ( | int | btype | ) |
Set context for reference frames.
Definition at line 269 of file macroblock.c.
Referenced by readRefPictureIdx_FLC(), and readRefPictureIdx_VLC().
| void change_plane_JV | ( | int | nplane | ) |
change target plane for 4:4:4 Independent mode
Definition at line 4722 of file macroblock.c.
References dec_picture_JV.
Referenced by decode_one_slice(), and exit_picture().
| static void check_dp_neighbors | ( | Macroblock * | currMB | ) | [static] |
Data partitioning: Check if neighboring macroblock is needed for CAVLC context decoding, and disable current MB if data partition is missing.
Definition at line 3297 of file macroblock.c.
References macroblock::dpl_flag.
Referenced by readCBPandCoeffsFromNAL().
| void decode_ipcm_mb | ( | ImageParameters * | img, | |
| Macroblock * | currMB | |||
| ) |
Copy IPCM coefficients to decoded picture buffer and set parameters for this MB (for IPCM CABAC and IPCM CAVLC 28/11/2003).
Definition at line 4154 of file macroblock.c.
References macroblock::cbp_blk, storable_picture::chroma_format_idc, storable_picture::imgUV, storable_picture::imgY, macroblock::skip_flag, update_qp(), and YUV400.
Referenced by decode_one_macroblock().

| int decode_one_component | ( | ImageParameters * | img, | |
| ColorPlane | curr_plane, | |||
| imgpel ** | currImg, | |||
| Macroblock * | currMB, | |||
| StorablePicture * | dec_picture, | |||
| MotionParams * | colocated, | |||
| int | list_offset | |||
| ) |
decode one color component
invalid index. Default to zero even though this case should not happen
invalid index. Default to zero even though this case should not happen
In such case, an array is needed for each different reference.
Definition at line 4208 of file macroblock.c.
References macroblock::b8mode, macroblock::b8pdir, storable_picture::bottom_poc, storable_picture::chroma_format_idc, error(), macroblock::i16mode, storable_picture::imgUV, intrapred(), intrapred16x16(), intrapred8x8(), Inv_Residual_trans_4x4(), Inv_Residual_trans_8x8(), storable_picture::is_long_term, macroblock::is_lossless, itrans4x4(), itrans8x8(), macroblock::luma_transform_size_8x8_flag, macroblock::mb_field, macroblock::mb_type, storable_picture::motion, motion_params::moving_block, motion_params::mv, pic_motion_params::mv, motion_params::ref_idx, pic_motion_params::ref_idx, motion_params::ref_pic_id, pic_motion_params::ref_pic_id, storable_picture::ref_pic_num, YUV400, and YUV444.
Referenced by decode_one_macroblock().

| int decode_one_macroblock | ( | ImageParameters * | img, | |
| Macroblock * | currMB, | |||
| StorablePicture * | dec_picture | |||
| ) |
decode one macroblock
Definition at line 4620 of file macroblock.c.
References colocated_params::bottom, storable_picture::chroma_vector_adjustment, decode_ipcm_mb(), decode_one_component(), colocated_params::frame, storable_picture::imgUV, storable_picture::imgY, macroblock::mb_field, macroblock::mb_type, storable_picture::structure, colocated_params::top, and YUV444.
Referenced by decode_one_slice().

| Boolean exit_macroblock | ( | ImageParameters * | img, | |
| int | eos_bit | |||
| ) |
set coordinates of the next macroblock check end_of_slice condition
The if() statement below resembles the original code, which tested
img->current_mb_nr == img->PicSizeInMbs. Both is, of course, nonsense In an error prone environment, one can only be sure to have a new picture by checking the tr of the next slice header!
Definition at line 630 of file macroblock.c.
References FmoGetNextMBNr().
Referenced by decode_one_slice().

| void get_neighbors | ( | Macroblock * | currMB, | |
| PixelPos * | block_a, | |||
| PixelPos * | block_b, | |||
| PixelPos * | block_c, | |||
| PixelPos * | block_d, | |||
| int | mb_x, | |||
| int | mb_y, | |||
| int | blockshape_x | |||
| ) |
Get current block spatial neighbors.
Definition at line 1740 of file macroblock.c.
References get4x4Neighbour().
Referenced by readMBMotionVectors().

| void GetMotionVectorPredictor | ( | Macroblock * | currMB, | |
| PixelPos * | block_a, | |||
| PixelPos * | block_b, | |||
| PixelPos * | block_c, | |||
| short | pmv[2], | |||
| char | ref_frame, | |||
| char ** | refPic, | |||
| short *** | tmp_mv, | |||
| int | mb_x, | |||
| int | mb_y, | |||
| int | blockshape_x, | |||
| int | blockshape_y | |||
| ) |
Get motion vector predictor.
Definition at line 1790 of file macroblock.c.
References macroblock::mb_field.
Referenced by readMBMotionVectors().
| static void init_decoding_engine_IPCM | ( | ImageParameters * | img | ) | [static] |
Initialize decoding engine after decoding an IPCM macroblock (for IPCM CABAC 28/11/2003).
Definition at line 1505 of file macroblock.c.
References arideco_start_decoding(), datapartition::bitstream, datapartition::de_cabac, Slice::dp_mode, PAR_DP_1, PAR_DP_3, Slice::partArr, Bitstream::read_len, and Bitstream::streamBuffer.
Referenced by readIPCMcoeffsFromNAL().

| static void init_macroblock | ( | ImageParameters * | img | ) | [static] |
init macroblock I and P frames
Definition at line 913 of file macroblock.c.
References storable_picture::motion, pic_motion_params::mv, pic_motion_params::ref_idx, and pic_motion_params::ref_pic_id.
Referenced by read_one_macroblock().
| static void interpret_mb_mode_B | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for B-Frames.
Definition at line 762 of file macroblock.c.
References macroblock::b8mode, macroblock::b8pdir, macroblock::cbp, macroblock::i16mode, and macroblock::mb_type.
Referenced by set_interpret_mb_mode().
| static void interpret_mb_mode_I | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for I-Frames.
Definition at line 726 of file macroblock.c.
References macroblock::b8mode, macroblock::b8pdir, macroblock::cbp, macroblock::i16mode, and macroblock::mb_type.
Referenced by set_interpret_mb_mode().
| static void interpret_mb_mode_P | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for P-Frames.
Definition at line 673 of file macroblock.c.
References macroblock::b8mode, macroblock::b8pdir, macroblock::cbp, macroblock::i16mode, and macroblock::mb_type.
Referenced by set_interpret_mb_mode().
| static void interpret_mb_mode_SI | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for SI-Frames.
Definition at line 843 of file macroblock.c.
References macroblock::b8mode, macroblock::b8pdir, macroblock::cbp, macroblock::i16mode, and macroblock::mb_type.
Referenced by set_interpret_mb_mode().
| void make_frame_picture_JV | ( | void | ) |
make frame picture from each plane data for 4:4:4 Independent mode
Definition at line 4737 of file macroblock.c.
References dec_picture_JV, free_storable_picture(), storable_picture::imgUV, storable_picture::imgY, storable_picture::JVmotion, and storable_picture::motion.
Referenced by exit_picture().

| int predict_nnz | ( | Macroblock * | currMB, | |
| int | block_type, | |||
| ImageParameters * | img, | |||
| int | i, | |||
| int | j | |||
| ) |
Get the Prediction from the Neighboring Blocks for Number of Nonzero Coefficients.
Luma Blocks
Definition at line 2226 of file macroblock.c.
References error(), get4x4Neighbour(), and PAR_DP_3.
Referenced by readCoeff4x4_CAVLC().

| int predict_nnz_chroma | ( | Macroblock * | currMB, | |
| ImageParameters * | img, | |||
| int | i, | |||
| int | j | |||
| ) |
Get the Prediction from the Neighboring Blocks for Number of Nonzero Coefficients.
Chroma Blocks
Definition at line 2316 of file macroblock.c.
References storable_picture::chroma_format_idc, get4x4Neighbour(), PAR_DP_3, and YUV444.
Referenced by readCoeff4x4_CAVLC().

| static void prepareListforRefIdx | ( | SyntaxElement * | currSE, | |
| DataPartition * | dP, | |||
| int | num_ref_idx_active, | |||
| int | refidx_present | |||
| ) | [inline, static] |
Function to prepare reference picture indice function pointer.
Definition at line 340 of file macroblock.c.
References datapartition::bitstream, Bitstream::ei_flag, linfo_ue(), syntaxelement::mapping, syntaxelement::reading, readRefFrame_CABAC(), readRefPictureIdx, readRefPictureIdx_FLC(), readRefPictureIdx_Null(), and readRefPictureIdx_VLC().
Referenced by readMotionInfoFromNAL().

| static void read_ipred_modes | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB | |||
| ) | [static] |
If data partition B is lost, conceal PCM sample values with DC.
Definition at line 1619 of file macroblock.c.
References assignSE2partition, macroblock::b8mode, datapartition::bitstream, macroblock::c_ipred_mode, storable_picture::chroma_format_idc, syntaxelement::context, Slice::dp_mode, Bitstream::ei_flag, error(), get4x4Neighbour(), linfo_ue(), syntaxelement::mapping, macroblock::mb_type, Slice::partArr, readCIPredMode_CABAC(), syntaxelement::reading, readIntraPredMode_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_Intra4x4PredictionMode(), syntaxelement::type, syntaxelement::value1, YUV400, and YUV444.
Referenced by read_one_macroblock().

| void read_one_macroblock | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB | |||
| ) |
Get the syntax elements from the NAL.
TO for error concealment If we have an INTRA Macroblock and we lost the partition which contains the intra coefficients Copy MB would be better than just a gray block. Seems to be a bit at the wrong place to do this right here, but for this case up to now there is no other way.
Definition at line 1134 of file macroblock.c.
References assignSE2partition, macroblock::b8mode, macroblock::b8pdir, datapartition::bitstream, macroblock::cbp, Slice::dp_mode, Slice::dpB_NotPresent, macroblock::ei_flag, Bitstream::ei_flag, Bitstream::frame_bitoffset, init_macroblock(), syntaxelement::len, linfo_ue(), macroblock::luma_transform_size_8x8_flag, syntaxelement::mapping, pic_motion_params::mb_field, macroblock::mb_field, mb_is_available(), macroblock::mb_type, storable_picture::motion, macroblock::NoMbPartLessThan8x8Flag, Slice::partArr, macroblock::qp, read_ipred_modes(), readB8_typeInfo_CABAC(), readCBPandCoeffsFromNAL(), syntaxelement::reading, readIPCMcoeffsFromNAL(), readMB_skip_flagInfo_CABAC(), readMB_transform_size_flag_CABAC(), readMB_typeInfo_CABAC(), readMotionInfoFromNAL(), datapartition::readSyntaxElement, readSyntaxElement_FLC(), SE_HEADER, SetB8Mode(), macroblock::skip_flag, syntaxelement::type, update_qp(), syntaxelement::value1, and syntaxelement::value2.
Referenced by decode_one_slice().

| static void readCBPandCoeffsFromNAL | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB | |||
| ) | [static] |
Get coded block pattern and coefficients (run/level) from the NAL.
Definition at line 3325 of file macroblock.c.
References assignSE2partition, datapartition::bitstream, macroblock::cbp, macroblock::cbp_blk, check_dp_neighbors(), storable_picture::chroma_format_idc, syntaxelement::context, Slice::dp_mode, Slice::dpB_NotPresent, Slice::dpC_NotPresent, macroblock::dpl_flag, macroblock::ei_flag, Bitstream::ei_flag, FIELD_SCAN, macroblock::is_lossless, itrans_2(), syntaxelement::len, linfo_cbp_inter(), linfo_cbp_intra(), linfo_levrun_c2x2(), linfo_levrun_inter(), macroblock::luma_transform_size_8x8_flag, syntaxelement::mapping, macroblock::mb_field, macroblock::mb_type, macroblock::NoMbPartLessThan8x8Flag, Slice::partArr, macroblock::qp, macroblock::qp_scaled, macroblock::qpc, readCBP_CABAC(), readCoeff4x4_CAVLC(), readCompCoeff4x4MB_CABAC(), readCompCoeff4x4MB_CAVLC(), readCompCoeff8x8MB_CABAC(), readCompCoeff8x8MB_CAVLC(), syntaxelement::reading, readMB_transform_size_flag_CABAC(), readRunLevel_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_FLC(), SCAN_YUV422, SE_HEADER, SNGL_SCAN, subblk_offset_x, syntaxelement::type, update_qp(), syntaxelement::value1, syntaxelement::value2, YUV400, YUV420, YUV422, and YUV444.
Referenced by read_one_macroblock().

| static void readCoeff4x4_CAVLC | ( | Slice * | currSlice, | |
| Macroblock * | currMB, | |||
| ImageParameters * | img, | |||
| int | block_type, | |||
| int | i, | |||
| int | j, | |||
| int | levarr[16], | |||
| int | runarr[16], | |||
| int * | number_coefficients | |||
| ) | [static] |
Reads coeff of an 4x4 block (CAVLC).
Definition at line 2379 of file macroblock.c.
References assignSE2partition, datapartition::bitstream, Slice::dp_mode, error(), syntaxelement::inf, syntaxelement::len, Slice::partArr, predict_nnz(), predict_nnz_chroma(), readSyntaxElement_FLC(), readSyntaxElement_Level_VLC0(), readSyntaxElement_Level_VLCN(), readSyntaxElement_NumCoeffTrailingOnes(), readSyntaxElement_NumCoeffTrailingOnesChromaDC(), readSyntaxElement_Run(), readSyntaxElement_TotalZeros(), readSyntaxElement_TotalZerosChromaDC(), syntaxelement::type, syntaxelement::value1, and syntaxelement::value2.
Referenced by readCBPandCoeffsFromNAL(), readCompCoeff4x4MB_CAVLC(), and readCompCoeff8x8MB_CAVLC().

| static void readCompCoeff4x4MB_CABAC | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB, | |||
| SyntaxElement * | currSE, | |||
| ColorPlane | pl, | |||
| int | intra, | |||
| int(*) | InvLevelScale4x4[4], | |||
| int | qp_per, | |||
| int | cbp | |||
| ) | [static] |
Get coefficients (run/level) of all 4x4 blocks in a MB from the NAL (CABAC Mode).
Definition at line 2769 of file macroblock.c.
References macroblock::cbp_blk, syntaxelement::context, macroblock::is_lossless, and readCompCoeff4x4SMB_CABAC().
Referenced by readCBPandCoeffsFromNAL().

| static void readCompCoeff4x4MB_CAVLC | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB, | |||
| ColorPlane | pl, | |||
| int(*) | InvLevelScale4x4[4], | |||
| int | qp_per, | |||
| int | cbp, | |||
| byte ** | nzcoeff | |||
| ) | [static] |
Get coefficients (run/level) of 4x4 blocks in a MB from the NAL (CABAC Mode).
Definition at line 3023 of file macroblock.c.
References macroblock::cbp_blk, FIELD_SCAN, macroblock::is_lossless, macroblock::mb_field, readCoeff4x4_CAVLC(), and SNGL_SCAN.
Referenced by readCBPandCoeffsFromNAL().

| static void readCompCoeff4x4SMB_CABAC | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB, | |||
| SyntaxElement * | currSE, | |||
| ColorPlane | pl, | |||
| int | block_y, | |||
| int | block_x, | |||
| int | start_scan, | |||
| int64 * | cbp_blk | |||
| ) | [static] |
Get coefficients (run/level) of 4x4 blocks in a SMB from the NAL (CABAC Mode).
Definition at line 2659 of file macroblock.c.
References assignSE2partition, datapartition::bitstream, Slice::dp_mode, Bitstream::ei_flag, FIELD_SCAN, linfo_levrun_inter(), syntaxelement::mapping, macroblock::mb_field, Slice::partArr, syntaxelement::reading, readRunLevel_CABAC(), datapartition::readSyntaxElement, SNGL_SCAN, syntaxelement::type, syntaxelement::value1, and syntaxelement::value2.
Referenced by readCompCoeff4x4MB_CABAC().

| static void readCompCoeff8x8_CABAC | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB, | |||
| SyntaxElement * | currSE, | |||
| ColorPlane | pl, | |||
| int | b8 | |||
| ) | [static] |
Get coefficients (run/level) of one 8x8 block from the NAL (CABAC Mode).
Definition at line 2847 of file macroblock.c.
References assignSE2partition, macroblock::cbp, macroblock::cbp_blk, syntaxelement::context, Slice::dp_mode, FIELD_SCAN8x8, macroblock::is_lossless, macroblock::mb_field, Slice::partArr, macroblock::qp_scaled, syntaxelement::reading, readRunLevel_CABAC(), datapartition::readSyntaxElement, SNGL_SCAN8x8, syntaxelement::type, syntaxelement::value1, and syntaxelement::value2.
Referenced by readCompCoeff8x8MB_CABAC().

| static void readCompCoeff8x8MB_CABAC | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB, | |||
| SyntaxElement * | currSE, | |||
| ColorPlane | pl | |||
| ) | [static] |
Get coefficients (run/level) of 8x8 blocks in a MB from the NAL (CABAC Mode).
Definition at line 3007 of file macroblock.c.
References readCompCoeff8x8_CABAC().
Referenced by readCBPandCoeffsFromNAL().

| static void readCompCoeff8x8MB_CAVLC | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB, | |||
| ColorPlane | pl, | |||
| int(*) | InvLevelScale8x8[8], | |||
| int | qp_per, | |||
| int | cbp, | |||
| byte ** | nzcoeff | |||
| ) | [static] |
Get coefficients (run/level) of 4x4 blocks in a MB from the NAL (CABAC Mode).
Definition at line 3155 of file macroblock.c.
References macroblock::cbp_blk, FIELD_SCAN8x8, macroblock::is_lossless, macroblock::mb_field, readCoeff4x4_CAVLC(), and SNGL_SCAN8x8.
Referenced by readCBPandCoeffsFromNAL().

| static void readIPCMcoeffsFromNAL | ( | ImageParameters * | img, | |
| struct datapartition * | dP | |||
| ) | [static] |
Read IPCM pcm_alignment_zero_bit and pcm_byte[i] from stream to img->cof (for IPCM CABAC and IPCM CAVLC).
Definition at line 1546 of file macroblock.c.
References datapartition::bitstream, storable_picture::chroma_format_idc, Bitstream::frame_bitoffset, init_decoding_engine_IPCM(), syntaxelement::len, readIPCM_CABAC(), readSyntaxElement_FLC(), syntaxelement::value1, and YUV400.
Referenced by read_one_macroblock().

| static void readMBMotionVectors | ( | SyntaxElement * | currSE, | |
| DataPartition * | dP, | |||
| Macroblock * | currMB, | |||
| ImageParameters * | img, | |||
| int | list, | |||
| int | step_h0, | |||
| int | step_v0 | |||
| ) | [inline, static] |
Function to read reference picture indice values.
Definition at line 451 of file macroblock.c.
References macroblock::b8mode, macroblock::b8pdir, BLOCK_STEP, get_neighbors(), GetMotionVectorPredictor(), storable_picture::motion, pic_motion_params::mv, macroblock::mvd, datapartition::readSyntaxElement, pic_motion_params::ref_idx, syntaxelement::value1, and syntaxelement::value2.
Referenced by readMotionInfoFromNAL().

| static void readMBRefPictureIdx | ( | SyntaxElement * | currSE, | |
| DataPartition * | dP, | |||
| Macroblock * | currMB, | |||
| ImageParameters * | img, | |||
| char ** | cur_ref_idx, | |||
| int | list, | |||
| int | step_v0, | |||
| int | step_h0 | |||
| ) | [inline, static] |
Function to read reference picture indice values.
Definition at line 421 of file macroblock.c.
References macroblock::b8mode, macroblock::b8pdir, and readRefPictureIdx.
Referenced by readMotionInfoFromNAL().
| static void readMotionInfoFromNAL | ( | ImageParameters * | img, | |
| Slice * | currSlice, | |||
| Macroblock * | currMB | |||
| ) | [static] |
Read motion info.
invalid index. Default to zero even though this case should not happen
invalid index. Default to zero even though this case should not happen
Definition at line 1964 of file macroblock.c.
References assignSE2partition, macroblock::b8mode, datapartition::bitstream, BLOCK_STEP, colocated_params::bottom, storable_picture::bottom_poc, Slice::dp_mode, Bitstream::ei_flag, error(), colocated_params::frame, storable_picture::is_long_term, linfo_se(), syntaxelement::mapping, macroblock::mb_field, macroblock::mb_type, storable_picture::motion, motion_params::moving_block, motion_params::mv, pic_motion_params::mv, Slice::partArr, prepareListforRefIdx(), syntaxelement::reading, readMBMotionVectors(), readMBRefPictureIdx(), readMVD_CABAC(), motion_params::ref_idx, pic_motion_params::ref_idx, pic_motion_params::ref_pic_id, motion_params::ref_pic_id, storable_picture::ref_pic_num, colocated_params::top, and syntaxelement::type.
Referenced by read_one_macroblock().

| static char readRefPictureIdx_FLC | ( | SyntaxElement * | currSE, | |
| DataPartition * | dP, | |||
| char | b8mode, | |||
| int | list | |||
| ) | [static] |
Function for reading the reference picture indices using FLC.
Definition at line 307 of file macroblock.c.
References datapartition::bitstream, BType2CtxRef(), syntaxelement::context, syntaxelement::len, readSyntaxElement_FLC(), and syntaxelement::value1.
Referenced by prepareListforRefIdx().

| static char readRefPictureIdx_Null | ( | SyntaxElement * | currSE, | |
| DataPartition * | dP, | |||
| char | b8mode, | |||
| int | list | |||
| ) | [static] |
Dummy Function for reading the reference picture indices.
Definition at line 329 of file macroblock.c.
Referenced by prepareListforRefIdx().
| static char readRefPictureIdx_VLC | ( | SyntaxElement * | currSE, | |
| DataPartition * | dP, | |||
| char | b8mode, | |||
| int | list | |||
| ) | [static] |
Function for reading the reference picture indices using VLC.
Definition at line 288 of file macroblock.c.
References BType2CtxRef(), syntaxelement::context, img, datapartition::readSyntaxElement, syntaxelement::value1, and syntaxelement::value2.
Referenced by prepareListforRefIdx().

| void set_interpret_mb_mode | ( | int | slice_type | ) |
Set mode interpretation based on slice type.
Definition at line 886 of file macroblock.c.
References interpret_mb_mode_B(), interpret_mb_mode_I(), interpret_mb_mode_P(), and interpret_mb_mode_SI().
Referenced by decode_one_slice().

| void SetB8Mode | ( | ImageParameters * | img, | |
| Macroblock * | currMB, | |||
| int | value, | |||
| int | i | |||
| ) |
Sets mode for 8x8 block.
Definition at line 950 of file macroblock.c.
References macroblock::b8mode, and macroblock::b8pdir.
Referenced by read_one_macroblock().
| void start_macroblock | ( | ImageParameters * | img, | |
| Macroblock ** | currMB | |||
| ) |
initializes the current macroblock
Definition at line 552 of file macroblock.c.
References CheckAvailabilityOfNeighbors(), error(), storable_picture::max_slice_id, macroblock::mbAddrX, macroblock::qp, storable_picture::slice_id, and update_qp().
Referenced by decode_one_slice().

| void update_qp | ( | ImageParameters * | img, | |
| Macroblock * | currMB, | |||
| int | qp | |||
| ) |
updates chroma QP according to luma QP and bit depth
Definition at line 382 of file macroblock.c.
References macroblock::is_lossless, macroblock::qp, and macroblock::qp_scaled.
Referenced by decode_ipcm_mb(), read_one_macroblock(), readCBPandCoeffsFromNAL(), and start_macroblock().
const int BLOCK_STEP[8][2] [static] |
Initial value:
{
{0,0},{4,4},{4,2},{2,4},{2,2},{2,1},{1,2},{1,1}
}
Definition at line 79 of file macroblock.c.
Referenced by readMBMotionVectors(), and readMotionInfoFromNAL().
unsigned char cbp_blk_chroma[8][4] [static] |
Initial value:
{ {16, 17, 18, 19},
{20, 21, 22, 23},
{24, 25, 26, 27},
{28, 29, 30, 31},
{32, 33, 34, 35},
{36, 37, 38, 39},
{40, 41, 42, 43},
{44, 45, 46, 47} }
Definition at line 119 of file macroblock.c.
| ColocatedParams* Co_located_JV[MAX_PLANE] |
| const unsigned char cofuv_blk_x[3][8][4] |
Initial value:
{ { {0, 1, 0, 1},
{0, 1, 0, 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, 1, 0, 1},
{0, 1, 0, 1},
{0, 1, 0, 1},
{0, 1, 0, 1},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0} },
{ {0, 1, 0, 1},
{2, 3, 2, 3},
{0, 1, 0, 1},
{2, 3, 2, 3},
{0, 1, 0, 1},
{2, 3, 2, 3},
{0, 1, 0, 1},
{2, 3, 2, 3} }
}
Definition at line 189 of file macroblock.c.
const unsigned char cofuv_blk_y[3][8][4] [static] |
Initial value:
{
{ { 0, 0, 1, 1},
{ 0, 0, 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, 1, 1},
{ 2, 2, 3, 3},
{ 0, 0, 1, 1},
{ 2, 2, 3, 3},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0} },
{ { 0, 0, 1, 1},
{ 0, 0, 1, 1},
{ 2, 2, 3, 3},
{ 2, 2, 3, 3},
{ 0, 0, 1, 1},
{ 0, 0, 1, 1},
{ 2, 2, 3, 3},
{ 2, 2, 3, 3}}
}
Definition at line 218 of file macroblock.c.
const byte FIELD_SCAN[16][2] [static] |
Initial value:
{
{0,0},{0,1},{1,0},{0,2},
{0,3},{1,1},{1,2},{1,3},
{2,0},{2,1},{2,2},{2,3},
{3,0},{3,1},{3,2},{3,3}
}
Definition at line 70 of file macroblock.c.
Referenced by readCBPandCoeffsFromNAL(), readCompCoeff4x4MB_CAVLC(), and readCompCoeff4x4SMB_CABAC().
| const byte FIELD_SCAN8x8[64][2] |
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 103 of file macroblock.c.
Referenced by readCompCoeff8x8_CABAC(), and readCompCoeff8x8MB_CAVLC().
| const byte QP_SCALE_CR[52] |
Initial value:
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,
12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37,
37,38,38,38,39,39,39,39
}
Definition at line 84 of file macroblock.c.
char(* readRefPictureIdx)(SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) [static] |
Function pointer for reading the reference picture indices.
Referenced by prepareListforRefIdx(), and readMBRefPictureIdx().
const byte SCAN_YUV422[8][2] [static] |
Initial value:
{
{0,0},{0,1},
{1,0},{0,2},
{0,3},{1,1},
{1,2},{1,3}
}
Definition at line 111 of file macroblock.c.
Referenced by readCBPandCoeffsFromNAL().
Initial value:
{
{0,0},{1,0},{0,1},{0,2},
{1,1},{2,0},{3,0},{2,1},
{1,2},{0,3},{1,3},{2,2},
{3,1},{3,2},{2,3},{3,3}
}
Definition at line 61 of file macroblock.c.
Referenced by readCBPandCoeffsFromNAL(), readCompCoeff4x4MB_CAVLC(), and readCompCoeff4x4SMB_CABAC().
| const byte SNGL_SCAN8x8[64][2] |
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 94 of file macroblock.c.
Referenced by readCompCoeff8x8_CABAC(), and readCompCoeff8x8MB_CAVLC().
| const unsigned char subblk_offset_x[3][8][4] |
Initial value:
{
{ {0, 4, 0, 4},
{0, 4, 0, 4},
{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, 4, 0, 4},
{0, 4, 0, 4},
{0, 4, 0, 4},
{0, 4, 0, 4},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}, },
{ {0, 4, 0, 4},
{8,12, 8,12},
{0, 4, 0, 4},
{8,12, 8,12},
{0, 4, 0, 4},
{8,12, 8,12},
{0, 4, 0, 4},
{8,12, 8,12} }
}
Definition at line 130 of file macroblock.c.
Referenced by buildPredblockRegionYUV(), buildPredRegionYUV(), intrapred_chroma(), and readCBPandCoeffsFromNAL().
| const unsigned char subblk_offset_y[3][8][4] |
Initial value:
{ { {0, 0, 4, 4},
{0, 0, 4, 4},
{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, 4, 4},
{8, 8,12,12},
{0, 0, 4, 4},
{8, 8,12,12},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0} },
{ {0, 0, 4, 4},
{0, 0, 4, 4},
{8, 8,12,12},
{8, 8,12,12},
{0, 0, 4, 4},
{0, 0, 4, 4},
{8, 8,12,12},
{8, 8,12,12} }
}
Definition at line 160 of file macroblock.c.