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

James Almer jamrial at gmail.com
Mon Feb 5 04:25:15 EET 2024


On 2/3/2024 7:00 AM, Tomas Härdin wrote:
> 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?

An AVParser must not split (or assemble) a packet in a form that is not 
meant to be encapsulated in a container.
If you need to split a packet into smaller portions, you need a 
bitstream filter. See {vp9_superframe,av1_frame}_split.

> 
> 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
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list