macroblock.h File Reference

Arrays for macroblock processing. More...

#include "block.h"

Include dependency graph for macroblock.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void next_macroblock (ImageParameters *img, Macroblock *currMB)
void start_macroblock (ImageParameters *img, Slice *currSlice, Macroblock **currMB, int mb_addr, byte mb_field)
void reset_macroblock (ImageParameters *img, Macroblock *currMB, int prev_mb)
void end_macroblock (ImageParameters *img, Slice *currSlice, Macroblock *currMB, Boolean *end_of_slice, Boolean *recode_macroblock)
void write_macroblock (ImageParameters *img, Slice *currSlice, Macroblock *currMB, int eos_bit, Boolean prev_recode_mb)
int LumaResidualCoding8x8 (Macroblock *currMB, int *, int64 *, int, short, int, int, short, short, int)
void LumaResidualCoding (Macroblock *currMB, int is_cavlc)
void ChromaResidualCoding (Macroblock *currMB, int is_cavlc)
void IntraChromaPrediction (Macroblock *currMB, int *, int *, int *)
void IntraChromaRDDecision (Macroblock *currMB, RD_PARAMS)
int TransformDecision (Macroblock *currMB, int, int *)
int B8Mode2Value (short b8mode, short b8pdir)
int writeMBLayer (Slice *currSlice, Macroblock *currMB, int rdopt, int *coeff_rate)
void write_terminating_bit (Slice *currSlice, short bit)
int writeReferenceFrame (Slice *currSlice, Macroblock *currMB, int mode, int i, int j, int fwd_flag, int ref)
int writeMotionVector8x8 (Slice *currSlice, Macroblock *currMB, int i0, int j0, int i1, int j1, int refframe, int list_idx, int mv_mode, short bipred_me)
int writeCoeff4x4_CABAC (Slice *currSlice, Macroblock *currMB, ColorPlane, int, int, int)
int writeCoeff8x8_CABAC (Slice *currSlice, Macroblock *currMB, ColorPlane, int, int)
int writeCoeff8x8 (Slice *currSlice, Macroblock *currMB, ColorPlane, int, int, int)
int writeCoeff16x16 (Slice *currSlice, Macroblock *currMB, ColorPlane, int)
int writeCoeff4x4_CAVLC (Slice *currSlice, Macroblock *currMB, int block_type, int b8, int b4, int param)
int distortion_sad (imgpel **img_org, imgpel **pred_img)
int distortion_sse (imgpel **img_org, imgpel **pred_img)
int distortion_hadamard (imgpel **img_org, imgpel **pred_img)
double find_sad_16x16_JM (Macroblock *currMB, int *intra_mode)
void SetLagrangianMultipliersOn ()
void SetLagrangianMultipliersOff ()
int predict_nnz (Macroblock *currMB, int block_type, int i, int j)
int predict_nnz_chroma (Macroblock *currMB, int i, int j)

Variables

double(* find_sad_16x16 )(Macroblock *currMB, int *intra_mode)
void(* SetLagrangianMultipliers )()


Detailed Description

Arrays for macroblock processing.

macroblock.h

Author:
Inge Lille-Langoy <inge.lille-langoy@telenor.com>
Telenor Satellite Services
P.O.Box 6914 St.Olavs plass
N-0130 Oslo, Norway

Definition in file macroblock.h.


Function Documentation

int B8Mode2Value ( short  b8mode,
short  b8pdir 
)

Converts 8x8 block type to coding value.

Definition at line 1678 of file macroblock.c.

References ImageParameters::type.

Referenced by RDCost_for_8x8blocks(), submacroblock_mode_decision_low(), and writeMBLayer().

void ChromaResidualCoding ( Macroblock *  currMB,
int  is_cavlc 
)

void end_macroblock ( ImageParameters *  img,
Slice *  currSlice,
Macroblock *  currMB,
Boolean *  end_of_slice,
Boolean *  recode_macroblock 
)

terminates processing of the current macroblock depending on the chosen slice mode

Check end-of-slice group condition first

Now check maximum # of MBs in slice

Check if the last coded macroblock fits into the size of the slice But only if this is not the first macroblock of this slice

(first MB OR first MB in a slice) AND bigger that maximum size of slice

MB that did not fit in this slice anymore is not a Skip MB

Parameters:
currSlice  Current slice
currMB  Current Macroblock
end_of_slice  returns true for last macroblock of a slice, otherwise false
recode_macroblock  returns true if max. slice size is exceeded an macroblock must be recoded in next slice

Definition at line 579 of file macroblock.c.

References assignSE2partition, macroblock::bitcounter, Bitstream::bits_to_go, Bitstream::bits_to_go_skip, datapartition::bitstream, Bitstream::byte_buf, Bitstream::byte_buf_skip, Bitstream::byte_pos, Bitstream::byte_pos_skip, ImageParameters::cod_counter, ImageParameters::current_slice_nr, datapartition::ee_cabac, datapartition::ee_recode, error(), errortext, ET_SIZE, FmoGetLastCodedMBOfSliceGroup(), FmoMB2SliceGroup(), syntaxelement::len, Slice::max_part_nr, macroblock::mb_nr, Slice::num_mb, Slice::partArr, InputParameters::partition_mode, ImageParameters::PicSizeInMbs, macroblock::PrevMB, InputParameters::slice_argument, InputParameters::slice_mode, macroblock::slice_nr, Slice::slice_too_big, slice_too_big(), Bitstream::stored_bits_to_go, Bitstream::stored_byte_buf, Bitstream::stored_byte_pos, Slice::symbol_mode, syntaxelement::type, syntaxelement::value1, syntaxelement::value2, and writeSE_UVLC().

Referenced by encode_one_slice(), and encode_one_slice_MBAFF().

Here is the call graph for this function:

double find_sad_16x16_JM ( Macroblock *  currMB,
int *  intra_mode 
)

Find best 16x16 based intra mode.

Input:
Image parameters, pointer to best 16x16 intra mode
Output:
best 16x16 based SAD

< pixel position p(0,-1)

< pixel positions p(-1, -1..15)

Definition at line 3761 of file macroblock.c.

References pix_pos::available, InputParameters::Intra16x16ParDisable, InputParameters::Intra16x16PlaneDisable, ImageParameters::intra_block, InputParameters::IntraDisableInterOnly, pix_pos::mb_addr, ImageParameters::mb_size, InputParameters::ModeDecisionMetric, ImageParameters::mpr_16x16, ImageParameters::P444_joined, pCurImg, ImageParameters::type, and InputParameters::UseConstrainedIntraPred.

Referenced by init_rdopt().

void IntraChromaPrediction ( Macroblock *  currMB,
int *  ,
int *  ,
int *   
)

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.

Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().

void IntraChromaRDDecision ( Macroblock *  currMB,
RD_PARAMS   
)

RD Decision for Intra prediction mode of the chrominance layers of one macroblock.

< pixel position p(0,-1)

< pixel positions p(-1, -1..15)

Definition at line 1397 of file macroblock.c.

Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), and encode_one_macroblock_highloss().

void LumaResidualCoding ( Macroblock *  currMB,
int  is_cavlc 
)

int LumaResidualCoding8x8 ( Macroblock *  currMB,
int *  cbp,
int64 *  cbp_blk,
int  block8x8,
short  p_dir,
int  l0_mode,
int  l1_mode,
short  l0_ref_idx,
short  l1_ref_idx,
int  is_cavlc 
)

Residual Coding of an 8x8 Luma block (not for intra).

Returns:
coefficient cost
Parameters:
currMB  Current Macroblock to be coded
cbp  Output: cbp (updated according to processed 8x8 luminance block)
cbp_blk  Output: block cbp (updated according to processed 8x8 luminance block)
block8x8  block number of 8x8 block
p_dir  prediction direction
l0_mode  list0 prediction mode (1-7, 0=DIRECT)
l1_mode  list1 prediction mode (1-7, 0=DIRECT)
l0_ref_idx  reference picture for list0 prediction
l1_ref_idx  reference picture for list0 prediction
is_cavlc  entropy mode?

Definition at line 855 of file macroblock.c.

References _LUMA_COEFF_COST_, macroblock::bipred_me, ChromaPrediction(), ImageParameters::cofAC, copyblock_sp(), storable_picture::imgUV, storable_picture::imgY, ImageParameters::lossless_qpprime_flag, macroblock::luma_transform_size_8x8_flag, LumaPrediction(), ImageParameters::mb_ores, ImageParameters::mb_pred, ImageParameters::NoResidueDirect, ImageParameters::opix_x, ImageParameters::opix_y, ImageParameters::P444_joined, pCurImg, ImageParameters::pix_x, ImageParameters::pix_y, macroblock::qp_scaled, select_plane(), and ImageParameters::type.

Referenced by LumaResidualCoding(), RDCost_for_8x8blocks(), and submacroblock_mode_decision_low().

Here is the call graph for this function:

void next_macroblock ( ImageParameters *  img,
Macroblock *  currMB 
)

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 3081 of file macroblock.c.

References pix_pos::available, ImageParameters::currentPicture, error(), get4x4Neighbour(), ImageParameters::intra_block, pix_pos::mb_addr, ImageParameters::mb_size, ImageParameters::nz_coeff, InputParameters::partition_mode, pix_pos::x, and pix_pos::y.

Referenced by est_RunLevel_CAVLC(), and writeCoeff4x4_CAVLC().

Here is the call graph for this function:

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 3170 of file macroblock.c.

References pix_pos::available, ImageParameters::currentPicture, get4x4Neighbour(), ImageParameters::intra_block, pix_pos::mb_addr, ImageParameters::mb_size, ImageParameters::nz_coeff, InputParameters::partition_mode, pix_pos::x, pix_pos::y, YUV444, and ImageParameters::yuv_format.

Referenced by est_RunLevel_CAVLC(), and writeCoeff4x4_CAVLC().

Here is the call graph for this function:

void reset_macroblock ( ImageParameters *  img,
Macroblock *  currMB,
int  prev_mb 
)

void start_macroblock ( ImageParameters *  img,
Slice *  currSlice,
Macroblock **  currMB,
int  mb_addr,
byte  mb_field 
)

int TransformDecision ( Macroblock *  currMB,
int  ,
int *   
)

Makes the decision if 8x8 tranform will be used (for RD-off).

Definition at line 1229 of file macroblock.c.

References macroblock::bipred_me, distortion4x4(), distortion8x8(), LumaPrediction(), ImageParameters::mb_pred, ImageParameters::opix_x, ImageParameters::opix_y, pCurImg, SetModesAndRefframe(), and InputParameters::Transform8x8Mode.

Referenced by encode_one_macroblock_low().

Here is the call graph for this function:

void write_macroblock ( ImageParameters *  img,
Slice *  currSlice,
Macroblock *  currMB,
int  eos_bit,
Boolean  prev_recode_mb 
)

int writeCoeff16x16 ( Slice *  currSlice,
Macroblock *  currMB,
ColorPlane  ,
int   
)

int writeCoeff4x4_CABAC ( Slice *  currSlice,
Macroblock *  currMB,
ColorPlane  ,
int  ,
int  ,
int   
)

int writeCoeff4x4_CAVLC ( Slice *  currSlice,
Macroblock *  currMB,
int  block_type,
int  b8,
int  b4,
int  param 
)

int writeCoeff8x8 ( Slice *  currSlice,
Macroblock *  currMB,
ColorPlane  ,
int  ,
int  ,
int   
)

Writes Luma Coeff of an 8x8 block.

Definition at line 2753 of file macroblock.c.

References Slice::symbol_mode, writeCoeff4x4_CABAC(), writeCoeff4x4_CAVLC(), and writeCoeff8x8_CABAC().

Referenced by RDCost_for_8x8blocks(), and writeCoeff16x16().

Here is the call graph for this function:

int writeCoeff8x8_CABAC ( Slice *  currSlice,
Macroblock *  currMB,
ColorPlane  ,
int  ,
int   
)

int writeMBLayer ( Slice *  currSlice,
Macroblock *  currMB,
int  rdopt,
int *  coeff_rate 
)

Codes macroblock header.

Parameters:
currSlice current slice
currMB current macroblock
rdopt true for calls during RD-optimization
coeff_rate bitrate of Luma and Chroma coeff

Definition at line 1768 of file macroblock.c.

References arienco_bits_written(), arienco_done_encoding(), arienco_start_encoding(), assignSE2partition, macroblock::b8mode, B8Mode2Value(), macroblock::b8pdir, macroblock::bitcounter, datapartition::bitstream, Bitstream::byte_pos, macroblock::c_ipred_mode, macroblock::cbp, CheckAvailabilityOfNeighborsCABAC(), ImageParameters::cod_counter, ImageParameters::current_mb_nr, datapartition::ee_cabac, field_flag_inference(), FmoGetNextMBNr(), FmoGetPreviousMBNr(), storable_picture::imgUV, storable_picture::imgY, macroblock::IntraChromaPredModeFlag, syntaxelement::len, macroblock::luma_transform_size_8x8_flag, ImageParameters::mb_data, macroblock::mb_field, macroblock::mb_nr, macroblock::mb_type, ImageParameters::mb_x, ImageParameters::mb_y, ImageParameters::MbaffFrameFlag, MBType2Value(), macroblock::NoMbPartLessThan8x8Flag, Slice::partArr, InputParameters::partition_mode, macroblock::PrevMB, reset_mb_nz_coeff(), macroblock::skip_flag, Bitstream::streamBuffer, Slice::symbol_mode, InputParameters::Transform8x8Mode, syntaxelement::type, ImageParameters::type, syntaxelement::value1, syntaxelement::value2, writeCBPandDquant(), writeChromaCoeff(), writeChromaIntraPredMode(), writeCoeff16x16(), writeMB_skip_flagInfo_CABAC(), writeMotionInfo2NAL(), writeSE_Flag(), writeSE_UVLC(), YUV400, and YUV444.

Referenced by RDCost_for_macroblocks(), and write_macroblock().

Here is the call graph for this function:

int writeMotionVector8x8 ( Slice *  currSlice,
Macroblock *  currMB,
int  i0,
int  j0,
int  i1,
int  j1,
int  refframe,
int  list_idx,
int  mv_mode,
short  bipred_me 
)

int writeReferenceFrame ( Slice *  currSlice,
Macroblock *  currMB,
int  mode,
int  i,
int  j,
int  fwd_flag,
int  ref 
)


Documentation generated with DoxyGen