/* SPDX-License-Identifier: GPL-2.0 */ /* * i.MX8QXP/i.MX8QM JPEG encoder/decoder v4l2 driver * * Copyright 2018-2019 NXP */ #include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-fh.h> #ifndef _MXC_JPEG_CORE_H #define _MXC_JPEG_CORE_H #define MXC_JPEG_NAME … #define MXC_JPEG_FMT_TYPE_ENC … #define MXC_JPEG_FMT_TYPE_RAW … #define MXC_JPEG_DEFAULT_WIDTH … #define MXC_JPEG_DEFAULT_HEIGHT … #define MXC_JPEG_DEFAULT_PFMT … #define MXC_JPEG_MIN_WIDTH … #define MXC_JPEG_MIN_HEIGHT … #define MXC_JPEG_MAX_WIDTH … #define MXC_JPEG_MAX_HEIGHT … #define MXC_JPEG_MAX_LINE … #define MXC_JPEG_MAX_CFG_STREAM … #define MXC_JPEG_H_ALIGN … #define MXC_JPEG_W_ALIGN … #define MXC_JPEG_MAX_SIZEIMAGE … #define MXC_JPEG_MAX_PLANES … enum mxc_jpeg_enc_state { … }; enum mxc_jpeg_mode { … }; /** * struct mxc_jpeg_fmt - driver's internal color format data * @name: format description * @fourcc: fourcc code, 0 if not applicable * @subsampling: subsampling of jpeg components * @nc: number of color components * @depth: number of bits per pixel * @mem_planes: number of memory planes (1 for packed formats) * @comp_planes:number of component planes, which includes the alpha plane (1 to 4). * @h_align: horizontal alignment order (align to 2^h_align) * @v_align: vertical alignment order (align to 2^v_align) * @flags: flags describing format applicability * @precision: jpeg sample precision * @is_rgb: is an RGB pixel format */ struct mxc_jpeg_fmt { … }; struct mxc_jpeg_desc { … } __packed; struct mxc_jpeg_q_data { … }; struct mxc_jpeg_ctx { … }; struct mxc_jpeg_slot_data { … }; struct mxc_jpeg_dev { … }; /** * struct mxc_jpeg_sof_comp - JPEG Start Of Frame component fields * @id: component id * @v: vertical sampling * @h: horizontal sampling * @quantization_table_no: id of quantization table */ struct mxc_jpeg_sof_comp { … } __packed; #define MXC_JPEG_MAX_COMPONENTS … /** * struct mxc_jpeg_sof - JPEG Start Of Frame marker fields * @length: Start of Frame length * @precision: precision (bits per pixel per color component) * @height: image height * @width: image width * @components_no: number of color components * @comp: component fields for each color component */ struct mxc_jpeg_sof { … } __packed; /** * struct mxc_jpeg_sos_comp - JPEG Start Of Scan component fields * @id: component id * @huffman_table_no: id of the Huffman table */ struct mxc_jpeg_sos_comp { … } __packed; /** * struct mxc_jpeg_sos - JPEG Start Of Scan marker fields * @length: Start of Frame length * @components_no: number of color components * @comp: SOS component fields for each color component * @ignorable_bytes: ignorable bytes */ struct mxc_jpeg_sos { … } __packed; #endif