summaryrefslogtreecommitdiff
path: root/libavcodec/av1dec.h
diff options
context:
space:
mode:
authorFei Wang <fei.w.wang@intel.com>2020-09-09 11:39:55 +0800
committerJames Almer <jamrial@gmail.com>2020-09-12 13:08:34 -0300
commit47be5a505657f478636ff08cef45f5c4c201ad23 (patch)
tree1c77e0d0a9c570dbcf87f71e85f3df191100b9ae /libavcodec/av1dec.h
parentbab3c32351e42f9f7f64947102f871903b2e635c (diff)
avcodec: add AV1 hardware accelerated decoder
This AV1 decoder is currently only used for hardware accelerated decoding. It can be extended into a native decoder in the future, so set its name to "av1" and temporarily give it the lowest priority in the codec list. Signed-off-by: Fei Wang <fei.w.wang@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1dec.h')
-rw-r--r--libavcodec/av1dec.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/libavcodec/av1dec.h b/libavcodec/av1dec.h
new file mode 100644
index 0000000000..3604870299
--- /dev/null
+++ b/libavcodec/av1dec.h
@@ -0,0 +1,75 @@
+/*
+ * AV1 video decoder
+ * *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AV1DEC_H
+#define AVCODEC_AV1DEC_H
+
+#include <stdint.h>
+
+#include "libavutil/buffer.h"
+#include "libavutil/pixfmt.h"
+#include "avcodec.h"
+#include "cbs.h"
+#include "cbs_av1.h"
+#include "thread.h"
+
+typedef struct AV1Frame {
+ ThreadFrame tf;
+
+ AVBufferRef *hwaccel_priv_buf;
+ void *hwaccel_picture_private;
+
+ uint8_t loop_filter_delta_enabled;
+ int8_t loop_filter_ref_deltas[AV1_NUM_REF_FRAMES];
+ int8_t loop_filter_mode_deltas[2];
+ uint8_t gm_type[AV1_NUM_REF_FRAMES];
+ int32_t gm_params[AV1_NUM_REF_FRAMES][6];
+} AV1Frame;
+
+typedef struct TileGroupInfo {
+ uint32_t tile_offset;
+ uint32_t tile_size;
+ uint16_t tile_row;
+ uint16_t tile_column;
+} TileGroupInfo;
+
+typedef struct AV1DecContext {
+ const AVClass *class;
+ AVCodecContext *avctx;
+
+ enum AVPixelFormat pix_fmt;
+ CodedBitstreamContext *cbc;
+ CodedBitstreamFragment current_obu;
+
+ AVBufferRef *seq_ref;
+ AV1RawSequenceHeader *raw_seq;
+ AVBufferRef *header_ref;
+ AV1RawFrameHeader *raw_frame_header;
+ TileGroupInfo *tile_group_info;
+ uint16_t tile_num;
+ uint16_t tg_start;
+ uint16_t tg_end;
+
+ AV1Frame ref[AV1_NUM_REF_FRAMES];
+ AV1Frame cur_frame;
+
+} AV1DecContext;
+
+#endif /* AVCODEC_AV1DEC_H */