Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: LGPL-2.1 */
0002 /*
0003  * Copyright 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
0004  */
0005 
0006 #ifndef CODEC_V4L2_FWHT_H
0007 #define CODEC_V4L2_FWHT_H
0008 
0009 #include "codec-fwht.h"
0010 
0011 struct v4l2_fwht_pixfmt_info {
0012     u32 id;
0013     unsigned int bytesperline_mult;
0014     unsigned int sizeimage_mult;
0015     unsigned int sizeimage_div;
0016     unsigned int luma_alpha_step;
0017     unsigned int chroma_step;
0018     /* Chroma plane subsampling */
0019     unsigned int width_div;
0020     unsigned int height_div;
0021     unsigned int components_num;
0022     unsigned int planes_num;
0023     unsigned int pixenc;
0024 };
0025 
0026 struct v4l2_fwht_state {
0027     const struct v4l2_fwht_pixfmt_info *info;
0028     unsigned int visible_width;
0029     unsigned int visible_height;
0030     unsigned int coded_width;
0031     unsigned int coded_height;
0032     unsigned int stride;
0033     unsigned int ref_stride;
0034     unsigned int gop_size;
0035     unsigned int gop_cnt;
0036     u16 i_frame_qp;
0037     u16 p_frame_qp;
0038 
0039     enum v4l2_colorspace colorspace;
0040     enum v4l2_ycbcr_encoding ycbcr_enc;
0041     enum v4l2_xfer_func xfer_func;
0042     enum v4l2_quantization quantization;
0043 
0044     struct fwht_raw_frame ref_frame;
0045     struct fwht_cframe_hdr header;
0046     u8 *compressed_frame;
0047     u64 ref_frame_ts;
0048 };
0049 
0050 const struct v4l2_fwht_pixfmt_info *v4l2_fwht_find_pixfmt(u32 pixelformat);
0051 const struct v4l2_fwht_pixfmt_info *v4l2_fwht_get_pixfmt(u32 idx);
0052 bool v4l2_fwht_validate_fmt(const struct v4l2_fwht_pixfmt_info *info,
0053                 u32 width_div, u32 height_div, u32 components_num,
0054                 u32 pixenc);
0055 const struct v4l2_fwht_pixfmt_info *v4l2_fwht_find_nth_fmt(u32 width_div,
0056                               u32 height_div,
0057                               u32 components_num,
0058                               u32 pixenc,
0059                               unsigned int start_idx);
0060 
0061 int v4l2_fwht_encode(struct v4l2_fwht_state *state, u8 *p_in, u8 *p_out);
0062 int v4l2_fwht_decode(struct v4l2_fwht_state *state, u8 *p_in, u8 *p_out);
0063 
0064 #endif