#include "contributors.h"
#include <math.h>
#include "block.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 "transform8x8.h"
#include "transform.h"
#include "mc_prediction.h"
#include "quant.h"
#include "intra4x4_pred.h"
#include "intra8x8_pred.h"
#include "intra16x16_pred.h"
#include "mv_prediction.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 | read_motion_info_from_NAL_p_slice (Macroblock *currMB) |
static void | read_motion_info_from_NAL_b_slice (Macroblock *currMB) |
static void | read_ipred_modes (Macroblock *currMB) |
static void | read_CBP_and_coeffs_from_NAL_CABAC (Macroblock *currMB) |
static void | read_CBP_and_coeffs_from_NAL_CAVLC (Macroblock *currMB) |
static void | read_IPCM_coeffs_from_NAL (Slice *currSlice, struct datapartition *dP) |
static void | read_one_macroblock_i_slice (Macroblock *currMB) |
static void | read_one_macroblock_p_slice (Macroblock *currMB) |
static void | read_one_macroblock_b_slice (Macroblock *currMB) |
static int | decode_one_component_i_slice (Macroblock *currMB, ColorPlane curr_plane, imgpel **currImg, StorablePicture *dec_picture, MotionParams *colocated, int list_offset) |
static int | decode_one_component_p_slice (Macroblock *currMB, ColorPlane curr_plane, imgpel **currImg, StorablePicture *dec_picture, MotionParams *colocated, int list_offset) |
static int | decode_one_component_b_slice (Macroblock *currMB, ColorPlane curr_plane, imgpel **currImg, StorablePicture *dec_picture, MotionParams *colocated, int list_offset) |
static int | BType2CtxRef (int btype) |
static char | readRefPictureIdx_VLC (Macroblock *currMB, SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) |
static char | readRefPictureIdx_FLC (Macroblock *currMB, SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) |
static char | readRefPictureIdx_Null (Macroblock *currMB, SyntaxElement *currSE, DataPartition *dP, char b8mode, int list) |
static void | prepareListforRefIdx (Macroblock *currMB, SyntaxElement *currSE, DataPartition *dP, int num_ref_idx_active, int refidx_present) |
void | set_chroma_qp (Macroblock *currMB) |
void | update_qp (Macroblock *currMB, int qp) |
static void | read_delta_quant (SyntaxElement *currSE, DataPartition *dP, Macroblock *currMB, const byte *partMap, int type) |
static void | readMBRefPictureIdx (SyntaxElement *currSE, DataPartition *dP, Macroblock *currMB, char **cur_ref_idx, int list, int step_v0, int step_h0) |
static void | readMBMotionVectors (SyntaxElement *currSE, DataPartition *dP, Macroblock *currMB, int list, int step_h0, int step_v0) |
void | invScaleCoeff (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 (Slice *currSlice, Macroblock **currMB) |
Boolean | exit_macroblock (Slice *currSlice, 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 | setup_slice_methods (Slice *currSlice) |
static void | init_macroblock (Macroblock *currMB) |
void | SetB8Mode (Macroblock *currMB, int value, int i) |
void | reset_coeffs (Slice *currSlice) |
void | field_flag_inference (Macroblock *currMB) |
void | skip_macroblock (Macroblock *currMB) |
static void | concealIPCMcoeffs (Macroblock *currMB) |
static void | init_decoding_engine_IPCM (Slice *currSlice) |
void | get_neighbors (Macroblock *currMB, PixelPos *block, int mb_x, int mb_y, int blockshape_x) |
int | predict_nnz (Macroblock *currMB, int block_type, int i, int j) |
int | predict_nnz_chroma (Macroblock *currMB, int i, int j) |
static void | readCoeff4x4_CAVLC (Macroblock *currMB, int block_type, int i, int j, int levarr[16], int runarr[16], int *number_coefficients) |
static void | readCompCoeff4x4SMB_CABAC (Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl, int block_y, int block_x, int start_scan, int64 *cbp_blk) |
static void | readCompCoeff4x4MB_CABAC (Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl, int intra, int(*InvLevelScale4x4)[4], int qp_per, int cbp) |
static void | readCompCoeff8x8_CABAC (Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl, int b8) |
static void | readCompCoeff8x8MB_CABAC (Macroblock *currMB, SyntaxElement *currSE, ColorPlane pl) |
static void | readCompCoeff4x4MB_CAVLC (Macroblock *currMB, ColorPlane pl, int(*InvLevelScale4x4)[4], int qp_per, int cbp, byte **nzcoeff) |
static void | readCompCoeff8x8MB_CAVLC (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 (Macroblock *currMB) |
int | decode_one_macroblock (Macroblock *currMB, StorablePicture *dec_picture) |
void | change_plane_JV (ImageParameters *p_Img, int nplane) |
void | make_frame_picture_JV (ImageParameters *p_Img) |
Definition in file macroblock.c.
static int BType2CtxRef | ( | int | btype | ) | [inline, static] |
Set context for reference frames.
Definition at line 83 of file macroblock.c.
Referenced by readRefPictureIdx_FLC(), and readRefPictureIdx_VLC().
void change_plane_JV | ( | ImageParameters * | p_Img, | |
int | nplane | |||
) |
change target plane for 4:4:4 Independent mode
Definition at line 5610 of file macroblock.c.
References slice::Co_located_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 3527 of file macroblock.c.
References macroblock::dpl_flag, and macroblock::p_Img.
Referenced by read_CBP_and_coeffs_from_NAL_CABAC(), and read_CBP_and_coeffs_from_NAL_CAVLC().
void decode_ipcm_mb | ( | 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 4774 of file macroblock.c.
References storable_picture::imgUV, storable_picture::imgY, macroblock::mbAddrX, macroblock::p_Img, macroblock::p_Slice, update_qp(), and YUV400.
Referenced by decode_one_macroblock().
static int decode_one_component_b_slice | ( | Macroblock * | currMB, | |
ColorPlane | curr_plane, | |||
imgpel ** | currImg, | |||
StorablePicture * | dec_picture, | |||
MotionParams * | colocated, | |||
int | list_offset | |||
) | [static] |
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 5104 of file macroblock.c.
References copy_image_data_4x4(), copy_image_data_8x8(), slice::direct_spatial_mv_pred_flag, error(), intrapred(), intrapred16x16(), intrapred8x8(), Inv_Residual_trans_4x4(), Inv_Residual_trans_8x8(), itrans4x4(), itrans8x8(), storable_picture::motion, motion_params::mv, pic_motion_params::mv, slice::num_ref_idx_l0_active, macroblock::p_Img, macroblock::p_Slice, motion_params::ref_idx, pic_motion_params::ref_idx, motion_params::ref_pic_id, pic_motion_params::ref_pic_id, slice::slice_type, YUV400, and YUV444.
Referenced by setup_slice_methods().
static int decode_one_component_i_slice | ( | Macroblock * | currMB, | |
ColorPlane | curr_plane, | |||
imgpel ** | currImg, | |||
StorablePicture * | dec_picture, | |||
MotionParams * | colocated, | |||
int | list_offset | |||
) | [static] |
decode one color component
Definition at line 4831 of file macroblock.c.
References copy_image_data_4x4(), copy_image_data_8x8(), intrapred(), intrapred16x16(), intrapred8x8(), Inv_Residual_trans_4x4(), Inv_Residual_trans_8x8(), itrans4x4(), itrans8x8(), macroblock::p_Img, macroblock::p_Slice, slice::slice_type, YUV400, and YUV444.
Referenced by setup_slice_methods().
static int decode_one_component_p_slice | ( | Macroblock * | currMB, | |
ColorPlane | curr_plane, | |||
imgpel ** | currImg, | |||
StorablePicture * | dec_picture, | |||
MotionParams * | colocated, | |||
int | list_offset | |||
) | [static] |
decode one color component. We should actually break these into "mode" related functions instead of slice
Definition at line 4933 of file macroblock.c.
References copy_image_data(), copy_image_data_16x16(), copy_image_data_4x4(), copy_image_data_8x8(), storable_picture::imgUV, intrapred(), intrapred16x16(), intrapred8x8(), Inv_Residual_trans_4x4(), Inv_Residual_trans_8x8(), itrans4x4(), itrans8x8(), macroblock::p_Img, macroblock::p_Slice, slice::slice_type, YUV400, and YUV444.
Referenced by setup_slice_methods().
int decode_one_macroblock | ( | Macroblock * | currMB, | |
StorablePicture * | dec_picture | |||
) |
decode one macroblock
Definition at line 5481 of file macroblock.c.
References decode_ipcm_mb(), storable_picture::imgUV, storable_picture::imgY, macroblock::mbAddrX, macroblock::p_Img, macroblock::p_Slice, and YUV444.
Referenced by decode_one_slice().
void dectracebitcnt | ( | int | count | ) |
look up tables for FRExt_chroma support
set coordinates of the next macroblock check end_of_slice condition
The if() statement below resembles the original code, which tested
p_Img->current_mb_nr == p_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 456 of file macroblock.c.
References FmoGetNextMBNr(), and slice::slice_type.
Referenced by decode_one_slice().
void get_neighbors | ( | Macroblock * | currMB, | |
PixelPos * | block, | |||
int | mb_x, | |||
int | mb_y, | |||
int | blockshape_x | |||
) |
Get current block spatial neighbors.
Definition at line 2069 of file macroblock.c.
References get4x4Neighbour(), and macroblock::p_Img.
Referenced by readMBMotionVectors().
static void init_decoding_engine_IPCM | ( | Slice * | currSlice | ) | [static] |
Initialize decoding engine after decoding an IPCM macroblock (for IPCM CABAC 28/11/2003).
Definition at line 1826 of file macroblock.c.
References arideco_start_decoding(), slice::dp_mode, PAR_DP_1, PAR_DP_3, slice::partArr, Bitstream::read_len, and Bitstream::streamBuffer.
Referenced by read_IPCM_coeffs_from_NAL().
static void init_macroblock | ( | Macroblock * | currMB | ) | [static] |
init macroblock I and P frames
Definition at line 770 of file macroblock.c.
References storable_picture::motion, pic_motion_params::mv, macroblock::p_Img, pic_motion_params::ref_idx, and pic_motion_params::ref_pic_id.
Referenced by read_one_macroblock_b_slice(), read_one_macroblock_i_slice(), and read_one_macroblock_p_slice().
static void interpret_mb_mode_B | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for B-Frames.
Definition at line 592 of file macroblock.c.
Referenced by setup_slice_methods().
static void interpret_mb_mode_I | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for I-Frames.
Definition at line 556 of file macroblock.c.
Referenced by setup_slice_methods().
static void interpret_mb_mode_P | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for P-Frames.
Definition at line 501 of file macroblock.c.
References macroblock::p_Img.
Referenced by setup_slice_methods().
static void interpret_mb_mode_SI | ( | Macroblock * | currMB | ) | [static] |
Interpret the mb mode for SI-Frames.
Definition at line 673 of file macroblock.c.
References macroblock::p_Img.
Referenced by setup_slice_methods().
void make_frame_picture_JV | ( | ImageParameters * | p_Img | ) |
make frame picture from each plane data for 4:4:4 Independent mode
Definition at line 5626 of file macroblock.c.
References free_storable_picture().
Referenced by exit_picture().
int predict_nnz | ( | Macroblock * | currMB, | |
int | block_type, | |||
int | i, | |||
int | j | |||
) |
Get the Prediction from the Neighboring Blocks for Number of Nonzero Coefficients.
Luma Blocks
Definition at line 2440 of file macroblock.c.
References error(), get4x4Neighbour(), macroblock::p_Img, and PAR_DP_3.
Referenced by readCoeff4x4_CAVLC().
int predict_nnz_chroma | ( | Macroblock * | currMB, | |
int | i, | |||
int | j | |||
) |
Get the Prediction from the Neighboring Blocks for Number of Nonzero Coefficients.
Chroma Blocks
Definition at line 2532 of file macroblock.c.
References get4x4Neighbour(), macroblock::p_Img, PAR_DP_3, and YUV444.
Referenced by readCoeff4x4_CAVLC().
static void prepareListforRefIdx | ( | Macroblock * | currMB, | |
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 146 of file macroblock.c.
References Bitstream::ei_flag, linfo_ue(), syntaxelement::mapping, macroblock::p_Img, syntaxelement::reading, readRefFrame_CABAC(), readRefPictureIdx_FLC(), readRefPictureIdx_Null(), and readRefPictureIdx_VLC().
Referenced by read_motion_info_from_NAL_b_slice(), and read_motion_info_from_NAL_p_slice().
static void read_CBP_and_coeffs_from_NAL_CABAC | ( | Macroblock * | currMB | ) | [static] |
Get coded block pattern and coefficients (run/level) from the NAL.
Definition at line 3556 of file macroblock.c.
References assignSE2partition, check_dp_neighbors(), syntaxelement::context, slice::dp_mode, slice::dpB_NotPresent, slice::dpC_NotPresent, macroblock::dpl_flag, macroblock::ei_flag, Bitstream::ei_flag, FIELD_SCAN, itrans_2(), syntaxelement::len, linfo_levrun_c2x2(), linfo_levrun_inter(), syntaxelement::mapping, macroblock::p_Img, macroblock::p_Slice, slice::partArr, macroblock::qp, macroblock::qp_scaled, macroblock::qpc, readCBP_CABAC(), readCompCoeff4x4MB_CABAC(), readCompCoeff8x8MB_CABAC(), syntaxelement::reading, readMB_transform_size_flag_CABAC(), readRunLevel_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_FLC(), SCAN_YUV422, SE_HEADER, slice::slice_type, SNGL_SCAN, subblk_offset_x, syntaxelement::type, update_qp(), syntaxelement::value1, syntaxelement::value2, YUV400, YUV420, YUV422, and YUV444.
Referenced by setup_slice_methods().
static void read_CBP_and_coeffs_from_NAL_CAVLC | ( | Macroblock * | currMB | ) | [static] |
Get coded block pattern and coefficients (run/level) from the NAL.
Definition at line 4204 of file macroblock.c.
References assignSE2partition, check_dp_neighbors(), syntaxelement::context, slice::dp_mode, slice::dpB_NotPresent, slice::dpC_NotPresent, macroblock::dpl_flag, Bitstream::ei_flag, macroblock::ei_flag, FIELD_SCAN, itrans_2(), syntaxelement::len, linfo_levrun_inter(), syntaxelement::mapping, macroblock::mbAddrX, macroblock::p_Img, macroblock::p_Slice, slice::partArr, macroblock::qp, macroblock::qp_scaled, macroblock::qpc, readCoeff4x4_CAVLC(), readCompCoeff4x4MB_CAVLC(), readCompCoeff8x8MB_CAVLC(), syntaxelement::reading, readMB_transform_size_flag_CABAC(), readRunLevel_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_FLC(), SCAN_YUV422, SE_HEADER, slice::slice_type, SNGL_SCAN, subblk_offset_x, syntaxelement::type, update_qp(), syntaxelement::value1, syntaxelement::value2, YUV400, YUV420, YUV422, and YUV444.
Referenced by setup_slice_methods().
static void read_IPCM_coeffs_from_NAL | ( | Slice * | currSlice, | |
struct datapartition * | dP | |||
) | [static] |
Read IPCM pcm_alignment_zero_bit and pcm_byte[i] from stream to currSlice->cof (for IPCM CABAC and IPCM CAVLC).
Definition at line 1866 of file macroblock.c.
References Bitstream::frame_bitoffset, init_decoding_engine_IPCM(), syntaxelement::len, readIPCM_CABAC(), readSyntaxElement_FLC(), syntaxelement::value1, and YUV400.
Referenced by read_one_macroblock_b_slice(), read_one_macroblock_i_slice(), and read_one_macroblock_p_slice().
static void read_ipred_modes | ( | Macroblock * | currMB | ) | [static] |
If data partition B is lost, conceal PCM sample values with DC.
Definition at line 1942 of file macroblock.c.
References assignSE2partition, macroblock::c_ipred_mode, syntaxelement::context, slice::dp_mode, Bitstream::ei_flag, error(), get4x4Neighbour(), linfo_ue(), syntaxelement::mapping, macroblock::p_Img, macroblock::p_Slice, slice::partArr, readCIPredMode_CABAC(), syntaxelement::reading, readIntraPredMode_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_Intra4x4PredictionMode(), slice::slice_type, syntaxelement::type, syntaxelement::value1, YUV400, and YUV444.
Referenced by read_one_macroblock_b_slice(), read_one_macroblock_i_slice(), and read_one_macroblock_p_slice().
static void read_motion_info_from_NAL_b_slice | ( | 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 2177 of file macroblock.c.
References assignSE2partition, BLOCK_STEP, slice::direct_spatial_mv_pred_flag, slice::dp_mode, Bitstream::ei_flag, error(), linfo_se(), syntaxelement::mapping, macroblock::mbAddrX, storable_picture::motion, motion_params::mv, pic_motion_params::mv, slice::num_ref_idx_l0_active, slice::num_ref_idx_l1_active, macroblock::p_Img, macroblock::p_Slice, 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, and syntaxelement::type.
Referenced by setup_slice_methods().
static void read_motion_info_from_NAL_p_slice | ( | Macroblock * | currMB | ) | [static] |
Read motion info.
Definition at line 2116 of file macroblock.c.
References assignSE2partition, BLOCK_STEP, slice::dp_mode, Bitstream::ei_flag, linfo_se(), syntaxelement::mapping, macroblock::mbAddrX, storable_picture::motion, slice::num_ref_idx_l0_active, slice::num_ref_idx_l1_active, macroblock::p_Img, macroblock::p_Slice, slice::partArr, prepareListforRefIdx(), syntaxelement::reading, readMBMotionVectors(), readMBRefPictureIdx(), readMVD_CABAC(), pic_motion_params::ref_idx, pic_motion_params::ref_pic_id, and syntaxelement::type.
Referenced by setup_slice_methods().
static void read_one_macroblock_b_slice | ( | Macroblock * | currMB | ) | [static] |
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 1483 of file macroblock.c.
References assignSE2partition, slice::dp_mode, slice::dpB_NotPresent, macroblock::ei_flag, Bitstream::ei_flag, Bitstream::frame_bitoffset, init_macroblock(), syntaxelement::len, linfo_ue(), syntaxelement::mapping, pic_motion_params::mb_field, mb_is_available(), macroblock::mbAddrX, storable_picture::motion, slice::num_ref_idx_l0_active, slice::num_ref_idx_l1_active, macroblock::p_Img, macroblock::p_Slice, slice::partArr, macroblock::qp, read_IPCM_coeffs_from_NAL(), read_ipred_modes(), readB8_typeInfo_CABAC(), syntaxelement::reading, readMB_skip_flagInfo_CABAC(), readMB_transform_size_flag_CABAC(), readMB_typeInfo_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_FLC(), SE_HEADER, SetB8Mode(), slice::slice_type, syntaxelement::type, update_qp(), syntaxelement::value1, and syntaxelement::value2.
Referenced by setup_slice_methods().
static void read_one_macroblock_i_slice | ( | Macroblock * | currMB | ) | [static] |
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 1002 of file macroblock.c.
References assignSE2partition, slice::dp_mode, slice::dpB_NotPresent, macroblock::ei_flag, Bitstream::ei_flag, init_macroblock(), syntaxelement::len, linfo_ue(), syntaxelement::mapping, pic_motion_params::mb_field, macroblock::mbAddrX, storable_picture::motion, macroblock::p_Img, macroblock::p_Slice, slice::partArr, macroblock::qp, read_IPCM_coeffs_from_NAL(), read_ipred_modes(), syntaxelement::reading, readMB_transform_size_flag_CABAC(), readMB_typeInfo_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_FLC(), SE_HEADER, syntaxelement::type, update_qp(), and syntaxelement::value1.
Referenced by setup_slice_methods().
static void read_one_macroblock_p_slice | ( | Macroblock * | currMB | ) | [static] |
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 1157 of file macroblock.c.
References assignSE2partition, slice::dp_mode, slice::dpB_NotPresent, macroblock::ei_flag, Bitstream::ei_flag, Bitstream::frame_bitoffset, init_macroblock(), syntaxelement::len, linfo_ue(), syntaxelement::mapping, pic_motion_params::mb_field, mb_is_available(), macroblock::mbAddrX, storable_picture::motion, slice::num_ref_idx_l0_active, slice::num_ref_idx_l1_active, macroblock::p_Img, macroblock::p_Slice, slice::partArr, macroblock::qp, read_IPCM_coeffs_from_NAL(), read_ipred_modes(), readB8_typeInfo_CABAC(), syntaxelement::reading, readMB_skip_flagInfo_CABAC(), readMB_transform_size_flag_CABAC(), readMB_typeInfo_CABAC(), datapartition::readSyntaxElement, readSyntaxElement_FLC(), SE_HEADER, SetB8Mode(), slice::slice_type, syntaxelement::type, update_qp(), and syntaxelement::value1.
Referenced by setup_slice_methods().
static void readCoeff4x4_CAVLC | ( | Macroblock * | currMB, | |
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 2597 of file macroblock.c.
References assignSE2partition, slice::dp_mode, error(), syntaxelement::inf, syntaxelement::len, macroblock::mbAddrX, macroblock::p_Img, macroblock::p_Slice, 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 read_CBP_and_coeffs_from_NAL_CAVLC(), readCompCoeff4x4MB_CAVLC(), and readCompCoeff8x8MB_CAVLC().
static void readCompCoeff4x4MB_CABAC | ( | 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 2991 of file macroblock.c.
References syntaxelement::context, macroblock::p_Img, macroblock::p_Slice, and readCompCoeff4x4SMB_CABAC().
Referenced by read_CBP_and_coeffs_from_NAL_CABAC().
static void readCompCoeff4x4MB_CAVLC | ( | 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 3249 of file macroblock.c.
References FIELD_SCAN, macroblock::p_Img, macroblock::p_Slice, readCoeff4x4_CAVLC(), and SNGL_SCAN.
Referenced by read_CBP_and_coeffs_from_NAL_CAVLC().
static void readCompCoeff4x4SMB_CABAC | ( | 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 2879 of file macroblock.c.
References assignSE2partition, slice::dp_mode, Bitstream::ei_flag, FIELD_SCAN, linfo_levrun_inter(), syntaxelement::mapping, macroblock::p_Img, macroblock::p_Slice, 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 | ( | 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 3071 of file macroblock.c.
References assignSE2partition, syntaxelement::context, slice::dp_mode, FIELD_SCAN8x8, macroblock::p_Img, macroblock::p_Slice, 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 | ( | 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 3233 of file macroblock.c.
References readCompCoeff8x8_CABAC().
Referenced by read_CBP_and_coeffs_from_NAL_CABAC().
static void readCompCoeff8x8MB_CAVLC | ( | 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 3383 of file macroblock.c.
References FIELD_SCAN8x8, macroblock::p_Img, macroblock::p_Slice, readCoeff4x4_CAVLC(), and SNGL_SCAN8x8.
Referenced by read_CBP_and_coeffs_from_NAL_CAVLC().
static void readMBMotionVectors | ( | SyntaxElement * | currSE, | |
DataPartition * | dP, | |||
Macroblock * | currMB, | |||
int | list, | |||
int | step_h0, | |||
int | step_v0 | |||
) | [inline, static] |
Function to read reference picture indice values.
Definition at line 263 of file macroblock.c.
References BLOCK_STEP, get_neighbors(), storable_picture::motion, pic_motion_params::mv, macroblock::mvd, macroblock::p_Img, datapartition::readSyntaxElement, pic_motion_params::ref_idx, syntaxelement::value1, and syntaxelement::value2.
Referenced by read_motion_info_from_NAL_b_slice(), and read_motion_info_from_NAL_p_slice().
static void readMBRefPictureIdx | ( | SyntaxElement * | currSE, | |
DataPartition * | dP, | |||
Macroblock * | currMB, | |||
char ** | cur_ref_idx, | |||
int | list, | |||
int | step_v0, | |||
int | step_h0 | |||
) | [static] |
Function to read reference picture indice values.
Definition at line 233 of file macroblock.c.
Referenced by read_motion_info_from_NAL_b_slice(), and read_motion_info_from_NAL_p_slice().
static char readRefPictureIdx_FLC | ( | Macroblock * | currMB, | |
SyntaxElement * | currSE, | |||
DataPartition * | dP, | |||
char | b8mode, | |||
int | list | |||
) | [static] |
Function for reading the reference picture indices using FLC.
Definition at line 113 of file macroblock.c.
References BType2CtxRef(), syntaxelement::context, syntaxelement::len, readSyntaxElement_FLC(), and syntaxelement::value1.
Referenced by prepareListforRefIdx().
static char readRefPictureIdx_Null | ( | Macroblock * | currMB, | |
SyntaxElement * | currSE, | |||
DataPartition * | dP, | |||
char | b8mode, | |||
int | list | |||
) | [static] |
Dummy Function for reading the reference picture indices.
Definition at line 135 of file macroblock.c.
Referenced by prepareListforRefIdx().
static char readRefPictureIdx_VLC | ( | Macroblock * | currMB, | |
SyntaxElement * | currSE, | |||
DataPartition * | dP, | |||
char | b8mode, | |||
int | list | |||
) | [static] |
Function for reading the reference picture indices using VLC.
Definition at line 94 of file macroblock.c.
References BType2CtxRef(), syntaxelement::context, macroblock::p_Img, datapartition::readSyntaxElement, syntaxelement::value1, and syntaxelement::value2.
Referenced by prepareListforRefIdx().
void SetB8Mode | ( | Macroblock * | currMB, | |
int | value, | |||
int | i | |||
) |
Sets mode for 8x8 block.
Definition at line 809 of file macroblock.c.
References macroblock::p_Slice, and slice::slice_type.
Referenced by read_one_macroblock_b_slice(), and read_one_macroblock_p_slice().
void setup_slice_methods | ( | Slice * | currSlice | ) |
Set mode interpretation based on slice type.
Definition at line 717 of file macroblock.c.
References decode_one_component_b_slice(), decode_one_component_i_slice(), decode_one_component_p_slice(), interpret_mb_mode_B(), interpret_mb_mode_I(), interpret_mb_mode_P(), interpret_mb_mode_SI(), read_CBP_and_coeffs_from_NAL_CABAC(), read_CBP_and_coeffs_from_NAL_CAVLC(), read_motion_info_from_NAL_b_slice(), read_motion_info_from_NAL_p_slice(), read_one_macroblock_b_slice(), read_one_macroblock_i_slice(), read_one_macroblock_p_slice(), and slice::slice_type.
Referenced by decode_one_slice().
void start_macroblock | ( | Slice * | currSlice, | |
Macroblock ** | currMB | |||
) |
initializes the current macroblock
Definition at line 368 of file macroblock.c.
References CheckAvailabilityOfNeighbors(), slice::DFAlphaC0Offset, slice::DFBetaOffset, slice::DFDisableIdc, error(), macroblock::p_Img, macroblock::qp, storable_picture::slice_id, slice::slice_type, and update_qp().
Referenced by decode_one_slice().
void update_qp | ( | Macroblock * | currMB, | |
int | qp | |||
) |
updates chroma QP according to luma QP and bit depth
Definition at line 190 of file macroblock.c.
References macroblock::p_Img, macroblock::qp, and macroblock::qp_scaled.
Referenced by decode_ipcm_mb(), read_CBP_and_coeffs_from_NAL_CABAC(), read_CBP_and_coeffs_from_NAL_CAVLC(), read_one_macroblock_b_slice(), read_one_macroblock_i_slice(), read_one_macroblock_p_slice(), and start_macroblock().