summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-12-03 12:01:02 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-27 16:12:59 +0100
commit655ef9f9e87568aff031391712669b74d1b362f1 (patch)
treef6e60577daaa65c65d0ebc9a181bf768cb4c6771 /drivers/media
parent2b6e6e5b26cf556c576887d8d4e617d3020b6ed2 (diff)
media: allegro: add helper to get entropy mode
The driver only supports CAVLC for H.264, but HEVC only uses CABAC. As the driver has to explicitly tell the MCU to use CABAC for HEVC, add a helper function to get the entropy mode. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/allegro-dvt/allegro-core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c
index ffb989b46bf9..93559ffe9fd2 100644
--- a/drivers/media/platform/allegro-dvt/allegro-core.c
+++ b/drivers/media/platform/allegro-dvt/allegro-core.c
@@ -944,6 +944,14 @@ static s16 get_qp_delta(int minuend, int subtrahend)
return minuend - subtrahend;
}
+static u32 allegro_channel_get_entropy_mode(struct allegro_channel *channel)
+{
+#define ALLEGRO_ENTROPY_MODE_CAVLC 0
+#define ALLEGRO_ENTROPY_MODE_CABAC 1
+
+ return ALLEGRO_ENTROPY_MODE_CAVLC;
+}
+
static int fill_create_channel_param(struct allegro_channel *channel,
struct create_channel_param *param)
{
@@ -974,6 +982,7 @@ static int fill_create_channel_param(struct allegro_channel *channel,
param->temporal_mvp_enable = channel->temporal_mvp_enable;
param->dbf_ovr_en = channel->dbf_ovr_en;
+ param->entropy_mode = allegro_channel_get_entropy_mode(channel);
param->rdo_cost_mode = 1;
param->custom_lda = 1;
param->lf = 1;