Supplying image in yuv422 format?

129 views
Skip to first unread message

Silicontrip

unread,
Apr 21, 2020, 3:22:26 AM4/21/20
to libjpeg-turbo User Discussion/Support
Hi there,

I'm wondering if it's possible to supply chroma subsampled data to the jpeg compressor?  I know I can pass YUV444 data to it, but it seems a bit silly to me to upsample my 422 data to 444 to have it downsampled to 422 again.
I know that this is more of a general jpeglib question, if there is a better place to ask this let me know, I can't seem to find a developer forum for it.

Thanks heaps.

DRC

unread,
Apr 22, 2020, 12:02:14 AM4/22/20
to libjpeg-t...@googlegroups.com
Technically speaking, you can supply any planar YUV data with any
subsampling configuration to the compressor by using the
jpeg_write_raw_data() function in the libjpeg API, but that function is
not particularly user-friendly.  The TurboJPEG API provides a much
friendlier way to do that, using the tjCompressFromYUV() function (API
documentation is here:
https://libjpeg-turbo.org/Documentation/Documentation).  It will handle
4:4:4, 4:2:2, 4:2:0, grayscale, 4:4:0, and 4:1:1.  libjpeg-turbo, in
general, does not handle packed YUV formats.  It only handles planar
formats because that's what JPEG uses under the hood.

This is the appropriate forum for this question, because in the case of
libjpeg-turbo, "users" are developers.  libjpeg-turbo-devel is used for
questions pertaining to the development of libjpeg-turbo itself.
Reply all
Reply to author
Forward
0 new messages