summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vicodec/codec-v4l2-fwht.h
diff options
context:
space:
mode:
authorHans Verkuil2018-08-22 09:50:56 +0200
committerMauro Carvalho Chehab2018-08-31 14:29:13 +0200
commitcd12b401adc3cdfa643172f664aa28ecebbd3b67 (patch)
treebaacd5d372abfb9bc1756b35ccedad3d4f92f6f8 /drivers/media/platform/vicodec/codec-v4l2-fwht.h
parentmedia: vicodec: rename and use proper fwht prefix for codec (diff)
downloadkernel-qcow2-linux-cd12b401adc3cdfa643172f664aa28ecebbd3b67.tar.gz
kernel-qcow2-linux-cd12b401adc3cdfa643172f664aa28ecebbd3b67.tar.xz
kernel-qcow2-linux-cd12b401adc3cdfa643172f664aa28ecebbd3b67.zip
media: vicodec: split off v4l2 specific parts for the codec
Split off the decode and encode functions into a separate source that can be reused elsewhere. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vicodec/codec-v4l2-fwht.h')
-rw-r--r--drivers/media/platform/vicodec/codec-v4l2-fwht.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/media/platform/vicodec/codec-v4l2-fwht.h b/drivers/media/platform/vicodec/codec-v4l2-fwht.h
new file mode 100644
index 000000000000..7794c186d905
--- /dev/null
+++ b/drivers/media/platform/vicodec/codec-v4l2-fwht.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ */
+
+#ifndef CODEC_V4L2_FWHT_H
+#define CODEC_V4L2_FWHT_H
+
+#include "codec-fwht.h"
+
+struct v4l2_fwht_pixfmt_info {
+ u32 id;
+ unsigned int bytesperline_mult;
+ unsigned int sizeimage_mult;
+ unsigned int sizeimage_div;
+ unsigned int luma_step;
+ unsigned int chroma_step;
+ /* Chroma plane subsampling */
+ unsigned int width_div;
+ unsigned int height_div;
+};
+
+struct v4l2_fwht_state {
+ const struct v4l2_fwht_pixfmt_info *info;
+ unsigned int width;
+ unsigned int height;
+ unsigned int gop_size;
+ unsigned int gop_cnt;
+ u16 i_frame_qp;
+ u16 p_frame_qp;
+
+ enum v4l2_colorspace colorspace;
+ enum v4l2_ycbcr_encoding ycbcr_enc;
+ enum v4l2_xfer_func xfer_func;
+ enum v4l2_quantization quantization;
+
+ struct fwht_raw_frame ref_frame;
+ u8 *compressed_frame;
+};
+
+const struct v4l2_fwht_pixfmt_info *v4l2_fwht_find_pixfmt(u32 pixelformat);
+const struct v4l2_fwht_pixfmt_info *v4l2_fwht_get_pixfmt(u32 idx);
+
+unsigned int v4l2_fwht_encode(struct v4l2_fwht_state *state,
+ u8 *p_in, u8 *p_out);
+
+int v4l2_fwht_decode(struct v4l2_fwht_state *state,
+ u8 *p_in, u8 *p_out);
+
+#endif