Re: [PATCH 4/7] media: v4l2: Make colorspace validity checks more future-proof

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30/06/2022 11:48, Laurent Pinchart wrote:
> On Thu, Jun 30, 2022 at 12:46:16PM +0300, Sakari Ailus wrote:
>> On Wed, Jun 29, 2022 at 03:50:47PM +0200, Hans Verkuil wrote:
>>>> @@ -585,8 +585,8 @@ static inline bool v4l2_is_hsv_enc_valid(__u8 hsv_enc)
>>>>  
>>>>  static inline bool v4l2_is_quant_valid(__u8 quantization)
>>>>  {
>>>> -	return quantization == V4L2_QUANTIZATION_FULL_RANGE ||
>>>> -	       quantization == V4L2_QUANTIZATION_LIM_RANGE;
>>>> +	return quantization > V4L2_QUANTIZATION_DEFAULT &&
>>>> +	       quantization < V4L2_QUANTIZATION_LAST;
>>>
>>> There are only two quantization ranges: full and limited. And I very sincerely
>>> hope there will never be a third!
>>
>> For consistency of the checks and definitions I prefer it how it's in the
>> patch. There's no functional difference though.
> 
> I'm ready to send a pull request for this patch once you and Hans agree
> on how this should be done :-) I also have a slight preference for
> consistency. Hans, what do you think ?
> 

Quantization Range is quite different from the others: where the other colorimetry
settings are regularly extended with new variants, quantization range is not.
Limited vs Full range is really a reflection of two parallel developments: TV and
PC monitors. We're stuck with it, but it is highly unlikely someone will ever
introduce a third option for this.

So suggesting that it can be extended by introducing a V4L2_QUANTIZATION_LAST gives
the wrong signal IMHO.

Regards,

	Hans



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux