summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/ffmpeg/libavcodec/hevc.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/ffmpeg/libavcodec/hevc.h')
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc.h118
1 files changed, 57 insertions, 61 deletions
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc.h b/chromium/third_party/ffmpeg/libavcodec/hevc.h
index 74673a9f1ab..3c88b69a470 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc.h
@@ -71,6 +71,11 @@
#define EPEL_EXTRA_BEFORE 1
#define EPEL_EXTRA_AFTER 2
#define EPEL_EXTRA 3
+#define QPEL_EXTRA_BEFORE 3
+#define QPEL_EXTRA_AFTER 4
+#define QPEL_EXTRA 7
+
+#define EDGE_EMU_BUFFER_STRIDE 80
/**
* Value of the luma sample at position (x, y) in the 2D array tab.
@@ -199,6 +204,13 @@ enum InterPredIdc {
PRED_BI,
};
+enum PredFlag {
+ PF_INTRA = 0,
+ PF_L0,
+ PF_L1,
+ PF_BI,
+};
+
enum IntraPredMode {
INTRA_PLANAR = 0,
INTRA_DC,
@@ -257,7 +269,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];
@@ -330,30 +342,24 @@ typedef struct VUI {
int log2_max_mv_length_vertical;
} VUI;
-typedef struct ProfileTierLevel {
- int profile_space;
+typedef struct PTLCommon {
+ uint8_t profile_space;
uint8_t tier_flag;
- int profile_idc;
- int profile_compatibility_flag[32];
- int level_idc;
- int progressive_source_flag;
- int interlaced_source_flag;
- int non_packed_constraint_flag;
- int frame_only_constraint_flag;
-} ProfileTierLevel;
+ 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 {
- ProfileTierLevel general_PTL;
- ProfileTierLevel sub_layer_PTL[MAX_SUB_LAYERS];
+ 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 {
@@ -374,8 +380,6 @@ typedef struct HEVCVPS {
uint8_t vps_poc_proportional_to_timing_flag;
int vps_num_ticks_poc_diff_one; ///< vps_num_ticks_poc_diff_one_minus1 + 1
int vps_num_hrd_parameters;
-
- int vps_extension_flag;
} HEVCVPS;
typedef struct ScalingList {
@@ -386,7 +390,7 @@ typedef struct ScalingList {
} ScalingList;
typedef struct HEVCSPS {
- int vps_id;
+ unsigned vps_id;
int chroma_format_idc;
uint8_t separate_colour_plane_flag;
@@ -467,7 +471,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;
@@ -508,7 +512,7 @@ typedef struct HEVCPPS {
int beta_offset; ///< beta_offset_div2 * 2
int tc_offset; ///< tc_offset_div2 * 2
- int scaling_list_data_present_flag;
+ uint8_t scaling_list_data_present_flag;
ScalingList scaling_list;
uint8_t lists_modification_present_flag;
@@ -516,14 +520,11 @@ typedef struct HEVCPPS {
int num_extra_slice_header_bits;
uint8_t slice_header_extension_present_flag;
- uint8_t pps_extension_flag;
- uint8_t pps_extension_data_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
@@ -535,7 +536,7 @@ typedef struct HEVCPPS {
} 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;
@@ -580,8 +581,7 @@ typedef struct SliceHeader {
int beta_offset; ///< beta_offset_div2 * 2
int tc_offset; ///< tc_offset_div2 * 2
- int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
-
+ unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
int *entry_point_offset;
int * offset;
@@ -636,8 +636,7 @@ typedef struct Mv {
typedef struct MvField {
Mv mv[2];
int8_t ref_idx[2];
- int8_t pred_flag[2];
- uint8_t is_intra;
+ int8_t pred_flag;
} MvField;
typedef struct NeighbourAvailable {
@@ -675,19 +674,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]; ///<SaoOffsetVal
-
- uint8_t type_idx[3]; ///< sao_type_idx
-} SAOParams;
-
typedef struct DBParams {
int beta_offset;
int tc_offset;
@@ -746,17 +732,20 @@ typedef struct HEVCLocalContext {
int8_t qp_y;
int8_t curr_qp_y;
+ int qPy_pred;
+
TransformUnit tu;
uint8_t ctb_left_flag;
uint8_t ctb_up_flag;
uint8_t ctb_up_right_flag;
uint8_t ctb_up_left_flag;
- int start_of_tiles_x;
int end_of_tiles_x;
int end_of_tiles_y;
- uint8_t *edge_emu_buffer;
- int edge_emu_buffer_size;
+ /* +7 is for subpixel interpolation, *2 for high bit depths */
+ DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
+ DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer2)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
+
CodingTree ct;
CodingUnit cu;
PredictionUnit pu;
@@ -768,7 +757,7 @@ typedef struct HEVCLocalContext {
typedef struct HEVCContext {
const AVClass *c; // needed by private avoptions
- AVCodecContext *avctx;
+ AVCodecContext *avctx;
struct HEVCContext *sList[MAX_NB_THREADS];
@@ -791,9 +780,9 @@ typedef struct HEVCContext {
AVFrame *tmp_frame;
AVFrame *output_frame;
- HEVCVPS *vps;
+ const HEVCVPS *vps;
const HEVCSPS *sps;
- HEVCPPS *pps;
+ const HEVCPPS *pps;
AVBufferRef *vps_list[MAX_VPS_COUNT];
AVBufferRef *sps_list[MAX_SPS_COUNT];
AVBufferRef *pps_list[MAX_PPS_COUNT];
@@ -815,6 +804,7 @@ typedef struct HEVCContext {
int pocTid0;
int slice_idx; ///< number of the slice being currently decoded
int eos; ///< current packet contains an EOS/EOB NAL
+ int last_eos; ///< last packet contains an EOS/EOB NAL
int max_ra;
int bs_width;
int bs_height;
@@ -865,19 +855,21 @@ typedef struct HEVCContext {
int **skipped_bytes_pos_nal;
int *skipped_bytes_pos_size_nal;
- uint8_t *data;
+ const uint8_t *data;
HEVCNAL *nals;
int nb_nals;
int nals_allocated;
+ // type of the first VCL NAL of the current frame
+ enum NALUnitType first_nal_type;
// for checking the frame checksums
struct AVMD5 *md5_ctx;
uint8_t md5[3][16];
uint8_t is_md5;
- int context_initialized;
- int is_nalff; ///< this flag is != 0 if bitstream is encapsulated
+ uint8_t context_initialized;
+ uint8_t is_nalff; ///< this flag is != 0 if bitstream is encapsulated
///< as a format defined in 14496-15
int apply_defdispwin;
@@ -886,6 +878,12 @@ typedef struct HEVCContext {
int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4)
int nuh_layer_id;
+ /** frame packing arrangement variables */
+ int sei_frame_packing_present;
+ int frame_packing_arrangement_type;
+ int content_interpretation_type;
+ int quincunx_subsampling;
+
int picture_struct;
} HEVCContext;
@@ -986,9 +984,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0,
void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC, int xBase, int yBase,
int log2_cb_size);
void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
- int log2_trafo_size,
- int slice_or_tiles_up_boundary,
- int slice_or_tiles_left_boundary);
+ int log2_trafo_size);
int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s);
int ff_hevc_cu_qp_delta_abs(HEVCContext *s);
void ff_hevc_hls_filter(HEVCContext *s, int x, int y);