[FFmpeg-devel] [PATCH] Fix colors for DVD subtitles
michaelni at gmx.at
Sat Apr 23 22:45:16 CEST 2011
On Sat, Apr 23, 2011 at 10:10:52PM +0200, Reimar Döffinger wrote:
> On Sat, Apr 23, 2011 at 12:46:09PM -0700, Baptiste Coudurier wrote:
> > On 4/23/11 8:41 AM, Reimar Döffinger wrote:
> > > On Thu, Apr 21, 2011 at 11:25:33AM +0200, Alexandre Colucci wrote:
> > >> Hi,
> > >>
> > >> This patch fixes the DVD subtitle colors/alpha info. See screenshots for before and after the patch.
> > >
> > > I don't think that is correct.
> > > First, the yellow colour was chosen on purpose, and a lot of DVDs
> > > use yellow but in principle one is as good as the other.
> > > Secondly the function is called guess_palette for a reason:
> > > It is a guess. It will be wrong. But so will yours.
> > > Unless you have very good data to believe that yours actually
> > > works better significantly more often I don't think there's a
> > > good reason to change the code.
> > Well, I think yellow is ugly personally, I like the patch if it works in
> > a lot of cases.
> Well, I don't particularly mind that part, but it definitely shouldn't
> be committed as a "fix", it does not fix anything it just changes the
> default colour.
> For the other part I definitely want a bit more proof of usefulness,
> there is no value in it if we end up mindlessly switching back and
> forth between equally bad solutions just depending on which broken
> DVD images someone has.
> Note that in most cases after decoding the first subtitle it should
> be possible to guess quite reliably by analyzing the image, but it
> is going to be non-trivial.
> E.g. fully transparent should be most frequent, fully opaque second-most.
The most common on the border pixels should be transparent, this might
be slightly more reliable
> Finding gradients between those should allow figuring out the other two.
they remainibg 2-3 can be tried by brute force (2 or 6 options)
and then the resulting grayscale compressed by jpeg or anything else.
the one compressing best is likely the correct one
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Opposition brings concord. Out of discord comes the fairest harmony.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel