[FFmpeg-devel] [PATCH v4 13/18] avfilter/overlay_graphicsubs: Add overlay_graphicsubs and graphicsub2video filters

Soft Works softworkz at hotmail.com
Sat Sep 11 21:42:45 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Paul B Mahol
> Sent: Saturday, 11 September 2021 12:49
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v4 13/18]
> avfilter/overlay_graphicsubs: Add overlay_graphicsubs and
> graphicsub2video filters
> 
> You are still duplicating core overlaying code from overlay filter,
> among
> other things.
> 
> Filter should be in same file as vf_overlay filter, this is more
> demanding
> to do because its harder than code extraction/copy&paste and adding
> defines
> and extra variables/functions for different paths.

I've been afraid to do that because there are significant differences:

- The functions in vf_overlay are based on both images having the 
  same planes/layout, but in overlay_graphicsubs, the overlay image
  is always PAL8, even when overlaying on something like yuv420p

- For overlaying the PAL8 over YUV, it's most efficient to convert 
  the palette to YUV first, and then lookup in the converted palette
  while overlaying

Wouldn't you think that changing the code in vf_overlay to accommodate
for those cases, would add a bit too much complication? IMO, it would
make the resulting code hard to read and maintain.

I can still do it - are you sure I should?

Thanks,
softworkz


More information about the ffmpeg-devel mailing list