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

Hendrik Leppkes h.leppkes at gmail.com
Mon Feb 19 10:22:42 EET 2024


On Mon, Feb 19, 2024 at 12:44 AM Marton Balint <cus at passwd.hu> wrote:
>
>
>
> On Fri, 16 Feb 2024, Anton Khirnov wrote:
>
> > Quoting Tomas Härdin (2024-02-03 20:58:20)
> >> I think people with knowledge how interlacing is handled in other
> >> formats and codecs might want to chime in.
> >
> > For MPEG codecs our decoders always output (properly signalled)
> > interlaced content as two interleaved fields in a single AVFrame flagged
> > with AV_FRAME_FLAG_INTERLACED. Its height is the height of the whole
> > frame, so double the number of lines in each field.
> >
> > So IIUC this patch is taking the correct approach.
>
> I believe interlaced HEVC has the same issue, the decoder generates field
> pictures and not frames. Would changing the HEVC decoder be acceptable to
> generate frames with interleaved fields?
>

Absolutely.
There have been WIP patches in the past that tried to do this, but
resorting to memcpy instead of updating the decoder to write to every
second line, and that should of course be avoided.
HEVC also has HWAccel, which should work as well in the same manner,
if possible.

- Hendrik


More information about the ffmpeg-devel mailing list