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 gop_size
;
38 enum v4l2_colorspace colorspace
;
39 enum v4l2_ycbcr_encoding ycbcr_enc
;
40 enum v4l2_xfer_func xfer_func
;
41 enum v4l2_quantization quantization
;
43 struct fwht_raw_frame ref_frame
;
44 struct fwht_cframe_hdr header
;
48 const struct v4l2_fwht_pixfmt_info
*v4l2_fwht_find_pixfmt(u32 pixelformat
);
49 const struct v4l2_fwht_pixfmt_info
*v4l2_fwht_get_pixfmt(u32 idx
);
50 const struct v4l2_fwht_pixfmt_info
*v4l2_fwht_default_fmt(u32 width_div
,
54 unsigned int start_idx
);
56 int v4l2_fwht_encode(struct v4l2_fwht_state
*state
, u8
*p_in
, u8
*p_out
);
57 int v4l2_fwht_decode(struct v4l2_fwht_state
*state
, u8
*p_in
, u8
*p_out
);