FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
h264_ps.c File Reference

H.264 / AVC / MPEG-4 part10 parameter set decoding. More...

#include <inttypes.h>
#include "libavutil/imgutils.h"
#include "internal.h"
#include "mathops.h"
#include "avcodec.h"
#include "h264data.h"
#include "h264_ps.h"
#include "golomb.h"

Go to the source code of this file.

Macros

#define MIN_LOG2_MAX_FRAME_NUM   4
 
#define EXTENDED_SAR   255
 

Functions

static void remove_pps (H264ParamSets *s, int id)
 
static void remove_sps (H264ParamSets *s, int id)
 
static int decode_hrd_parameters (GetBitContext *gb, AVCodecContext *avctx, SPS *sps)
 
static int decode_vui_parameters (GetBitContext *gb, AVCodecContext *avctx, SPS *sps)
 
static int decode_scaling_list (GetBitContext *gb, uint8_t *factors, int size, const uint8_t *jvt_list, const uint8_t *fallback_list)
 
static int decode_scaling_matrices (GetBitContext *gb, const SPS *sps, const PPS *pps, int is_sps, uint8_t(*scaling_matrix4)[16], uint8_t(*scaling_matrix8)[64])
 
void ff_h264_ps_uninit (H264ParamSets *ps)
 Uninit H264 param sets structure. More...
 
int ff_h264_decode_seq_parameter_set (GetBitContext *gb, AVCodecContext *avctx, H264ParamSets *ps, int ignore_truncation)
 Decode SPS. More...
 
static void init_dequant8_coeff_table (PPS *pps, const SPS *sps)
 
static void init_dequant4_coeff_table (PPS *pps, const SPS *sps)
 
static void init_dequant_tables (PPS *pps, const SPS *sps)
 
static void build_qp_table (PPS *pps, int t, int index, const int depth)
 
static int more_rbsp_data_in_pps (const SPS *sps, void *logctx)
 
int ff_h264_decode_picture_parameter_set (GetBitContext *gb, AVCodecContext *avctx, H264ParamSets *ps, int bit_length)
 Decode PPS. More...
 

Variables

static const uint8_t default_scaling4 [2][16]
 
static const uint8_t default_scaling8 [2][64]
 
static const int level_max_dpb_mbs [][2]
 

Detailed Description

H.264 / AVC / MPEG-4 part10 parameter set decoding.

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file h264_ps.c.

Macro Definition Documentation

#define MIN_LOG2_MAX_FRAME_NUM   4

Definition at line 38 of file h264_ps.c.

Referenced by ff_h264_decode_seq_parameter_set().

#define EXTENDED_SAR   255

Definition at line 40 of file h264_ps.c.

Referenced by decode_vui_parameters().

Function Documentation

static void remove_pps ( H264ParamSets s,
int  id 
)
static

Definition at line 88 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set(), and remove_sps().

static void remove_sps ( H264ParamSets s,
int  id 
)
static

Definition at line 93 of file h264_ps.c.

Referenced by ff_h264_decode_seq_parameter_set().

static int decode_hrd_parameters ( GetBitContext gb,
AVCodecContext avctx,
SPS sps 
)
inlinestatic

Definition at line 107 of file h264_ps.c.

Referenced by decode_vui_parameters().

static int decode_vui_parameters ( GetBitContext gb,
AVCodecContext avctx,
SPS sps 
)
inlinestatic

Definition at line 133 of file h264_ps.c.

Referenced by ff_h264_decode_seq_parameter_set().

static int decode_scaling_list ( GetBitContext gb,
uint8_t factors,
int  size,
const uint8_t jvt_list,
const uint8_t fallback_list 
)
static

Definition at line 251 of file h264_ps.c.

Referenced by decode_scaling_matrices().

static int decode_scaling_matrices ( GetBitContext gb,
const SPS sps,
const PPS pps,
int  is_sps,
uint8_t(*)  scaling_matrix4[16],
uint8_t(*)  scaling_matrix8[64] 
)
static
void ff_h264_ps_uninit ( H264ParamSets ps)

Uninit H264 param sets structure.

Definition at line 316 of file h264_ps.c.

Referenced by h264_close(), and h264_decode_end().

int ff_h264_decode_seq_parameter_set ( GetBitContext gb,
AVCodecContext avctx,
H264ParamSets ps,
int  ignore_truncation 
)

Decode SPS.

Definition at line 333 of file h264_ps.c.

Referenced by decode_extradata_ps(), decode_nal_units(), and parse_nal_units().

static void init_dequant8_coeff_table ( PPS pps,
const SPS sps 
)
static

Definition at line 629 of file h264_ps.c.

Referenced by init_dequant_tables().

static void init_dequant4_coeff_table ( PPS pps,
const SPS sps 
)
static

Definition at line 656 of file h264_ps.c.

Referenced by init_dequant_tables().

static void init_dequant_tables ( PPS pps,
const SPS sps 
)
static

Definition at line 682 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set().

static void build_qp_table ( PPS pps,
int  t,
int  index,
const int  depth 
)
static

Definition at line 701 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set().

static int more_rbsp_data_in_pps ( const SPS sps,
void logctx 
)
static

Definition at line 710 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set().

int ff_h264_decode_picture_parameter_set ( GetBitContext gb,
AVCodecContext avctx,
H264ParamSets ps,
int  bit_length 
)

Decode PPS.

Definition at line 724 of file h264_ps.c.

Referenced by decode_extradata_ps(), decode_nal_units(), and parse_nal_units().

Variable Documentation

const uint8_t default_scaling4[2][16]
static
Initial value:
= {
{ 6, 13, 20, 28, 13, 20, 28, 32,
20, 28, 32, 37, 28, 32, 37, 42 },
{ 10, 14, 20, 24, 14, 20, 24, 27,
20, 24, 27, 30, 24, 27, 30, 34 }
}

Definition at line 42 of file h264_ps.c.

Referenced by decode_scaling_matrices().

const uint8_t default_scaling8[2][64]
static
Initial value:
= {
{ 6, 10, 13, 16, 18, 23, 25, 27,
10, 11, 16, 18, 23, 25, 27, 29,
13, 16, 18, 23, 25, 27, 29, 31,
16, 18, 23, 25, 27, 29, 31, 33,
18, 23, 25, 27, 29, 31, 33, 36,
23, 25, 27, 29, 31, 33, 36, 38,
25, 27, 29, 31, 33, 36, 38, 40,
27, 29, 31, 33, 36, 38, 40, 42 },
{ 9, 13, 15, 17, 19, 21, 22, 24,
13, 13, 17, 19, 21, 22, 24, 25,
15, 17, 19, 21, 22, 24, 25, 27,
17, 19, 21, 22, 24, 25, 27, 28,
19, 21, 22, 24, 25, 27, 28, 30,
21, 22, 24, 25, 27, 28, 30, 32,
22, 24, 25, 27, 28, 30, 32, 33,
24, 25, 27, 28, 30, 32, 33, 35 }
}

Definition at line 49 of file h264_ps.c.

Referenced by decode_scaling_matrices().

const int level_max_dpb_mbs[][2]
static
Initial value:
= {
{ 10, 396 },
{ 11, 900 },
{ 12, 2376 },
{ 13, 2376 },
{ 20, 2376 },
{ 21, 4752 },
{ 22, 8100 },
{ 30, 8100 },
{ 31, 18000 },
{ 32, 20480 },
{ 40, 32768 },
{ 41, 32768 },
{ 42, 34816 },
{ 50, 110400 },
{ 51, 184320 },
{ 52, 184320 },
}

Definition at line 69 of file h264_ps.c.

Referenced by ff_h264_decode_seq_parameter_set().