FFmpeg
Macros | Functions | Variables
h264_ps.c File Reference
#include <inttypes.h>
#include "libavutil/imgutils.h"
#include "mathops.h"
#include "avcodec.h"
#include "h264data.h"
#include "h2645_vui.h"
#include "h264_ps.h"
#include "golomb.h"
#include "libavutil/refstruct.h"

Go to the source code of this file.

Macros

#define MIN_LOG2_MAX_FRAME_NUM   4
 

Functions

static void remove_pps (H264ParamSets *s, int id)
 
static void remove_sps (H264ParamSets *s, int id)
 
static int decode_hrd_parameters (GetBitContext *gb, void *logctx, SPS *sps)
 
static int decode_vui_parameters (GetBitContext *gb, void *logctx, SPS *sps)
 
static int decode_scaling_list (GetBitContext *gb, uint8_t *factors, int size, const uint8_t *jvt_list, const uint8_t *fallback_list, uint16_t *mask, int pos)
 
static int decode_scaling_matrices (GetBitContext *gb, const SPS *sps, const PPS *pps, int is_sps, int present_flag, uint16_t *mask, 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)
 
static void pps_free (AVRefStructOpaque unused, void *obj)
 
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

◆ MIN_LOG2_MAX_FRAME_NUM

#define MIN_LOG2_MAX_FRAME_NUM   4

Definition at line 39 of file h264_ps.c.

Function Documentation

◆ remove_pps()

static void remove_pps ( H264ParamSets s,
int  id 
)
static

Definition at line 87 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set(), and remove_sps().

◆ remove_sps()

static void remove_sps ( H264ParamSets s,
int  id 
)
static

Definition at line 92 of file h264_ps.c.

Referenced by ff_h264_decode_seq_parameter_set().

◆ decode_hrd_parameters()

static int decode_hrd_parameters ( GetBitContext gb,
void *  logctx,
SPS sps 
)
inlinestatic

Definition at line 106 of file h264_ps.c.

Referenced by decode_vui_parameters().

◆ decode_vui_parameters()

static int decode_vui_parameters ( GetBitContext gb,
void *  logctx,
SPS sps 
)
inlinestatic

Definition at line 133 of file h264_ps.c.

Referenced by ff_h264_decode_seq_parameter_set().

◆ decode_scaling_list()

static int decode_scaling_list ( GetBitContext gb,
uint8_t *  factors,
int  size,
const uint8_t *  jvt_list,
const uint8_t *  fallback_list,
uint16_t *  mask,
int  pos 
)
static

Definition at line 201 of file h264_ps.c.

Referenced by decode_scaling_matrices().

◆ decode_scaling_matrices()

static int decode_scaling_matrices ( GetBitContext gb,
const SPS sps,
const PPS pps,
int  is_sps,
int  present_flag,
uint16_t *  mask,
uint8_t(*)  scaling_matrix4[16],
uint8_t(*)  scaling_matrix8[64] 
)
static

◆ ff_h264_ps_uninit()

void ff_h264_ps_uninit ( H264ParamSets ps)

Uninit H264 param sets structure.

Definition at line 270 of file h264_ps.c.

Referenced by h264_close(), and h264_decode_end().

◆ ff_h264_decode_seq_parameter_set()

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

Decode SPS.

Definition at line 284 of file h264_ps.c.

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

◆ init_dequant8_coeff_table()

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

Definition at line 594 of file h264_ps.c.

Referenced by init_dequant_tables().

◆ init_dequant4_coeff_table()

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

Definition at line 621 of file h264_ps.c.

Referenced by init_dequant_tables().

◆ init_dequant_tables()

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

Definition at line 647 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set().

◆ build_qp_table()

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

Definition at line 666 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set().

◆ more_rbsp_data_in_pps()

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

Definition at line 675 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set().

◆ pps_free()

static void pps_free ( AVRefStructOpaque  unused,
void *  obj 
)
static

Definition at line 689 of file h264_ps.c.

Referenced by ff_h264_decode_picture_parameter_set().

◆ 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 696 of file h264_ps.c.

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

Variable Documentation

◆ default_scaling4

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 41 of file h264_ps.c.

Referenced by decode_scaling_matrices().

◆ default_scaling8

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 48 of file h264_ps.c.

Referenced by decode_scaling_matrices().

◆ level_max_dpb_mbs

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 68 of file h264_ps.c.

Referenced by ff_h264_decode_seq_parameter_set().