[FFmpeg-devel] [PATCH] dvdsubenc: make it usable for transcoding.

Nicolas George nicolas.george at normalesup.org
Wed Aug 15 17:05:30 CEST 2012

Le nonidi 29 thermidor, an CCXX, Wolfram Gloger a écrit :
> I dropped reading ffmpeg-devel for the last month.  My fault.
> Just a question:  Were you aware of
> http://malloc.de/tools/ffmpeg-wg-patches-20110129a.tar.gz
> (in particular dvdsubenc.diff) when doing this?  If not, we were nicely
> duplicating effort :-(, but arrived at a very similar result :-)...

I am sorry, I was not aware anyone still maintained this: this part of the
code stayed the same for so long, even about three years ago when I posted a
very limited patch for the same reasons, I just assumed nobody at all cared.

> If you might take a look at my patchset, please look at the latest
> version:
> http://malloc.de/ffmpeg-patches/dvdsubenc.diff
> (applicable to HEAD of about a week ago)
> to see if we have arrived at the same feature set.  Your handling

It looks we have taken more or less the same direction indeed. It is a bit
hard to say for the lack of detailed commit messages.

> of alpha channel looks better than mine, but the merging of several
> subtitle rects into one IMHO is generally useful so I put into a
> function av_merge_subtitle().

Theoretically, this is true, but there is a catch: if I read it correctly,
your code assumes that all rectangles use the same palette, or at least
compatible palettes, and uses the largest. This is certainly a valid
assumption when the rectangles come from another subtitle codec, but this is
not guaranteed by the API. I almost used the same assumption too, but I
found a way of doing without.

My point is that due to the palette, merging the rectangles is a tricky
business, I do not think much code sharing can be achieved.

>				I was actually afraid that everyone would
> scream "this should go into a subtitle filter" and would thus complicate
> merging.  Also I think ff_squareTbl should be used for the color
> distance.

This is not really a speed-critical part of the code, I do not think the
extra obfuscation would be really worth it.

> In any case, a "heads up" mail to me would have been nice..

I am really sorry, I just assumed that no answer meant you were not
interested anymore; I realize that August is not the best month for that
assumption. Please let me know if you find changes I made incorrect.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120815/e66ecbf9/attachment.asc>

More information about the ffmpeg-devel mailing list