• Oliver Fromme's avatar
    avcodec/dvdsubenc: Add dvdsub workaround for some players · a32dcaaa
    Oliver Fromme authored
    The issue affects dvdsub subtitles (a.k.a. VOBSUB).
    
    Some players -- in particular hardware players -- cut off
    the lowest row of pixels if the number of rows in the subtitle
    is odd.
    
    The patch below implements a work-around for that.  If the
    number of rows is odd, it is simply rounded up to an even
    number, adding an invisible (i.e. fully transparent) row.
    The work-around can be enabled or disabled with a new
    option -even_rows_fix.  The default is disabled, so there
    is no change of behaviour for users who don't care about it.
    
    The overhead for the fix is low, and in many cases even zero:
    For subtitles with an odd number of rows (i.e. in 50% of
    cases on average), the size increases by two bytes because
    a fully transparent row is encoded as 0x00 0x00.  However,
    in the VOBSUB standard, all data packets are padded to 2KB
    anyway, so in most cases the additional bytes just use some
    part of the padding, so there is no overhead.  Only in the
    rare case that the 2KB boundary is hit (0.1% chance), a full
    2KB block is added.
    Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
    a32dcaaa
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...
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...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md 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...
cmdutils_opencl.c Loading commit data...
common.mak Loading commit data...
configure Loading commit data...
ffmpeg.c Loading commit data...
ffmpeg.h Loading commit data...
ffmpeg_dxva2.c Loading commit data...
ffmpeg_filter.c Loading commit data...
ffmpeg_opt.c Loading commit data...
ffmpeg_vda.c Loading commit data...
ffmpeg_vdpau.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...