1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
FFmpeg/libavcodec
Nicolas George 2dedd8f496 dvdsubenc: make it usable for transcoding.
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.
2012-08-14 11:17:45 +02:00
..
alpha
arm
avr32
bfin
mips
ppc
sh4
sparc
x86 Merge remote-tracking branch 'qatar/master' 2012-08-13 14:38:43 +02:00
4xm.c
8bps.c
8svx.c
a64colors.h
a64enc.h
a64multienc.c
a64tables.h
aac_ac3_parser.c
aac_ac3_parser.h
aac_adtstoasc_bsf.c
aac_parser.c
aac_tablegen_decl.h
aac_tablegen.c
aac_tablegen.h
aac.h
aacadtsdec.c
aacadtsdec.h
aaccoder.c
aacdec.c Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
aacdectab.h
aacenc.c
aacenc.h
aacps_tablegen.c
aacps_tablegen.h
aacps.c
aacps.h
aacpsdata.c
aacpsdsp.c
aacpsdsp.h
aacpsy.c
aacpsy.h
aacsbr.c
aacsbr.h
aacsbrdata.h
aactab.c
aactab.h
aandcttab.c
aandcttab.h
aasc.c
ac3_parser.c
ac3_parser.h
ac3.c
ac3.h
ac3dec_data.c
ac3dec_data.h
ac3dec.c
ac3dec.h
ac3dsp.c
ac3dsp.h
ac3enc_fixed.c
ac3enc_float.c
ac3enc_opts_template.c
ac3enc_template.c
ac3enc.c
ac3enc.h
ac3tab.c
ac3tab.h
acelp_filters.c
acelp_filters.h
acelp_pitch_delay.c
acelp_pitch_delay.h
acelp_vectors.c
acelp_vectors.h
adpcm_data.c
adpcm_data.h
adpcm.c
adpcm.h
adpcmenc.c
adx_parser.c
adx.c
adx.h
adxdec.c
adxenc.c
alac.c
alacenc.c
allcodecs.c
alsdec.c
amr.h
amrnbdata.h
amrnbdec.c
amrwbdata.h
amrwbdec.c
anm.c
ansi.c
apedec.c
ass_split.c
ass_split.h
ass.c
ass.h
assdec.c
assenc.c
asv1.c
atrac1.c
atrac1data.h
atrac3.c
atrac3data.h
atrac.c
atrac.h
audio_frame_queue.c
audio_frame_queue.h
audioconvert.c
audioconvert.h
aura.c
avcodec.h lavc: add codec_descriptor field to AVCodecContext. 2012-08-12 14:51:19 +02:00
avfft.c
avfft.h
avpacket.c
avs.c
avuidec.c
avuienc.c
bethsoftvideo.c
bethsoftvideo.h
bfi.c
bgmc.c
bgmc.h
bink.c
binkaudio.c
binkdata.h
binkdsp.c
binkdsp.h
bintext.c
bintext.h
bit_depth_template.c
bitstream_filter.c
bitstream.c
bmp_parser.c
bmp.c
bmp.h
bmpenc.c
bmv.c
bytestream.h
c93.c
cabac_functions.h
cabac.c
cabac.h
cavs_parser.c
cavs.c
cavs.h
cavsdata.h
cavsdec.c cavsdec: check dimensions being valid. 2012-08-11 02:00:33 +02:00
cavsdsp.c
cavsdsp.h
cbrt_tablegen.c
cbrt_tablegen.h
cdgraphics.c
cdxl.c
celp_filters.c Merge remote-tracking branch 'qatar/master' 2012-08-13 14:38:43 +02:00
celp_filters.h
celp_math.c
celp_math.h
cga_data.c
cga_data.h
chomp_bsf.c
cinepak.c
cljr.c
cllc.c cllc: Implement ARGB support 2012-08-12 15:21:15 -04:00
codec_desc.c lavc: add missing codec descriptors. 2012-08-13 10:45:04 +02:00
codec_names.sh
cook_parser.c
cook.c
cookdata.h
cos_tablegen.c
crystalhd.c
cscd.c
cyuv.c
dca_parser.c
dca_parser.h
dca.c
dca.h
dcadata.h
dcadec.c
dcadsp.c
dcadsp.h
dcaenc.c
dcaenc.h
dcahuff.h
dct32_fixed.c
dct32_float.c
dct32.c
dct32.h
dct-test.c
dct.c
dct.h
dctref.c
dctref.h
dfa.c
dirac_arith.c
dirac_arith.h
dirac_parser.c
dirac.c
dirac.h
diracdec.c
diracdsp.c
diracdsp.h
dnxhd_parser.c
dnxhddata.c
dnxhddata.h
dnxhddec.c
dnxhdenc.c Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
dnxhdenc.h
dpcm.c
dpx.c
dpxenc.c
dsicinav.c
dsputil_template.c dsputil_template: switch to av_assert 2012-08-11 16:58:18 +02:00
dsputil.c
dsputil.h
dump_extradata_bsf.c
dv_profile.c
dv_profile.h
dv_tablegen.c
dv_tablegen.h
dv_vlc_data.h
dv.c
dvbsub_parser.c
dvbsub.c dvbsub: reindent after last commit. 2012-08-09 11:22:11 +02:00
dvbsubdec.c
dvdata.c
dvdata.h
dvdec.c
dvdsub_parser.c
dvdsubdec.c
dvdsubenc.c dvdsubenc: make it usable for transcoding. 2012-08-14 11:17:45 +02:00
dwt.c dwt: switch to av_assert 2012-08-11 05:31:59 +02:00
dwt.h
dxa.c
dxtory.c
dxva2_h264.c
dxva2_internal.h
dxva2_mpeg2.c
dxva2_vc1.c
dxva2.c
dxva2.h
eac3_data.c
eac3_data.h
eac3dec.c
eac3enc.c
eac3enc.h
eacmv.c
eaidct.c
eaidct.h
eamad.c
eatgq.c
eatgv.c
eatqi.c
elbg.c
elbg.h
error_resilience.c
escape124.c
escape130.c
exr.c
faandct.c
faandct.h
faanidct.c
faanidct.h
faxcompr.c
faxcompr.h
fft_fixed.c
fft_float.c
fft-fixed-test.c
fft-internal.h
fft-test.c
fft.c
fft.h
ffv1.c
ffwavesynth.c
flac_parser.c
flac.c
flac.h
flacdata.c
flacdata.h
flacdec.c
flacdsp_template.c
flacdsp.c
flacdsp.h
flacenc.c
flashsv2enc.c
flashsv.c
flashsvenc.c
flicvideo.c
flv.h
flvdec.c
flvenc.c
fmtconvert.c
fmtconvert.h
frame_thread_encoder.c
frame_thread_encoder.h
fraps.c
frwu.c
g722.c
g722.h
g722dec.c
g722enc.c
g723_1_data.h
g723_1.c g723_1dec: inline normalize_bits() in scale vector and optimize it. 2012-08-13 15:18:47 +02:00
g726.c
g729.h
g729data.h
g729dec.c
g729postfilter.c
g729postfilter.h
get_bits.h
gif.c
gifdec.c
golomb-test.c
golomb.c
golomb.h
gsm_parser.c
gsm.h
gsmdec_data.c
gsmdec_data.h
gsmdec_template.c
gsmdec.c
h261_parser.c
h261.c
h261.h
h261data.c
h261data.h
h261dec.c
h261enc.c
h263_parser.c
h263_parser.h
h263.c
h263.h
h263data.h
h263dec.c
h264_cabac.c
h264_cavlc.c h264_cavlc: switch forgotten assert to av_assert 2012-08-13 05:59:44 +02:00
h264_direct.c
h264_loopfilter.c
h264_mb_template.c
h264_mc_template.c
h264_mp4toannexb_bsf.c
h264_mvpred.h
h264_parser.c
h264_ps.c
h264_refs.c
h264_sei.c h264: fix x264 build detection 2012-08-13 04:58:15 +02:00
h264.c
h264.h
h264data.h
h264dsp_template.c
h264dsp.c
h264dsp.h
h264idct_template.c
h264idct.c
h264pred_template.c
h264pred.c
h264pred.h
huffman.c
huffman.h
huffyuv.c
idcinvideo.c
iff.c
iirfilter.c
iirfilter.h
imc.c
imcdata.h
imgconvert.c
imgconvert.h
imx_dump_header_bsf.c
indeo2.c
indeo2data.h
indeo3.c
indeo3data.h
indeo4.c
indeo4data.h
indeo5.c
indeo5data.h
intelh263dec.c
internal.h
interplayvideo.c
intrax8.c
intrax8.h
intrax8dsp.c
intrax8huf.h
inverse.c
ituh263dec.c
ituh263enc.c
ivi_common.c
ivi_common.h
ivi_dsp.c
ivi_dsp.h
j2k_dwt.c
j2k_dwt.h
j2k.c
j2k.h
j2kdec.c
j2kenc.c
jacosub.h
jacosubdec.c
jfdctfst.c
jfdctint_template.c
jfdctint.c
jpegls.c
jpegls.h
jpeglsdec.c
jpeglsdec.h
jpeglsenc.c
jrevdct.c
jvdec.c
kbdwin.c
kbdwin.h
kgv1dec.c
kmvc.c
lagarith.c
lagarithrac.c
lagarithrac.h
latm_parser.c
lcl.h
lcldec.c
lclenc.c
libaacplus.c
libavcodec.v
libcelt_dec.c
libfaac.c
libfdk-aacenc.c
libgsm.c
libilbc.c
libmp3lame.c
libopencore-amr.c
libopenjpegdec.c
libopenjpegenc.c
libopus_dec.c
libschroedinger.c
libschroedinger.h
libschroedingerdec.c
libschroedingerenc.c
libspeexdec.c
libspeexenc.c
libstagefright.cpp
libtheoraenc.c
libtwolame.c
libutvideo.h
libutvideodec.cpp
libutvideoenc.cpp
libvo-aacenc.c
libvo-amrwbenc.c
libvorbisdec.c
libvorbisenc.c
libvpxdec.c
libvpxenc.c
libx264.c
libxavs.c
libxvid_rc.c
libxvid.c
libxvid.h
ljpegenc.c
loco.c
lpc.c
lpc.h
lsp.c
lsp.h
lzw.c
lzw.h
lzwenc.c
mace.c
Makefile vda: merge implementation into one file. 2012-08-14 03:39:31 +02:00
mathops.h Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
mdct_fixed.c
mdct_float.c
mdct.c
mdec.c
microdvddec.c
mimic.c
mjpeg2jpeg_bsf.c
mjpeg_parser.c
mjpeg.c
mjpeg.h
mjpega_dump_header_bsf.c
mjpegbdec.c
mjpegdec.c mjpegdec: support AVRn interlaced 2012-08-10 15:56:14 +02:00
mjpegdec.h
mjpegenc.c
mjpegenc.h
mlp_parser.c
mlp_parser.h
mlp.c
mlp.h
mlpdec.c
mlpdsp.c
mmvideo.c
motion_est_template.c
motion_est.c Merge remote-tracking branch 'qatar/master' 2012-08-10 04:46:13 +02:00
motion-test.c
motionpixels_tablegen.c
motionpixels_tablegen.h
motionpixels.c
movsub_bsf.c
movtextdec.c
movtextenc.c
mp3_header_compress_bsf.c
mp3_header_decompress_bsf.c
mpc7.c
mpc7data.h
mpc8.c
mpc8data.h
mpc8huff.h
mpc.c
mpc.h
mpcdata.h
mpeg4audio.c
mpeg4audio.h
mpeg4data.h
mpeg4video_parser.c
mpeg4video_parser.h
mpeg4video.c
mpeg4video.h
mpeg4videodec.c
mpeg4videoenc.c
mpeg12.c
mpeg12.h
mpeg12data.c
mpeg12data.h
mpeg12decdata.h
mpeg12enc.c Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
mpegaudio_parser.c
mpegaudio_tablegen.c
mpegaudio_tablegen.h
mpegaudio.c
mpegaudio.h
mpegaudiodata.c
mpegaudiodata.h
mpegaudiodec_float.c
mpegaudiodec.c
mpegaudiodecheader.c
mpegaudiodecheader.h
mpegaudiodectab.h
mpegaudiodsp_fixed.c
mpegaudiodsp_float.c
mpegaudiodsp_template.c
mpegaudiodsp.c
mpegaudiodsp.h
mpegaudioenc.c
mpegaudiotab.h
mpegvideo_enc.c Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
mpegvideo_motion.c Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
mpegvideo_parser.c
mpegvideo_xvmc.c
mpegvideo.c Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
mpegvideo.h Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
mqc.c
mqc.h
mqcdec.c
mqcenc.c
msgsmdec.c
msgsmdec.h
msmpeg4.c Merge remote-tracking branch 'qatar/master' 2012-08-09 19:31:56 +02:00
msmpeg4.h
msmpeg4data.c
msmpeg4data.h
msmpeg4enc.c
msrle.c msrle: fix regression causing null ptr dereference 2012-08-11 02:20:06 +02:00
msrledec.c
msrledec.h
mss1.c
mss3.c
mss4.c
mss34dsp.c
mss34dsp.h
msvideo1.c
msvideo1enc.c
mxpegdec.c
nellymoser.c
nellymoser.h
nellymoserdec.c
nellymoserenc.c
noise_bsf.c
nuv.c
old_codec_ids.h Merge remote-tracking branch 'qatar/master' 2012-08-11 15:01:45 +02:00
options_table.h
options.c
os2threads.h
paf.c paf: prevent invalid write 2012-08-13 12:27:58 +00:00
paf.h
pamenc.c
parser.c
parser.h
pcm_tablegen.c
pcm_tablegen.h
pcm-mpeg.c
pcm.c
pcx.c
pcxenc.c
pgssubdec.c
pictordec.c
png_parser.c
png.c
png.h
pngdec.c
pngdsp.c
pngdsp.h
pngenc.c
pnm_parser.c
pnm.c
pnm.h
pnmdec.c
pnmenc.c
proresdata.c
proresdata.h
proresdec2.c
proresdec_lgpl.c
proresdec.h
proresdsp.c
proresdsp.h
proresenc_anatoliy.c Proresenc: add multithreading support 2012-08-13 17:16:47 +02:00
proresenc_kostya.c Fix reading past the end of frame buffer. 2012-08-12 18:51:23 +02:00
psymodel.c
psymodel.h
pthread.c
ptx.c
put_bits.h
qcelpdata.h
qcelpdec.c
qdm2_tablegen.c
qdm2_tablegen.h
qdm2.c Merge remote-tracking branch 'qatar/master' 2012-08-10 04:46:13 +02:00
qdm2data.h
qdrw.c
qpeg.c
qtrle.c
qtrleenc.c
r210dec.c
r210enc.c
ra144.c
ra144.h
ra144dec.c
ra144enc.c
ra288.c
ra288.h
ralf.c
ralfdata.h
rangecoder.c
rangecoder.h
ratecontrol.c
ratecontrol.h
raw.c
raw.h
rawdec.c
rawenc.c
rdft.c
rdft.h
realtextdec.c
rectangle.h
remove_extradata_bsf.c
resample2.c
resample.c
rl2.c
rl.h
rle.c
rle.h
roqaudioenc.c
roqvideo.c
roqvideo.h
roqvideodec.c
roqvideoenc.c
rpza.c
rtjpeg.c
rtjpeg.h
rv10.c
rv10enc.c
rv20enc.c
rv30.c
rv30data.h
rv30dsp.c
rv34_parser.c
rv34.c
rv34.h
rv34data.h
rv34dsp.c
rv34dsp.h
rv34vlc.h
rv40.c
rv40data.h
rv40dsp.c
rv40vlc2.h
s3tc.c
s3tc.h
s302m.c
samidec.c
sanm_data.h
sanm.c
sbr.h
sbrdsp.c
sbrdsp.h
sgi.h
sgidec.c sgidec: fix error free end detection. 2012-08-12 05:32:07 +02:00
sgienc.c
shorten.c
simple_idct_template.c
simple_idct.c
simple_idct.h
sinewin_tablegen.c
sinewin_tablegen.h
sinewin.c
sinewin.h
sipr16k.c
sipr16kdata.h
sipr.c
sipr.h
siprdata.h
smacker.c
smc.c
snow.c
snow.h
snowdata.h
snowdec.c snowdec: increase stack size 2012-08-11 05:32:16 +02:00
snowenc.c
sonic.c
sp5x.h
sp5xdec.c
srtdec.c
srtenc.c
subviewerdec.c
sunrast.c
sunrast.h
sunrastenc.c
svq1_cb.h
svq1_vlc.h
svq1.c
svq1.h
svq1dec.c
svq1enc_cb.h
svq1enc.c
svq3.c
synth_filter.c
synth_filter.h
tableprint.h
targa.c
targa.h
targaenc.c
thread.h
tiertexseqv.c
tiff_data.c
tiff_data.h
tiff.c
tiff.h
tiffenc.c
timecode.c
timecode.h
tmv.c
truemotion1.c
truemotion1data.h
truemotion2.c
truespeech_data.h
truespeech.c
tscc2.c
tscc2data.h
tscc.c
tta.c
twinvq_data.h
twinvq.c
txd.c
ulti_cb.h
ulti.c
unary.h
utils.c lavc: add codec_descriptor field to AVCodecContext. 2012-08-12 14:51:19 +02:00
utvideo.c
v210dec.c
v210dec.h
v210enc.c
v210x.c
v308dec.c
v308enc.c
v408dec.c
v408enc.c
v410dec.c
v410enc.c
vaapi_h264.c
vaapi_internal.h
vaapi_mpeg2.c
vaapi_mpeg4.c
vaapi_vc1.c
vaapi.c
vaapi.h
vb.c
vble.c
vc1_parser.c
vc1.c
vc1.h
vc1acdata.h
vc1data.c
vc1data.h
vc1dec.c vc1dec: support debug & FF_DEBUG_PICT_INFO. 2012-08-12 01:21:42 +02:00
vc1dsp.c
vc1dsp.h
vcr1.c
vda_h264.c vda: merge implementation into one file. 2012-08-14 03:39:31 +02:00
vda.h vda: support synchronous decoding. 2012-08-14 03:39:23 +02:00
vdpau_internal.h
vdpau.c
vdpau.h
version.h vda: support synchronous decoding. 2012-08-14 03:39:23 +02:00
vima.c
vmdav.c
vmnc.c
vorbis_data.c
vorbis_enc_data.h
vorbis_parser.c
vorbis_parser.h
vorbis.c
vorbis.h
vorbisdec.c
vorbisenc.c
vp3_parser.c
vp3.c
vp3data.h
vp3dsp.c
vp3dsp.h
vp5.c
vp5data.h
vp6.c
vp6data.h
vp6dsp.c
vp8_parser.c
vp8.c Merge remote-tracking branch 'qatar/master' 2012-08-10 16:25:23 +02:00
vp8.h
vp8data.h
vp8dsp.c
vp8dsp.h
vp56.c
vp56.h
vp56data.c
vp56data.h
vp56dsp.c
vp56dsp.h
vp56rac.c
vqavideo.c
w32pthreads.h
wavpack.c
wma_common.c
wma_common.h
wma.c
wma.h
wmadata.h
wmadec.c
wmaenc.c
wmalosslessdec.c
wmaprodata.h
wmaprodec.c
wmavoice_data.h
wmavoice.c
wmv2.c
wmv2.h
wmv2dec.c
wmv2enc.c
wnv1.c
ws-snd1.c
xan.c
xbmdec.c
xbmenc.c
xiph.c
xiph.h
xl.c
xsubdec.c
xsubenc.c
xvmc_internal.h
xvmc.h
xwd.h
xwddec.c
xwdenc.c
xxan.c
y41pdec.c
y41penc.c
yop.c
yuv4dec.c
yuv4enc.c
zerocodec.c
zmbv.c
zmbvenc.c