X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fhevc.h;h=333ea4634b4ab986b9897d45db7740b9b8fe3211;hb=18f4fa251b0eb36392839f5bf6180f280dc04d8d;hp=ab95035ddadbb5783fbd2cdae65f203ed4e03b1a;hpb=064698d381e1e7790f21b0199a8930ea04e2e942;p=ffmpeg diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index ab95035ddad..333ea4634b4 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -30,9 +30,10 @@ #include "libavutil/md5.h" #include "avcodec.h" +#include "bswapdsp.h" #include "cabac.h" -#include "dsputil.h" #include "get_bits.h" +#include "hevcdsp.h" #include "internal.h" #include "thread.h" #include "videodsp.h" @@ -70,18 +71,22 @@ #define EPEL_EXTRA_AFTER 2 #define EPEL_EXTRA 3 +#define EDGE_EMU_BUFFER_STRIDE 80 + /** * Value of the luma sample at position (x, y) in the 2D array tab. */ #define SAMPLE(tab, x, y) ((tab)[(y) * s->sps->width + (x)]) #define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)]) -#define SAMPLE_CBF(tab, x, y) ((tab)[((y) & ((1<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_IRAP(s) (s->nal_unit_type >= 16 && s->nal_unit_type <= 23) +#define FFUDIV(a,b) (((a) > 0 ? (a) : (a) - (b) + 1) / (b)) +#define FFUMOD(a,b) ((a) - (b) * FFUDIV(a,b)) + /** * Table 7-3: NAL unit type codes */ @@ -255,7 +260,7 @@ enum ScanType { }; typedef struct ShortTermRPS { - int num_negative_pics; + unsigned int num_negative_pics; int num_delta_pocs; int32_t delta_poc[32]; uint8_t used[32]; @@ -328,21 +333,24 @@ typedef struct VUI { int log2_max_mv_length_vertical; } VUI; +typedef struct PTLCommon { + uint8_t profile_space; + uint8_t tier_flag; + uint8_t profile_idc; + uint8_t profile_compatibility_flag[32]; + uint8_t level_idc; + uint8_t progressive_source_flag; + uint8_t interlaced_source_flag; + uint8_t non_packed_constraint_flag; + uint8_t frame_only_constraint_flag; +} PTLCommon; + typedef struct PTL { - int general_profile_space; - uint8_t general_tier_flag; - int general_profile_idc; - int general_profile_compatibility_flag[32]; - int general_level_idc; + PTLCommon general_ptl; + PTLCommon sub_layer_ptl[MAX_SUB_LAYERS]; uint8_t sub_layer_profile_present_flag[MAX_SUB_LAYERS]; uint8_t sub_layer_level_present_flag[MAX_SUB_LAYERS]; - - int sub_layer_profile_space[MAX_SUB_LAYERS]; - uint8_t sub_layer_tier_flag[MAX_SUB_LAYERS]; - int sub_layer_profile_idc[MAX_SUB_LAYERS]; - uint8_t sub_layer_profile_compatibility_flags[MAX_SUB_LAYERS][32]; - int sub_layer_level_idc[MAX_SUB_LAYERS]; } PTL; typedef struct HEVCVPS { @@ -416,6 +424,7 @@ typedef struct HEVCSPS { struct { uint8_t bit_depth; + uint8_t bit_depth_chroma; unsigned int log2_min_pcm_cb_size; unsigned int log2_max_pcm_cb_size; uint8_t loop_filter_disable_flag; @@ -453,7 +462,7 @@ typedef struct HEVCSPS { } HEVCSPS; typedef struct HEVCPPS { - int sps_id; ///< seq_parameter_set_id + unsigned int sps_id; ///< seq_parameter_set_id uint8_t sign_data_hiding_flag; @@ -503,22 +512,21 @@ typedef struct HEVCPPS { uint8_t slice_header_extension_present_flag; // Inferred parameters - int *column_width; ///< ColumnWidth - int *row_height; ///< RowHeight - int *col_bd; ///< ColBd - int *row_bd; ///< RowBd + unsigned int *column_width; ///< ColumnWidth + unsigned int *row_height; ///< RowHeight + unsigned int *col_bd; ///< ColBd + unsigned int *row_bd; ///< RowBd int *col_idxX; int *ctb_addr_rs_to_ts; ///< CtbAddrRSToTS int *ctb_addr_ts_to_rs; ///< CtbAddrTSToRS int *tile_id; ///< TileId int *tile_pos_rs; ///< TilePosRS - int *min_cb_addr_zs; ///< MinCbAddrZS int *min_tb_addr_zs; ///< MinTbAddrZS } HEVCPPS; typedef struct SliceHeader { - int pps_id; + unsigned int pps_id; ///< address (in raster order) of the first block in the current slice segment unsigned int slice_segment_addr; @@ -535,6 +543,8 @@ typedef struct SliceHeader { uint8_t colour_plane_id; ///< RPS coded in the slice header itself is stored here + int short_term_ref_pic_set_sps_flag; + int short_term_ref_pic_set_size; ShortTermRPS slice_rps; const ShortTermRPS *short_term_rps; LongTermRPS long_term_rps; @@ -597,10 +607,6 @@ typedef struct CodingUnit { enum PredMode pred_mode; ///< PredMode enum PartMode part_mode; ///< PartMode - uint8_t rqt_root_cbf; - - uint8_t pcm_flag; - // Inferred parameters uint8_t intra_split_flag; ///< IntraSplitFlag uint8_t max_trafo_depth; ///< MaxTrafoDepth @@ -613,7 +619,7 @@ typedef struct Mv { } Mv; typedef struct MvField { - Mv mv[2]; + DECLARE_ALIGNED(4, Mv, mv)[2]; int8_t ref_idx[2]; int8_t pred_flag[2]; uint8_t is_intra; @@ -637,15 +643,6 @@ typedef struct PredictionUnit { uint8_t intra_pred_mode_c; } PredictionUnit; -typedef struct TransformTree { - uint8_t cbf_cb[MAX_TRANSFORM_DEPTH][MAX_CU_SIZE * MAX_CU_SIZE]; - uint8_t cbf_cr[MAX_TRANSFORM_DEPTH][MAX_CU_SIZE * MAX_CU_SIZE]; - uint8_t cbf_luma; - - // Inferred parameters - uint8_t inter_split_flag; -} TransformTree; - typedef struct TransformUnit { int cu_qp_delta; @@ -654,19 +651,6 @@ typedef struct TransformUnit { uint8_t is_cu_qp_delta_coded; } TransformUnit; -typedef struct SAOParams { - int offset_abs[3][4]; ///< sao_offset_abs - int offset_sign[3][4]; ///< sao_offset_sign - - int band_position[3]; ///< sao_band_position - - int eo_class[3]; ///< sao_eo_class - - int offset_val[3][5]; ///