diff options
author | James Almer <jamrial@gmail.com> | 2017-03-23 14:27:48 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-03-23 14:27:48 -0300 |
commit | 6397815be0bee10948387fcb90ead36ec2834ef7 (patch) | |
tree | e616efad05f1147821dd80f88dae04707d795193 /libavcodec/hevcdec.h | |
parent | a1a80a6c9ce5309632a8b5c0241fa5ffcd09b5fc (diff) | |
parent | c359d624d3efc3fd1d83210d78c4152bd329b765 (diff) | |
download | ffmpeg-6397815be0bee10948387fcb90ead36ec2834ef7.tar.gz |
Merge commit 'c359d624d3efc3fd1d83210d78c4152bd329b765'
* commit 'c359d624d3efc3fd1d83210d78c4152bd329b765':
hevcdec: move decoder-independent declarations into a separate header
Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevcdec.h')
-rw-r--r-- | libavcodec/hevcdec.h | 74 |
1 files changed, 17 insertions, 57 deletions
diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index 519c7a634c..0866461c00 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -34,6 +34,7 @@ #include "get_bits.h" #include "hevcpred.h" #include "h2645_parse.h" +#include "hevc.h" #include "hevcdsp.h" #include "internal.h" #include "thread.h" @@ -45,16 +46,6 @@ #define MAX_NB_THREADS 16 #define SHIFT_CTB_WPP 2 -/** - * 7.4.2.1 - */ -#define MAX_SUB_LAYERS 7 -#define MAX_VPS_COUNT 16 -#define MAX_SPS_COUNT 32 -#define MAX_PPS_COUNT 256 -#define MAX_SHORT_TERM_RPS_COUNT 64 -#define MAX_CU_SIZE 128 - //TODO: check if this is really the maximum #define MAX_TRANSFORM_DEPTH 5 @@ -85,42 +76,11 @@ #define SAMPLE(tab, x, y) ((tab)[(y) * s->sps->width + (x)]) #define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)]) -#define IS_IDR(s) ((s)->nal_unit_type == NAL_IDR_W_RADL || (s)->nal_unit_type == NAL_IDR_N_LP) -#define IS_BLA(s) ((s)->nal_unit_type == NAL_BLA_W_RADL || (s)->nal_unit_type == NAL_BLA_W_LP || \ - (s)->nal_unit_type == NAL_BLA_N_LP) +#define IS_IDR(s) ((s)->nal_unit_type == HEVC_NAL_IDR_W_RADL || (s)->nal_unit_type == HEVC_NAL_IDR_N_LP) +#define IS_BLA(s) ((s)->nal_unit_type == HEVC_NAL_BLA_W_RADL || (s)->nal_unit_type == HEVC_NAL_BLA_W_LP || \ + (s)->nal_unit_type == HEVC_NAL_BLA_N_LP) #define IS_IRAP(s) ((s)->nal_unit_type >= 16 && (s)->nal_unit_type <= 23) -/** - * Table 7-3: NAL unit type codes - */ -enum NALUnitType { - NAL_TRAIL_N = 0, - NAL_TRAIL_R = 1, - NAL_TSA_N = 2, - NAL_TSA_R = 3, - NAL_STSA_N = 4, - NAL_STSA_R = 5, - NAL_RADL_N = 6, - NAL_RADL_R = 7, - NAL_RASL_N = 8, - NAL_RASL_R = 9, - NAL_BLA_W_LP = 16, - NAL_BLA_W_RADL = 17, - NAL_BLA_N_LP = 18, - NAL_IDR_W_RADL = 19, - NAL_IDR_N_LP = 20, - NAL_CRA_NUT = 21, - NAL_VPS = 32, - NAL_SPS = 33, - NAL_PPS = 34, - NAL_AUD = 35, - NAL_EOS_NUT = 36, - NAL_EOB_NUT = 37, - NAL_FD_NUT = 38, - NAL_SEI_PREFIX = 39, - NAL_SEI_SUFFIX = 40, -}; - enum RPSType { ST_CURR_BEF = 0, ST_CURR_AFT, @@ -365,10 +325,10 @@ typedef struct PTLCommon { typedef struct PTL { PTLCommon general_ptl; - PTLCommon sub_layer_ptl[MAX_SUB_LAYERS]; + PTLCommon sub_layer_ptl[HEVC_MAX_SUB_LAYERS]; - uint8_t sub_layer_profile_present_flag[MAX_SUB_LAYERS]; - uint8_t sub_layer_level_present_flag[MAX_SUB_LAYERS]; + uint8_t sub_layer_profile_present_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_level_present_flag[HEVC_MAX_SUB_LAYERS]; } PTL; typedef struct HEVCVPS { @@ -378,9 +338,9 @@ typedef struct HEVCVPS { PTL ptl; int vps_sub_layer_ordering_info_present_flag; - unsigned int vps_max_dec_pic_buffering[MAX_SUB_LAYERS]; - unsigned int vps_num_reorder_pics[MAX_SUB_LAYERS]; - unsigned int vps_max_latency_increase[MAX_SUB_LAYERS]; + unsigned int vps_max_dec_pic_buffering[HEVC_MAX_SUB_LAYERS]; + unsigned int vps_num_reorder_pics[HEVC_MAX_SUB_LAYERS]; + unsigned int vps_max_latency_increase[HEVC_MAX_SUB_LAYERS]; int vps_max_layer_id; int vps_num_layer_sets; ///< vps_num_layer_sets_minus1 + 1 uint8_t vps_timing_info_present_flag; @@ -424,7 +384,7 @@ typedef struct HEVCSPS { int max_dec_pic_buffering; int num_reorder_pics; int max_latency_increase; - } temporal_layer[MAX_SUB_LAYERS]; + } temporal_layer[HEVC_MAX_SUB_LAYERS]; VUI vui; PTL ptl; @@ -433,7 +393,7 @@ typedef struct HEVCSPS { ScalingList scaling_list; unsigned int nb_st_rps; - ShortTermRPS st_rps[MAX_SHORT_TERM_RPS_COUNT]; + ShortTermRPS st_rps[HEVC_MAX_SHORT_TERM_RPS_COUNT]; uint8_t amp_enabled_flag; uint8_t sao_enabled; @@ -571,9 +531,9 @@ typedef struct HEVCPPS { } HEVCPPS; typedef struct HEVCParamSets { - AVBufferRef *vps_list[MAX_VPS_COUNT]; - AVBufferRef *sps_list[MAX_SPS_COUNT]; - AVBufferRef *pps_list[MAX_PPS_COUNT]; + AVBufferRef *vps_list[HEVC_MAX_VPS_COUNT]; + AVBufferRef *sps_list[HEVC_MAX_SPS_COUNT]; + AVBufferRef *pps_list[HEVC_MAX_PPS_COUNT]; /* currently active parameter sets */ const HEVCVPS *vps; @@ -837,7 +797,7 @@ typedef struct HEVCContext { SliceHeader sh; SAOParams *sao; DBParams *deblock; - enum NALUnitType nal_unit_type; + enum HEVCNALUnitType nal_unit_type; int temporal_id; ///< temporal_id_plus1 - 1 HEVCFrame *ref; HEVCFrame DPB[32]; @@ -893,7 +853,7 @@ typedef struct HEVCContext { H2645Packet pkt; // type of the first VCL NAL of the current frame - enum NALUnitType first_nal_type; + enum HEVCNALUnitType first_nal_type; // for checking the frame checksums struct AVMD5 *md5_ctx; |