Skip to content

Commit c0d0e57

Browse files
Benjamin Gaignardmchehab
authored andcommitted
media: verisilicon: Add AV1 entropy helpers
AV1 hardware decoder needs entropy parameters to decode frames. They are computed from various arrays defined in AV1 section "9.4. Default CDF tables". Add helpers functions to init, store and get these parameters. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 1b9ef27 commit c0d0e57

5 files changed

Lines changed: 4719 additions & 0 deletions

File tree

drivers/media/platform/verisilicon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ hantro-vpu-y += \
1818
rockchip_vpu2_hw_h264_dec.o \
1919
rockchip_vpu2_hw_mpeg2_dec.o \
2020
rockchip_vpu2_hw_vp8_dec.o \
21+
rockchip_av1_entropymode.o \
2122
hantro_jpeg.o \
2223
hantro_h264.o \
2324
hantro_hevc.o \

drivers/media/platform/verisilicon/hantro.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ struct hantro_dev {
240240
* @vp8_dec: VP8-decoding context.
241241
* @hevc_dec: HEVC-decoding context.
242242
* @vp9_dec: VP9-decoding context.
243+
* @av1_dec: AV1-decoding context.
243244
*/
244245
struct hantro_ctx {
245246
struct hantro_dev *dev;
@@ -268,6 +269,7 @@ struct hantro_ctx {
268269
struct hantro_vp8_dec_hw_ctx vp8_dec;
269270
struct hantro_hevc_dec_hw_ctx hevc_dec;
270271
struct hantro_vp9_dec_hw_ctx vp9_dec;
272+
struct hantro_av1_dec_hw_ctx av1_dec;
271273
};
272274
};
273275

drivers/media/platform/verisilicon/hantro_hw.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <media/v4l2-vp9.h>
1616
#include <media/videobuf2-core.h>
1717

18+
#include "rockchip_av1_entropymode.h"
19+
1820
#define DEC_8190_ALIGN_MASK 0x07U
1921

2022
#define MB_DIM 16
@@ -247,6 +249,24 @@ struct hantro_vp9_dec_hw_ctx {
247249
s16 feature_data[8][4];
248250
};
249251

252+
/**
253+
* hantro_av1_dec_hw_ctx
254+
* @cdfs: current probabilities structure
255+
* @cdfs_ndvc: current mv probabilities structure
256+
* @default_cdfs: default probabilities structure
257+
* @default_cdfs_ndvc: default mv probabilties structure
258+
* @cdfs_last: stored probabilities structures
259+
* @cdfs_last_ndvc: stored mv probabilities structures
260+
*/
261+
struct hantro_av1_dec_hw_ctx {
262+
struct av1cdfs *cdfs;
263+
struct mvcdfs *cdfs_ndvc;
264+
struct av1cdfs default_cdfs;
265+
struct mvcdfs default_cdfs_ndvc;
266+
struct av1cdfs cdfs_last[NUM_REF_FRAMES];
267+
struct mvcdfs cdfs_last_ndvc[NUM_REF_FRAMES];
268+
};
269+
250270
/**
251271
* struct hantro_postproc_ctx
252272
*

0 commit comments

Comments
 (0)