Re: [PATCH v3 6/7] media: Add controls for JPEG quantization tables
From: Tomasz Figa <hidden>
Date: 2018-08-29 03:00:18
Also in:
linux-media, linux-rockchip
On Wed, Aug 29, 2018 at 11:50 AM Ezequiel Garcia [off-list ref] wrote:
On Mon, 2018-08-27 at 09:47 +0200, Paul Kocialkowski wrote:quoted
Hi, On Wed, 2018-08-22 at 13:59 -0300, Ezequiel Garcia wrote:quoted
From: Shunqian Zheng <redacted> Add V4L2_CID_JPEG_LUMA/CHROMA_QUANTIZATION controls to allow userspace configure the JPEG quantization tables.How about having a single control for quantization? In MPEG-2/H.264/H.265, we have a single control exposed as a structure, which contains the tables for both luma and chroma. In the case of JPEG, it's not that big a deal, but for advanced video formats, it would be too much hassle to have one control per table. In order to keep the interface consistent, I think it'd be best to merge both matrices into a single control. What do you think?I think it makes a lot of sense. I don't see the benefit in having luma and chroma separated, and consistency is good. I guess the more consistent solution would be to expose a compound control, similar to the video quantization one. struct v4l2_ctrl_jpeg_quantization { __u8 luma_quantization_matrix[64]; __u8 chroma_quantization_matrix[64]; };
Makes sense indeed. It also lets us avoid the hassle of setting .min/.max/.dims and other array control stuff, since everything is already defined by the C struct itself. Best regards, Tomasz