[FFmpeg-devel] [PATCH] avcodec/jpeg2000dec: support of 2 fields in 1 AVPacket

Tomas Härdin git at haerdin.se
Sat Feb 3 12:00:34 EET 2024


fre 2024-02-02 klockan 16:55 +0100 skrev Jerome Martinez:
> Before this patch, the FFmpeg MXF parser correctly detects content
> with 
> 2 fields in 1 AVPacket as e.g. interlaced 720x486 but the FFmpeg JPEG
> 2000 decoder reads the JPEG 2000 SIZ header without understanding
> that 
> the indicated height is the height of 1 field only so overwrites the 
> frame size info with e.g. 720x243, and also completely discards the 
> second frame, which lead to the decoding of only half of the stored 
> content as "progressive" 720x243 flagged interlaced.

Is the decoder really the right place to do this? Surely this happens
with more codecs than just j2k. Isnt it also a parser's job to do this
kind of stuff?

The logic that scans the packet for two SOI markers shouldn't be
necessary if the relevant information is carried over from the MXF
demuxer. It also makes the j2k decoder harder to ||ize. You might also
need the StoredF2Offset

/Tomas


More information about the ffmpeg-devel mailing list