FFmpeg
av1dec.h
Go to the documentation of this file.
1 /*
2  * AV1 video decoder
3  * *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVCODEC_AV1DEC_H
22 #define AVCODEC_AV1DEC_H
23 
24 #include <stdint.h>
25 
26 #include "libavutil/buffer.h"
27 #include "libavutil/fifo.h"
28 #include "libavutil/frame.h"
29 #include "libavutil/pixfmt.h"
30 #include "avcodec.h"
31 #include "packet.h"
32 #include "cbs.h"
33 #include "cbs_av1.h"
34 #include "dovi_rpu.h"
35 
36 typedef struct AV1Frame {
38 
39  void *hwaccel_picture_private; ///< RefStruct reference
40 
41  AV1RawOBU *header_ref; ///< RefStruct reference backing raw_frame_header.
43 
46 
50 
51  uint8_t skip_mode_frame_idx[2];
52 
54 
55  uint8_t coded_lossless;
56 
57  // OrderHint for this frame.
58  uint8_t order_hint;
59  // RefFrameSignBias[] used when decoding this frame.
61  // OrderHints[] when this is the current frame, otherwise
62  // SavedOrderHints[s][] when is the reference frame in slot s.
64 } AV1Frame;
65 
66 typedef struct TileGroupInfo {
67  uint32_t tile_offset;
68  uint32_t tile_size;
69  uint16_t tile_row;
70  uint16_t tile_column;
72 
73 typedef struct AV1DecContext {
74  const AVClass *class;
76 
81 
83  AV1RawOBU *seq_ref; ///< RefStruct reference backing raw_seq
85  AV1RawOBU *header_ref; ///< RefStruct reference backing raw_frame_header
88 
89  AV1RawOBU *cll_ref; ///< RefStruct reference backing cll
91  AV1RawOBU *mdcv_ref; ///< RefStruct reference backing mdcv
95 
96  uint16_t tile_num;
97  uint16_t tg_start;
98  uint16_t tg_end;
99 
101 
104 
105  int nb_unit;
106 
107  // AVOptions
109 } AV1DecContext;
110 
111 #endif /* AVCODEC_AV1DEC_H */
AV1DecContext::ref
AV1Frame ref[AV1_NUM_REF_FRAMES]
Definition: av1dec.h:102
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
AV1_NUM_REF_FRAMES
@ AV1_NUM_REF_FRAMES
Definition: av1.h:84
AV1RawSequenceHeader
Definition: cbs_av1.h:73
TileGroupInfo::tile_column
uint16_t tile_column
Definition: av1dec.h:70
AV1DecContext::mdcv
AV1RawMetadataHDRMDCV * mdcv
Definition: av1dec.h:92
AV1DecContext::dovi
DOVIContext dovi
Definition: av1dec.h:93
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:374
AV1Frame::raw_frame_header
AV1RawFrameHeader * raw_frame_header
Definition: av1dec.h:42
CodedBitstreamContext
Context structure for coded bitstream operations.
Definition: cbs.h:219
AV1DecContext::tg_start
uint16_t tg_start
Definition: av1dec.h:97
cbs.h
TileGroupInfo::tile_row
uint16_t tile_row
Definition: av1dec.h:69
AV1DecContext::tg_end
uint16_t tg_end
Definition: av1dec.h:98
AV1DecContext::raw_frame_header
AV1RawFrameHeader * raw_frame_header
Definition: av1dec.h:86
AV1DecContext::seq_data_ref
AVBufferRef * seq_data_ref
Definition: av1dec.h:82
AV1DecContext::cll_ref
AV1RawOBU * cll_ref
RefStruct reference backing cll.
Definition: av1dec.h:89
fifo.h
DOVIContext
Definition: dovi_rpu.h:31
dovi_rpu.h
AV1RawMetadataHDRMDCV
Definition: cbs_av1.h:323
TileGroupInfo::tile_offset
uint32_t tile_offset
Definition: av1dec.h:67
AV1DecContext::itut_t35_fifo
AVFifo * itut_t35_fifo
Definition: av1dec.h:94
AV1Frame
Definition: av1dec.h:36
cbs_av1.h
AV1DecContext::pkt
AVPacket * pkt
Definition: av1dec.h:80
AV1Frame::ref_frame_sign_bias
uint8_t ref_frame_sign_bias[AV1_TOTAL_REFS_PER_FRAME]
Definition: av1dec.h:60
AV1DecContext::current_obu
CodedBitstreamFragment current_obu
Definition: av1dec.h:79
AV1Frame::spatial_id
int spatial_id
Definition: av1dec.h:45
CodedBitstreamFragment
Coded bitstream fragment structure, combining one or more units.
Definition: cbs.h:122
AV1DecContext::seq_ref
AV1RawOBU * seq_ref
RefStruct reference backing raw_seq.
Definition: av1dec.h:83
AV1Frame::film_grain
AV1RawFilmGrainParams film_grain
Definition: av1dec.h:53
AV1DecContext::cbc
CodedBitstreamContext * cbc
Definition: av1dec.h:78
TileGroupInfo::tile_size
uint32_t tile_size
Definition: av1dec.h:68
AV1RawMetadataHDRCLL
Definition: cbs_av1.h:318
AV1DecContext::cur_frame
AV1Frame cur_frame
Definition: av1dec.h:103
AV1DecContext::tile_group_info
TileGroupInfo * tile_group_info
Definition: av1dec.h:87
AV1RawOBU
Definition: cbs_av1.h:400
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
AV1Frame::gm_params
int32_t gm_params[AV1_NUM_REF_FRAMES][6]
Definition: av1dec.h:49
AV1RawFrameHeader
Definition: cbs_av1.h:165
AV1DecContext::nb_unit
int nb_unit
Definition: av1dec.h:105
AVFifo
Definition: fifo.c:35
AV1DecContext::mdcv_ref
AV1RawOBU * mdcv_ref
RefStruct reference backing mdcv.
Definition: av1dec.h:91
AV1_TOTAL_REFS_PER_FRAME
@ AV1_TOTAL_REFS_PER_FRAME
Definition: av1.h:86
AV1DecContext
Definition: av1dec.h:73
AV1Frame::skip_mode_frame_idx
uint8_t skip_mode_frame_idx[2]
Definition: av1dec.h:51
frame.h
buffer.h
AV1Frame::f
AVFrame * f
Definition: av1dec.h:37
AV1Frame::order_hint
uint8_t order_hint
Definition: av1dec.h:58
AV1DecContext::tile_num
uint16_t tile_num
Definition: av1dec.h:96
AV1DecContext::cll
AV1RawMetadataHDRCLL * cll
Definition: av1dec.h:90
AV1DecContext::operating_point
int operating_point
Definition: av1dec.h:108
packet.h
AV1Frame::hwaccel_picture_private
void * hwaccel_picture_private
RefStruct reference.
Definition: av1dec.h:39
AV1Frame::header_ref
AV1RawOBU * header_ref
RefStruct reference backing raw_frame_header.
Definition: av1dec.h:41
AV1DecContext::operating_point_idc
int operating_point_idc
Definition: av1dec.h:100
AV1DecContext::avctx
AVCodecContext * avctx
Definition: av1dec.h:75
AV1DecContext::header_ref
AV1RawOBU * header_ref
RefStruct reference backing raw_frame_header.
Definition: av1dec.h:85
avcodec.h
AV1Frame::order_hints
uint8_t order_hints[AV1_TOTAL_REFS_PER_FRAME]
Definition: av1dec.h:63
pixfmt.h
AV1Frame::gm_invalid
uint8_t gm_invalid[AV1_NUM_REF_FRAMES]
Definition: av1dec.h:47
AVCodecContext
main external API structure.
Definition: avcodec.h:445
AV1DecContext::pix_fmt
enum AVPixelFormat pix_fmt
Definition: av1dec.h:77
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
AV1Frame::temporal_id
int temporal_id
Definition: av1dec.h:44
AVPacket
This structure stores compressed data.
Definition: packet.h:501
TileGroupInfo
Definition: av1dec.h:66
int32_t
int32_t
Definition: audioconvert.c:56
AV1RawFilmGrainParams
Definition: cbs_av1.h:133
AV1Frame::coded_lossless
uint8_t coded_lossless
Definition: av1dec.h:55
AV1Frame::gm_type
uint8_t gm_type[AV1_NUM_REF_FRAMES]
Definition: av1dec.h:48
AV1DecContext::raw_seq
AV1RawSequenceHeader * raw_seq
Definition: av1dec.h:84