2018-09-02 06:37:04 -04:00
/* SPDX-License-Identifier: LGPL-2.1 */
2018-08-22 03:50:56 -04:00
/*
* 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 ;
2018-11-15 06:23:30 -05:00
unsigned int luma_alpha_step ;
2018-08-22 03:50:56 -04:00
unsigned int chroma_step ;
/* Chroma plane subsampling */
unsigned int width_div ;
unsigned int height_div ;
2018-11-15 06:23:30 -05:00
unsigned int components_num ;
2019-01-20 11:29:02 -02:00
unsigned int planes_num ;
2019-01-21 09:46:16 -02:00
unsigned int pixenc ;
2018-08-22 03:50:56 -04:00
} ;
struct v4l2_fwht_state {
const struct v4l2_fwht_pixfmt_info * info ;
2019-01-21 09:46:14 -02:00
unsigned int visible_width ;
unsigned int visible_height ;
unsigned int coded_width ;
unsigned int coded_height ;
unsigned int stride ;
2019-03-06 16:13:32 -05:00
unsigned int ref_stride ;
2018-08-22 03:50:56 -04:00
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 ;
2019-01-21 09:46:17 -02:00
struct fwht_cframe_hdr header ;
2018-08-22 03:50:56 -04:00
u8 * compressed_frame ;
2019-03-06 16:13:42 -05:00
u64 ref_frame_ts ;
2018-08-22 03:50:56 -04:00
} ;
const struct v4l2_fwht_pixfmt_info * v4l2_fwht_find_pixfmt ( u32 pixelformat ) ;
const struct v4l2_fwht_pixfmt_info * v4l2_fwht_get_pixfmt ( u32 idx ) ;
2019-03-06 16:13:34 -05:00
bool v4l2_fwht_validate_fmt ( const struct v4l2_fwht_pixfmt_info * info ,
u32 width_div , u32 height_div , u32 components_num ,
u32 pixenc ) ;
const struct v4l2_fwht_pixfmt_info * v4l2_fwht_find_nth_fmt ( u32 width_div ,
2019-01-21 09:46:16 -02:00
u32 height_div ,
u32 components_num ,
u32 pixenc ,
unsigned int start_idx ) ;
2018-08-22 03:50:56 -04:00
2018-09-10 11:00:39 -04:00
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 ) ;
2018-08-22 03:50:56 -04:00
# endif