This documentation page says, “The JPEG decoder is capable of decoding YUV420, YUV422, and YUV444 JPEG images. Note: Only the JCS_YCbCr (YUV420) color space is currently supported.”
It’s not clear from the datasheet whether this lack of support for anything other than YUV420 is a hardware constraint or a software constraint. As I understand the statement, even JPEGs encoded in YUV444 are downsampled to YUV420 when decoded — that causes a loss of quality. Are there any plans to support YUV444 output or any higher-quality format (goal is BGR in a Python Numpy array!) in the API?
Yes, I understand I can convert the YUV420 output to YUV444 easily and do see how to do it, but wouldn’t the image suffer a loss of quality due to passing through YUV420, as YUV420 uses 2x2 subsampling and YUV444 does not? The YUV444 conversion from YUV420 decoding output presumably would not match the quality that you’d have if the image was decoded in YUV444 format in the first place.
I think your code might be slightly off; I expect it will print color format is YUV444 if the color format is non-zero (anything but NVBUF_COLOR_FORMAT_INVALID), but both when I run your code and code modified to unconditionally print the colorFormat, I ascertain that the color format is NVBUF_COLOR_FORMAT_YUV444, which is what I want and not what I expected based on the documentation.
Thanks for the clarification and for your always-timely and incisive effort. I suppose I should have tested this myself and not relied on the documentation, which reads (to me, at least) that YUV420 is the only possible output. Hopefully, you can have it updated to clarify.