[FFmpeg-devel] [PATCH] Fix colors for DVD subtitles

Alexandre Colucci alexandre at elgato.com
Fri Apr 29 10:11:55 CEST 2011


On 27 avr. 2011, at 22:57, Reimar Döffinger wrote:

> On Wed, Apr 27, 2011 at 12:31:14PM +0200, Alexandre Colucci wrote:
>> On 26 avr. 2011, at 22:08, Reimar Döffinger wrote:
>>>> Just compare the attached screenshots attached to the patch, they speak for themselves. The screenshots are from Con Air btw, not from some handmade source.
>>> 
>>> I don't doubt that it works for your case, I just don't believe it
>>> works for all (even just all commercial) DVDs.
>> 
>> I haven't seen it not working ever but I am addressing that issue in the attached new patch.
> 
> Ok, I really should have done this earlier but I decided to
> get some actual data.
> Below is the list for different DVDs, alpha and brightness (Y),
> all 4 entries:
> 
> f 10 f 10 f d1 0 28
> f 10 f eb f 51 0 10
> f 10 f 80 f b0 0 10
> f 10 f 10 f eb 0 eb
> f 10 f 80 f b0 0 10
> f 10 f 10 f d1 0 28
> f 10 f ea f ea 0 ea
> f d7 f 62 f 24 0 b4
> f 10 f 7d f d9 0 10
> f 10 f eb f 5d 0 5d
> f 10 f 7e f eb 0 eb
> f 10 f 80 f b0 0 10
> f 62 f d7 f 24 0 ea
> f 10 f 7b f d1 0 ea
> f 7b f 1e f dc 0 10
> f 10 f 7b f ea 0 ea
> f 10 f 7b f ea 0 ea
> f 10 f ea f ea 0 ea
> 
> General conclusion: Nobody uses alpha.


The above table is incomplete, I would need the following values for my tests:

- Cr and Cb values
- colormap values (4 values in the range 0-15)


> So code that takes
> it into account is just pointless complexity.
> Next, your proposal seems to work better in most cases.


If it works better than we are in agreement.


> Clear exception where the previous code worked better is
> f d7 f 62 f 24 0 b4 (from German version of Hellboy).

It is not clear at all, you are comparing Y with RGB. Again the counter example needs to be backed by real values.
Also note that guess_palette takes into account a user preference, so comparing whether the user preference matches the actual color is pointless.

One last note: if your source of DVDsubs is ripped idx/sub that you downloaded, a lot of it is generated by various tools and are quite different from the originals.

Alexandre




More information about the ffmpeg-devel mailing list