[FFmpeg-devel] query on pixel formats
Michael Niedermayer
michael at niedermayer.cc
Wed Jun 17 22:58:48 EEST 2020
On Wed, Jun 17, 2020 at 04:22:06PM +0530, Gautam Ramakrishnan wrote:
> Hi all,
>
> I am working on the JPEG2000 decoder. However I am having trouble
> understanding pixel formats correctly.
> For example, from my understanding, the reference file p1_01.j2k pixel
> format does not get recognized by the native decoder. When I force a
> gray8 format on it, I am able to get output similar to opj_decompress
> (I have made other modifications to the decoder as well).
> It would be great if I could be referred to some documentation which
> would help me understand how exactly the pixel format selection works.
for libavcodec in general the decoder sets the format in
AVCodecContext.pix_fmt,
for interpreting what each format is you can see
libavutil/pixdesc.*
libavutil/pixfmt.h
There are also a few other colospace related fields color_primaries, color_trc, colorspace, color_range, chroma_sample_location
to choose the pix_fmt for a jpeg2000 image, the code is IIRC basically trying
to guess it from various fields from the jpeg2000
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
There will always be a question for which you do not know the correct answer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200617/0d4ae829/attachment.sig>
More information about the ffmpeg-devel
mailing list