diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 16:14:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 17:13:00 +0100 |
commit | 5eb1704d5f5a85ff5b532887d559f3cf2822d8fc (patch) | |
tree | 9282c0edf8e3dd4b4dd014f157044c34dc6527cb /libavcodec/hevc.h | |
parent | c617c669e9fce59905915c3ba1053f535add6a06 (diff) | |
parent | 064698d381e1e7790f21b0199a8930ea04e2e942 (diff) | |
download | ffmpeg-5eb1704d5f5a85ff5b532887d559f3cf2822d8fc.tar.gz |
Merge commit '064698d381e1e7790f21b0199a8930ea04e2e942'
* commit '064698d381e1e7790f21b0199a8930ea04e2e942':
Add HEVC decoder
Conflicts:
Changelog
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/hevc.c
libavcodec/hevc.h
libavcodec/hevc_cabac.c
libavcodec/hevc_filter.c
libavcodec/hevc_mvs.c
libavcodec/hevc_parser.c
libavcodec/hevc_ps.c
libavcodec/hevc_refs.c
libavcodec/hevc_sei.c
libavcodec/hevcdsp.c
libavcodec/hevcdsp_template.c
libavcodec/hevcpred.c
libavcodec/hevcpred_template.c
libavcodec/version.h
cosmetics from hevc.h & hevc_ps.c mostly merged, other files left as they where in ffmpeg.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc.h')
-rw-r--r-- | libavcodec/hevc.h | 170 |
1 files changed, 91 insertions, 79 deletions
diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index df80475703..66556ae25f 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -1,5 +1,5 @@ /* - * HEVC video Decoder + * HEVC video decoder * * Copyright (C) 2012 - 2013 Guillaume Martres * @@ -88,31 +88,31 @@ * 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, + 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 { @@ -347,7 +347,7 @@ typedef struct PTL { int sub_layer_level_idc[MAX_SUB_LAYERS]; } PTL; -typedef struct VPS { +typedef struct HEVCVPS { uint8_t vps_temporal_id_nesting_flag; int vps_max_layers; int vps_max_sub_layers; ///< vps_max_temporal_layers_minus1 + 1 @@ -365,10 +365,11 @@ typedef struct VPS { 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; -} VPS; +} HEVCVPS; typedef struct ScalingList { - // This is a little wasteful, since sizeID 0 only needs 8 coeffs, and size ID 3 only has 2 arrays, not 6. + /* This is a little wasteful, since sizeID 0 only needs 8 coeffs, + * and size ID 3 only has 2 arrays, not 6. */ uint8_t sl[4][6][64]; uint8_t sl_dc[2][6]; } ScalingList; @@ -483,8 +484,8 @@ typedef struct HEVCPPS { uint8_t tiles_enabled_flag; uint8_t entropy_coding_sync_enabled_flag; - int num_tile_columns; ///< num_tile_columns_minus1 + 1 - int num_tile_rows; ///< num_tile_rows_minus1 + 1 + int num_tile_columns; ///< num_tile_columns_minus1 + 1 + int num_tile_rows; ///< num_tile_rows_minus1 + 1 uint8_t uniform_spacing_flag; uint8_t loop_filter_across_tiles_enabled_flag; @@ -493,10 +494,10 @@ typedef struct HEVCPPS { uint8_t deblocking_filter_control_present_flag; uint8_t deblocking_filter_override_enabled_flag; uint8_t disable_dbf; - int beta_offset; ///< beta_offset_div2 * 2 - int tc_offset; ///< tc_offset_div2 * 2 + int beta_offset; ///< beta_offset_div2 * 2 + int tc_offset; ///< tc_offset_div2 * 2 - int pps_scaling_list_data_present_flag; + int scaling_list_data_present_flag; ScalingList scaling_list; uint8_t lists_modification_present_flag; @@ -508,18 +509,18 @@ typedef struct HEVCPPS { uint8_t pps_extension_data_flag; // Inferred parameters - int *column_width; ///< ColumnWidth - int *row_height; ///< RowHeight - int *col_bd; ///< ColBd - int *row_bd; ///< RowBd + int *column_width; ///< ColumnWidth + int *row_height; ///< RowHeight + int *col_bd; ///< ColBd + 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 + 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 { @@ -565,8 +566,8 @@ typedef struct SliceHeader { int slice_cb_qp_offset; int slice_cr_qp_offset; - int beta_offset; ///< beta_offset_div2 * 2 - int tc_offset; ///< tc_offset_div2 * 2 + 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 @@ -592,7 +593,7 @@ typedef struct SliceHeader { int16_t luma_offset_l1[16]; int16_t chroma_offset_l1[16][2]; - int slice_ctb_addr_rs; + int slice_ctb_addr_rs; } SliceHeader; typedef struct CodingTree { @@ -603,26 +604,26 @@ typedef struct CodingUnit { int x; int y; - enum PredMode pred_mode; ///< PredMode - enum PartMode part_mode; ///< PartMode + 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 + uint8_t intra_split_flag; ///< IntraSplitFlag + uint8_t max_trafo_depth; ///< MaxTrafoDepth uint8_t cu_transquant_bypass_flag; } CodingUnit; typedef struct Mv { - int16_t x; ///< horizontal component of motion vector - int16_t y; ///< vertical component of motion vector + int16_t x; ///< horizontal component of motion vector + int16_t y; ///< vertical component of motion vector } Mv; typedef struct MvField { - Mv mv[2]; + Mv mv[2]; int8_t ref_idx[2]; int8_t pred_flag[2]; uint8_t is_intra; @@ -664,16 +665,16 @@ typedef struct TransformUnit { } TransformUnit; typedef struct SAOParams { - int offset_abs[3][4]; ///< sao_offset_abs - int offset_sign[3][4]; ///< sao_offset_sign + int offset_abs[3][4]; ///< sao_offset_abs + int offset_sign[3][4]; ///< sao_offset_sign - int band_position[3]; ///< sao_band_position + int band_position[3]; ///< sao_band_position - int eo_class[3]; ///< sao_eo_class + int eo_class[3]; ///< sao_eo_class - int offset_val[3][5]; ///<SaoOffsetVal + int offset_val[3][5]; ///<SaoOffsetVal - uint8_t type_idx[3]; ///< sao_type_idx + uint8_t type_idx[3]; ///< sao_type_idx } SAOParams; typedef struct DBParams { @@ -756,12 +757,12 @@ typedef struct HEVCLocalContext { typedef struct HEVCContext { const AVClass *c; // needed by private avoptions - AVCodecContext *avctx; + AVCodecContext *avctx; - struct HEVCContext *sList[MAX_NB_THREADS]; + struct HEVCContext *sList[MAX_NB_THREADS]; - HEVCLocalContext *HEVClcList[MAX_NB_THREADS]; - HEVCLocalContext *HEVClc; + HEVCLocalContext *HEVClcList[MAX_NB_THREADS]; + HEVCLocalContext *HEVClc; uint8_t threads_type; uint8_t threads_number; @@ -778,10 +779,10 @@ typedef struct HEVCContext { AVFrame *sao_frame; AVFrame *tmp_frame; AVFrame *output_frame; - VPS *vps; + HEVCVPS *vps; const HEVCSPS *sps; HEVCPPS *pps; - VPS *vps_list[MAX_VPS_COUNT]; + HEVCVPS *vps_list[MAX_VPS_COUNT]; AVBufferRef *sps_list[MAX_SPS_COUNT]; AVBufferRef *pps_list[MAX_PPS_COUNT]; @@ -825,7 +826,6 @@ typedef struct HEVCContext { // PU uint8_t *tab_ipm; - uint8_t *cbf_luma; // cbf_luma of colocated TU uint8_t *is_pcm; @@ -865,13 +865,13 @@ typedef struct HEVCContext { uint8_t is_md5; int context_initialized; - int is_nalff; ///< this flag is != 0 if bitstream is encapsulated - ///< as a format defined in 14496-15 - int strict_def_disp_win; + int is_nalff; ///< this flag is != 0 if bitstream is encapsulated + ///< as a format defined in 14496-15 + int apply_defdispwin; int active_seq_parameter_set_id; - int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4) + int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4) int nuh_layer_id; int picture_struct; @@ -902,7 +902,8 @@ void ff_hevc_flush_dpb(HEVCContext *s); */ int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb); -RefPicList* ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *frame, int x0, int y0); +RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *frame, + int x0, int y0); /** * Construct the reference picture sets for the current frame. @@ -924,9 +925,11 @@ int ff_hevc_sao_offset_sign_decode(HEVCContext *s); int ff_hevc_sao_eo_class_decode(HEVCContext *s); int ff_hevc_end_of_slice_flag_decode(HEVCContext *s); int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s); -int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0, int x_cb, int y_cb); +int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0, + int x_cb, int y_cb); int ff_hevc_pred_mode_decode(HEVCContext *s); -int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth, int x0, int y0); +int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth, + int x0, int y0); int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size); int ff_hevc_pcm_flag_decode(HEVCContext *s); int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCContext *s); @@ -959,12 +962,21 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *frame, int flush); void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags); -void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0, int nPbW, int nPbH); -void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv); -void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv , int mvp_lx_flag, int LX); -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); +void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0, + int nPbW, int nPbH); +void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, + int nPbW, int nPbH, int log2_cb_size, + int part_idx, int merge_idx, MvField *mv); +void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, + int nPbW, int nPbH, int log2_cb_size, + int part_idx, int merge_idx, + MvField *mv, int mvp_lx_flag, int LX); +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 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); @@ -986,4 +998,4 @@ extern const uint8_t ff_hevc_diag_scan4x4_y[16]; extern const uint8_t ff_hevc_diag_scan8x8_x[64]; extern const uint8_t ff_hevc_diag_scan8x8_y[64]; -#endif // AVCODEC_HEVC_H +#endif /* AVCODEC_HEVC_H */ |