• Nicolas George's avatar
    dvdsubenc: make it usable for transcoding. · 2dedd8f4
    Nicolas George authored
    DVD subtitles packets can only encode a single rectangle:
    if there are several, copy them into a big transparent one.
    
    DVD subtitles rely on an external 16-colors palette:
    use a reasonable default one, stored in the private context,
    and encode it into the extradata, as specified by Matroska.
    TODO: allow to change the palette with an option.
    
    Each packet can use four colors out of the global palette.
    The old logic was to map transparent colors to the color 0
    and all other colors to 3, 2, 1, cyclically in descending
    frequency order, completely disregarding the original color.
    
    Select the "best" four colors from the global palette, according
    to heuristics based on frequency, opacity and brightness, and
    arrange them in standard DVD order: background, foreground,
    outline, other.
    TODO: select the alpha value more finely; see if CHG_COLCON can
    allow more than 4 colors per packet.
    
    Reference:
    http://dvd.sourceforge.net/dvdinfo/spu.html
    
    With these changes, dvdsubenc can be used to transcode DVB subtitles
    and get a very decent result.
    2dedd8f4
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
mt-work Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
Doxyfile Loading commit data...
INSTALL Loading commit data...
LICENSE Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
RELEASE Loading commit data...
arch.mak Loading commit data...
cmdutils.c Loading commit data...
cmdutils.h Loading commit data...
cmdutils_common_opts.h Loading commit data...
common.mak Loading commit data...
configure Loading commit data...
ffmpeg.c Loading commit data...
ffmpeg.h Loading commit data...
ffmpeg_filter.c Loading commit data...
ffmpeg_opt.c Loading commit data...
ffplay.c Loading commit data...
ffprobe.c Loading commit data...
ffserver.c Loading commit data...
library.mak Loading commit data...
version.sh Loading commit data...