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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun May 1 19:06:59 CEST 2011


On Sun, May 01, 2011 at 06:45:34PM +0200, Alexandre Colucci wrote:
> It's good but since you mention "simpler" the table is not needed at all, you can remove it entirely and replace the line:
> 
> level = (0xff * j) / nb_opaque_colors;
> 
> with:
> 
> level = (nb_opaque_colors > 1) ? (0xff * j) / (nb_opaque_colors - 1) : 0xff;

Well, that's exactly the part that I wanted to "simplify", it took
me quite a long time to figure out with values this actually results in,
the table seemed a rather obvious (and simpler to tweak, e.g. concerning
rounding, though with the currently possible values rounding doesn't seem to matter)
way.


More information about the ffmpeg-devel mailing list