header.c File Reference

H.264 Slice and Sequence headers. More...

#include <math.h>
#include "global.h"
#include "elements.h"
#include "header.h"
#include "rtp.h"
#include "mbuffer.h"
#include "vlc.h"
#include "parset.h"

Include dependency graph for header.c:

Go to the source code of this file.

Defines

#define SYMTRACESTRING(s)

Functions

static int ref_pic_list_reordering (Bitstream *bitstream)
static int pred_weight_table (Bitstream *bitstream)
static int get_picture_type ()
int SliceHeader (Slice *currSlice)
int dec_ref_pic_marking (Bitstream *bitstream, DecRefPicMarking_t *p_drpm, int idr_flag, int no_output_of_prior_pics_flag, int long_term_reference_flag)
int Partition_BC_Header (int PartNo)

Variables

int * assignSE2partition [2]
int assignSE2partition_NoDP [SE_MAX_ELEMENTS]
int assignSE2partition_DP [SE_MAX_ELEMENTS]


Detailed Description

H.264 Slice and Sequence headers.

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

Definition in file header.c.


Function Documentation

int dec_ref_pic_marking ( Bitstream *  bitstream,
DecRefPicMarking_t *  p_drpm,
int  idr_flag,
int  no_output_of_prior_pics_flag,
int  long_term_reference_flag 
)

write the memory management control operations

Returns:
number of bits used

Definition at line 330 of file header.c.

References DecRefPicMarking_s::difference_of_pic_nums_minus1, error(), DecRefPicMarking_s::long_term_frame_idx, DecRefPicMarking_s::long_term_pic_num, DecRefPicMarking_s::max_long_term_frame_idx_plus1, DecRefPicMarking_s::memory_management_control_operation, DecRefPicMarking_s::Next, u_1(), and ue_v().

Referenced by SliceHeader().

Here is the call graph for this function:

static int get_picture_type (  )  [static]

Selects picture type and codes it to symbol.

Returns:
symbol value for picture type

Definition at line 486 of file header.c.

References error(), and ImageParameters::type.

Referenced by SliceHeader().

Here is the call graph for this function:

int Partition_BC_Header ( int  PartNo  ) 

int Partition_BC_Header () write the Partition type B, C header

Returns:
Number of bits used by the partition header
Parameters
PartNo: Partition Number to which the header should be written
Side effects
Partition header as per VCEG-N72r2 is written into the appropriate partition bit buffer
Limitations/Shortcomings/Tweaks
The current code does not support the change of picture parameters within one coded sequence, hence there is only one parameter set necessary. This is hard coded to zero.
Date:
October 24, 2001
Author:
Stephan Wenger stewe@cs.tu-berlin.de

Definition at line 543 of file header.c.

References ImageParameters::current_slice_nr, ImageParameters::currentSlice, syntaxelement::len, syntaxelement::type, syntaxelement::value1, syntaxelement::value2, and writeSE_UVLC().

Referenced by start_slice().

Here is the call graph for this function:

static int pred_weight_table ( Bitstream *  bitstream  )  [static]

write prediction weight table

Returns:
number of bits used

Definition at line 395 of file header.c.

References ImageParameters::bitdepth_chroma, ImageParameters::bitdepth_luma, ImageParameters::num_ref_idx_l0_active, ImageParameters::num_ref_idx_l1_active, se_v(), ImageParameters::type, u_1(), and ue_v().

Referenced by SliceHeader().

Here is the call graph for this function:

static int ref_pic_list_reordering ( Bitstream *  bitstream  )  [static]

int SliceHeader ( Slice *  currSlice  ) 

Write a slice header.

Returns:
number of bits used

img->slice_group_change_cycle can be changed before calling FmoInit()

Definition at line 53 of file header.c.

References ImageParameters::adaptive_ref_pic_buffering_flag, assignSE2partition, datapartition::bitstream, ImageParameters::bottompoc, ImageParameters::colour_plane_id, ImageParameters::current_mb_nr, ImageParameters::current_slice_nr, ImageParameters::currentPicture, dec_ref_pic_marking(), ImageParameters::dec_ref_pic_marking_buffer, ImageParameters::delta_pic_order_always_zero_flag, ImageParameters::delta_pic_order_cnt, ImageParameters::delta_pic_order_cnt_bottom, ImageParameters::DFAlphaC0Offset, ImageParameters::DFBetaOffset, ImageParameters::DFDisableIdc, ImageParameters::direct_spatial_mv_pred_flag, ImageParameters::fld_flag, ImageParameters::frame_num, get_picture_type(), ImageParameters::long_term_reference_flag, ImageParameters::MbaffFrameFlag, ImageParameters::model_number, ImageParameters::nal_reference_idc, ImageParameters::no_output_of_prior_pics_flag, ImageParameters::num_ref_idx_l0_active, ImageParameters::num_ref_idx_l1_active, ImageParameters::number, Slice::partArr, InputParameters::partition_mode, ImageParameters::pic_order_cnt_lsb, ImageParameters::pic_order_cnt_type, ImageParameters::pic_order_present_flag, ImageParameters::PicHeightInMapUnits, ImageParameters::PicWidthInMbs, pred_weight_table(), Slice::qp, ImageParameters::qpsp, ImageParameters::redundant_pic_cnt, ref_pic_list_reordering(), se_v(), ImageParameters::slice_group_change_cycle, ImageParameters::structure, Slice::symbol_mode, ImageParameters::toppoc, ImageParameters::type, u_1(), u_v(), and ue_v().

Referenced by start_slice().

Here is the call graph for this function:


Variable Documentation

lookup-table to assign different elements to partition

Note:
here we defined up to 6 different partitions similar to document Q15-k-18 described in the PROGFRAMEMODE. The Sliceheader contains the PSYNC information.
Elements inside a partition are not ordered. They are ordered by occurence in the stream. Assumption: Only partitionlosses are considered.
The texture elements luminance and chrominance are not ordered in the progressive form This may be changed in image.c
-IMPORTANT: Picture- or Sliceheaders must be assigned to partition 0.
Furthermore partitions must follow syntax dependencies as outlined in document Q15-J-23.

Definition at line 34 of file header.c.

Referenced by end_macroblock(), malloc_slice(), RDCost_for_4x4IntraBlocks(), RDCost_for_8x8blocks(), RDCost_for_8x8IntraBlocks(), SliceHeader(), writeCBPandDquant(), writeChromaCoeff(), writeChromaIntraPredMode(), writeCoeff16x16(), writeCoeff4x4_CABAC(), writeCoeff4x4_CAVLC(), writeCoeff8x8_CABAC(), writeIntra4x4Modes(), writeIntra8x8Modes(), writeMBLayer(), writeMotionVector8x8(), and writeReferenceFrame().

int assignSE2partition_DP[SE_MAX_ELEMENTS]

Initial value:

  
  {  0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 0, 0 }

Definition at line 37 of file header.c.

int assignSE2partition_NoDP[SE_MAX_ELEMENTS]

Initial value:

  {  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }

Definition at line 35 of file header.c.


Documentation generated with DoxyGen