1 /* SPDX-License-Identifier: LGPL-2.1 */
3 * Copyright 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
6 #ifndef CODEC_V4L2_FWHT_H
7 #define CODEC_V4L2_FWHT_H
9 #include "codec-fwht.h"
11 struct v4l2_fwht_pixfmt_info
{
13 unsigned int bytesperline_mult
;
14 unsigned int sizeimage_mult
;
15 unsigned int sizeimage_div
;
16 unsigned int luma_alpha_step
;
17 unsigned int chroma_step
;
18 /* Chroma plane subsampling */
19 unsigned int width_div
;
20 unsigned int height_div
;
21 unsigned int components_num
;
22 unsigned int planes_num
;
26 struct v4l2_fwht_state
{
27 const struct v4l2_fwht_pixfmt_info
*info
;
28 unsigned int visible_width
;
29 unsigned int visible_height
;
30 unsigned int coded_width
;
31 unsigned int coded_height
;
33 unsigned int ref_stride
;
34 unsigned int gop_size
;
39 enum v4l2_colorspace colorspace
;
40 enum v4l2_ycbcr_encoding ycbcr_enc
;
41 enum v4l2_xfer_func xfer_func
;
42 enum v4l2_quantization quantization
;
44 struct fwht_raw_frame ref_frame
;
45 struct fwht_cframe_hdr header
;
50 const struct v4l2_fwht_pixfmt_info
*v4l2_fwht_find_pixfmt(u32 pixelformat
);
51 const struct v4l2_fwht_pixfmt_info
*v4l2_fwht_get_pixfmt(u32 idx
);
52 bool v4l2_fwht_validate_fmt(const struct v4l2_fwht_pixfmt_info
*info
,
53 u32 width_div
, u32 height_div
, u32 components_num
,
55 const struct v4l2_fwht_pixfmt_info
*v4l2_fwht_find_nth_fmt(u32 width_div
,
59 unsigned int start_idx
);
61 int v4l2_fwht_encode(struct v4l2_fwht_state
*state
, u8
*p_in
, u8
*p_out
);
62 int v4l2_fwht_decode(struct v4l2_fwht_state
*state
, u8
*p_in
, u8
*p_out
);