FFmpeg
Macros | Functions | Variables
hevc_ps.c File Reference
#include "libavutil/imgutils.h"
#include "golomb.h"
#include "hevc_data.h"
#include "hevc_ps.h"

Go to the source code of this file.

Macros

#define check_profile_idc(idc)   ptl->profile_idc == idc || ptl->profile_compatibility_flag[idc]
 

Functions

static void remove_pps (HEVCParamSets *s, int id)
 
static void remove_sps (HEVCParamSets *s, int id)
 
static void remove_vps (HEVCParamSets *s, int id)
 
int ff_hevc_decode_short_term_rps (GetBitContext *gb, AVCodecContext *avctx, ShortTermRPS *rps, const HEVCSPS *sps, int is_slice_header)
 
static int decode_profile_tier_level (GetBitContext *gb, AVCodecContext *avctx, PTLCommon *ptl)
 
static int parse_ptl (GetBitContext *gb, AVCodecContext *avctx, PTL *ptl, int max_num_sub_layers)
 
static void decode_sublayer_hrd (GetBitContext *gb, unsigned int nb_cpb, int subpic_params_present)
 
static int decode_hrd (GetBitContext *gb, int common_inf_present, int max_sublayers)
 
int ff_hevc_decode_nal_vps (GetBitContext *gb, AVCodecContext *avctx, HEVCParamSets *ps)
 
static void decode_vui (GetBitContext *gb, AVCodecContext *avctx, int apply_defdispwin, HEVCSPS *sps)
 
static void set_default_scaling_list_data (ScalingList *sl)
 
static int scaling_list_data (GetBitContext *gb, AVCodecContext *avctx, ScalingList *sl, HEVCSPS *sps)
 
static int map_pixel_format (AVCodecContext *avctx, HEVCSPS *sps)
 
int ff_hevc_parse_sps (HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, int apply_defdispwin, AVBufferRef **vps_list, AVCodecContext *avctx)
 Parse the SPS from the bitstream into the provided HEVCSPS struct. More...
 
int ff_hevc_decode_nal_sps (GetBitContext *gb, AVCodecContext *avctx, HEVCParamSets *ps, int apply_defdispwin)
 
static void hevc_pps_free (void *opaque, uint8_t *data)
 
static int pps_range_extensions (GetBitContext *gb, AVCodecContext *avctx, HEVCPPS *pps, HEVCSPS *sps)
 
static int setup_pps (AVCodecContext *avctx, GetBitContext *gb, HEVCPPS *pps, HEVCSPS *sps)
 
int ff_hevc_decode_nal_pps (GetBitContext *gb, AVCodecContext *avctx, HEVCParamSets *ps)
 
void ff_hevc_ps_uninit (HEVCParamSets *ps)
 
int ff_hevc_compute_poc (const HEVCSPS *sps, int pocTid0, int poc_lsb, int nal_unit_type)
 Compute POC of the current frame and return it. More...
 

Variables

static const uint8_t default_scaling_list_intra []
 
static const uint8_t default_scaling_list_inter []
 
static const AVRational vui_sar []
 
static const uint8_t hevc_sub_width_c []
 
static const uint8_t hevc_sub_height_c []
 

Macro Definition Documentation

◆ check_profile_idc

#define check_profile_idc (   idc)    ptl->profile_idc == idc || ptl->profile_compatibility_flag[idc]

Function Documentation

◆ remove_pps()

static void remove_pps ( HEVCParamSets s,
int  id 
)
static

Definition at line 81 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_pps(), and remove_sps().

◆ remove_sps()

static void remove_sps ( HEVCParamSets s,
int  id 
)
static

Definition at line 88 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_sps(), and remove_vps().

◆ remove_vps()

static void remove_vps ( HEVCParamSets s,
int  id 
)
static

Definition at line 105 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_vps().

◆ ff_hevc_decode_short_term_rps()

int ff_hevc_decode_short_term_rps ( GetBitContext gb,
AVCodecContext avctx,
ShortTermRPS rps,
const HEVCSPS sps,
int  is_slice_header 
)

Definition at line 119 of file hevc_ps.c.

Referenced by ff_hevc_parse_sps(), and hls_slice_header().

◆ decode_profile_tier_level()

static int decode_profile_tier_level ( GetBitContext gb,
AVCodecContext avctx,
PTLCommon ptl 
)
static

Definition at line 265 of file hevc_ps.c.

Referenced by parse_ptl().

◆ parse_ptl()

static int parse_ptl ( GetBitContext gb,
AVCodecContext avctx,
PTL ptl,
int  max_num_sub_layers 
)
static

Definition at line 339 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_vps(), and ff_hevc_parse_sps().

◆ decode_sublayer_hrd()

static void decode_sublayer_hrd ( GetBitContext gb,
unsigned int  nb_cpb,
int  subpic_params_present 
)
static

Definition at line 379 of file hevc_ps.c.

Referenced by decode_hrd().

◆ decode_hrd()

static int decode_hrd ( GetBitContext gb,
int  common_inf_present,
int  max_sublayers 
)
static

Definition at line 396 of file hevc_ps.c.

Referenced by decode_vui(), and ff_hevc_decode_nal_vps().

◆ ff_hevc_decode_nal_vps()

int ff_hevc_decode_nal_vps ( GetBitContext gb,
AVCodecContext avctx,
HEVCParamSets ps 
)

Definition at line 458 of file hevc_ps.c.

Referenced by decode_nal_unit(), hevc_decode_nal_units(), and parse_nal_units().

◆ decode_vui()

static void decode_vui ( GetBitContext gb,
AVCodecContext avctx,
int  apply_defdispwin,
HEVCSPS sps 
)
static

Definition at line 588 of file hevc_ps.c.

Referenced by ff_hevc_parse_sps().

◆ set_default_scaling_list_data()

static void set_default_scaling_list_data ( ScalingList sl)
static

Definition at line 753 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_pps(), and ff_hevc_parse_sps().

◆ scaling_list_data()

static int scaling_list_data ( GetBitContext gb,
AVCodecContext avctx,
ScalingList sl,
HEVCSPS sps 
)
static

Definition at line 783 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_pps(), and ff_hevc_parse_sps().

◆ map_pixel_format()

static int map_pixel_format ( AVCodecContext avctx,
HEVCSPS sps 
)
static

Definition at line 859 of file hevc_ps.c.

Referenced by ff_hevc_parse_sps().

◆ ff_hevc_parse_sps()

int ff_hevc_parse_sps ( HEVCSPS sps,
GetBitContext gb,
unsigned int sps_id,
int  apply_defdispwin,
AVBufferRef **  vps_list,
AVCodecContext avctx 
)

Parse the SPS from the bitstream into the provided HEVCSPS struct.

Parameters
sps_idthe SPS id will be written here
apply_defdispwinif set 1, the default display window from the VUI will be applied to the video dimensions
vps_listif non-NULL, this function will validate that the SPS refers to an existing VPS

Definition at line 908 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_sps(), and generate_fake_vps().

◆ ff_hevc_decode_nal_sps()

int ff_hevc_decode_nal_sps ( GetBitContext gb,
AVCodecContext avctx,
HEVCParamSets ps,
int  apply_defdispwin 
)

Definition at line 1250 of file hevc_ps.c.

Referenced by decode_nal_unit(), hevc_decode_nal_units(), and parse_nal_units().

◆ hevc_pps_free()

static void hevc_pps_free ( void *  opaque,
uint8_t *  data 
)
static

Definition at line 1308 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_pps().

◆ pps_range_extensions()

static int pps_range_extensions ( GetBitContext gb,
AVCodecContext avctx,
HEVCPPS pps,
HEVCSPS sps 
)
static

Definition at line 1326 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_pps().

◆ setup_pps()

static int setup_pps ( AVCodecContext avctx,
GetBitContext gb,
HEVCPPS pps,
HEVCSPS sps 
)
inlinestatic

6.5

Definition at line 1367 of file hevc_ps.c.

Referenced by ff_hevc_decode_nal_pps().

◆ ff_hevc_decode_nal_pps()

int ff_hevc_decode_nal_pps ( GetBitContext gb,
AVCodecContext avctx,
HEVCParamSets ps 
)

Definition at line 1499 of file hevc_ps.c.

Referenced by decode_nal_unit(), hevc_decode_nal_units(), and parse_nal_units().

◆ ff_hevc_ps_uninit()

void ff_hevc_ps_uninit ( HEVCParamSets ps)

Definition at line 1747 of file hevc_ps.c.

Referenced by hevc_decode_free(), and hevc_parser_close().

◆ ff_hevc_compute_poc()

int ff_hevc_compute_poc ( const HEVCSPS sps,
int  pocTid0,
int  poc_lsb,
int  nal_unit_type 
)

Compute POC of the current frame and return it.

Definition at line 1763 of file hevc_ps.c.

Referenced by hevc_parse_slice_header(), and hls_slice_header().

Variable Documentation

◆ default_scaling_list_intra

const uint8_t default_scaling_list_intra[]
static
Initial value:
= {
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115
}

Definition at line 31 of file hevc_ps.c.

Referenced by set_default_scaling_list_data().

◆ default_scaling_list_inter

const uint8_t default_scaling_list_inter[]
static
Initial value:
= {
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91
}

Definition at line 42 of file hevc_ps.c.

Referenced by set_default_scaling_list_data().

◆ vui_sar

const AVRational vui_sar[]
static
Initial value:
= {
{ 0, 1 },
{ 1, 1 },
{ 12, 11 },
{ 10, 11 },
{ 16, 11 },
{ 40, 33 },
{ 24, 11 },
{ 20, 11 },
{ 32, 11 },
{ 80, 33 },
{ 18, 11 },
{ 15, 11 },
{ 64, 33 },
{ 160, 99 },
{ 4, 3 },
{ 3, 2 },
{ 2, 1 },
}

Definition at line 53 of file hevc_ps.c.

Referenced by decode_vui().

◆ hevc_sub_width_c

const uint8_t hevc_sub_width_c[]
static
Initial value:
= {
1, 2, 2, 1
}

Definition at line 73 of file hevc_ps.c.

Referenced by decode_vui(), and ff_hevc_parse_sps().

◆ hevc_sub_height_c

const uint8_t hevc_sub_height_c[]
static
Initial value:
= {
1, 2, 1, 1
}

Definition at line 77 of file hevc_ps.c.

Referenced by decode_vui(), and ff_hevc_parse_sps().