]> git.sesse.net Git - ffmpeg/blob - libavcodec/av1dec.h
avcodec/cbs_av1: split film grain param fields into their own struct
[ffmpeg] / libavcodec / av1dec.h
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/pixfmt.h"
28 #include "avcodec.h"
29 #include "cbs.h"
30 #include "cbs_av1.h"
31 #include "thread.h"
32
33 typedef struct AV1Frame {
34     ThreadFrame tf;
35
36     AVBufferRef *hwaccel_priv_buf;
37     void *hwaccel_picture_private;
38
39     AVBufferRef *header_ref;
40     AV1RawFrameHeader *raw_frame_header;
41
42     int temporal_id;
43     int spatial_id;
44
45     uint8_t gm_type[AV1_NUM_REF_FRAMES];
46     int32_t gm_params[AV1_NUM_REF_FRAMES][6];
47
48     uint8_t skip_mode_frame_idx[2];
49
50     uint8_t coded_lossless;
51 } AV1Frame;
52
53 typedef struct TileGroupInfo {
54     uint32_t tile_offset;
55     uint32_t tile_size;
56     uint16_t tile_row;
57     uint16_t tile_column;
58 } TileGroupInfo;
59
60 typedef struct AV1DecContext {
61     const AVClass *class;
62     AVCodecContext *avctx;
63
64     enum AVPixelFormat pix_fmt;
65     CodedBitstreamContext *cbc;
66     CodedBitstreamFragment current_obu;
67
68     AVBufferRef *seq_ref;
69     AV1RawSequenceHeader *raw_seq;
70     AVBufferRef *header_ref;
71     AV1RawFrameHeader *raw_frame_header;
72     TileGroupInfo *tile_group_info;
73     uint16_t tile_num;
74     uint16_t tg_start;
75     uint16_t tg_end;
76
77     AV1Frame ref[AV1_NUM_REF_FRAMES];
78     AV1Frame cur_frame;
79
80 } AV1DecContext;
81
82 #endif /* AVCODEC_AV1DEC_H */