summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubenc.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-151-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-151-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/dvdsubenc: Add dvdsub workaround for some playersOliver Fromme2014-07-091-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubenc: accept forced flagOliver Fromme2014-05-201-1/+8
| | | | | | | | | | Reviewed-by: Anshul <anshul.ffmpeg@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Use correct msvc type specifiers for ptrdiff_t and size_t.Carl Eugen Hoyos2014-04-241-1/+1
| | | | | | | | | | | | | | The Windows runtime aborts if it finds %t or %z. Fixes ticket #3472. Reviewed-by: Ronald Bultje
* | Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'Michael Niedermayer2013-10-041-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2': cosmetics: Group .name and .long_name together in codec/format declarations Conflicts: libavcodec/8svx.c libavcodec/alac.c libavcodec/cljr.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/dpxenc.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/ffv1dec.c libavcodec/flacdec.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/g726.c libavcodec/gif.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopencore-amr.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/libvo-amrwbenc.c libavcodec/libvorbisenc.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/ljpegenc.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpeg4videodec.c libavcodec/msmpeg4dec.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/proresdec_lgpl.c libavcodec/proresenc_kostya.c libavcodec/ra144enc.c libavcodec/rawdec.c libavcodec/rv10.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tta.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/wavpack.c libavcodec/xbmenc.c libavcodec/yop.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun2013-10-031-1/+1
| |
* | dvdsubenc: use unsigned shifts to avoid shifting into the sign bitMichael Niedermayer2013-01-121-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/dvdsubenc: improve color distance function.Nicolas George2013-01-011-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Consider the color space as an hypercone with apex alpha=0 and base alpha=1 instead of an hypercube. Make the encoder consider very transparent colors more similar even if the hue is very different. This corresponds roughly to using the alpha as a weight for the color difference. Only 4 bits of alpha are used, because this is what dvdsub uses, and it avoids overflows. Fix trac ticket #2005.
* | 10l: export ff_bprint_to_extradata between libs using avpriv_ prefix.Clément Bœsch2012-12-301-1/+1
| | | | | | | | Both libavformat and libavcodec requires this function.
* | lavc: add ff_bprint_to_extradata() helper and use it.Clément Bœsch2012-12-301-2/+3
| | | | | | | | | | | | | | | | | | | | This commit also makes sure the extradata and subtitle_header are NUL terminated, without taking into account the trailing '\0' in account in the size. At the same time, it should fix 'warning: dereferencing type-punned pointer will break strict-aliasing rules' warning for compilers who don't consider uint8_t** and char** compatibles.
* | Merge commit '23aae62c2cb4504a09ceb8cd0cabc1c8b260f521'Michael Niedermayer2012-09-181-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '23aae62c2cb4504a09ceb8cd0cabc1c8b260f521': alsdec: Check k used for rice decoder. avfiltergraph: silence an uninitialized variable warning xsubenc: reindent lavc: replace AVCodecContext.encode with subtitle-specific callback lavc: add const to private codec class initialization. avconv: don't pass a bogus parameter to avfilter_graph_create_filter(). id3v2: strdup the genre name explicitly. lavf/id3v2: do not export empty fields. buffersrc: add const to the AVFrame* argument of av_buffersrc_write_frame() lavfi: replace empty input/output lists with null pointers Conflicts: ffmpeg_filter.c libavcodec/alsdec.c libavcodec/dvdsubenc.c libavcodec/utils.c libavcodec/v210dec.h libavfilter/af_channelsplit.c libavfilter/avfiltergraph.c libavfilter/buffersrc.c libavfilter/src_movie.c libavfilter/vf_ass.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: replace AVCodecContext.encode with subtitle-specific callbackAnton Khirnov2012-09-171-3/+3
| | | | | | | | | | AVCodecContext.encode is currently used only for subtitles, encode2 is used for audio and video.
* | lavc/dvdsubenc: check the type of rectangles.Nicolas George2012-08-241-0/+5
| | | | | | | | | | Avoid a crash if a text rectangle is provided. Fix the segfault reported in trac ticket #1661.
* | dvdsubenc: reindent after recent commit.Nicolas George2012-08-141-31/+29
| |
* | dvdsubenc: set frame size in extradata.Nicolas George2012-08-141-0/+2
| |
* | dvdsubenc: make it usable for transcoding.Nicolas George2012-08-141-69/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-071-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-071-1/+1
| |
* | dvdsubenc: switch to av_assertMichael Niedermayer2012-07-281-3/+2
| | | | | | | | | | | | | | we use av_assert0() because the previous code unconditionally enabled the assert. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-04-071-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtpdec_asf: Set the no_resync_search option for the chained asf demuxer asfdec: Add an option for not searching for the packet markers cosmetics: Clean up the tiffenc pix_fmts declaration to match the style of others cosmetics: Align codec declarations cosmetics: Convert mimic.c to utf-8 avconv: remove an unused function parameter. avconv: remove now pointless variables. avconv: drop support for building without libavfilter. nellymoserenc: fix crash due to memsetting the wrong area. libavformat: Only require first packet to be known for audio/video streams avplay: Don't try to scale timestamps if the tb isn't set Conflicts: Changelog configure ffmpeg.c libavcodec/aacenc.c libavcodec/bmpenc.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/ffv1.c libavcodec/flacenc.c libavcodec/fraps.c libavcodec/huffyuv.c libavcodec/libopenjpegdec.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/pamenc.c libavcodec/pgssubdec.c libavcodec/pngenc.c libavcodec/qtrleenc.c libavcodec/rawdec.c libavcodec/sgienc.c libavcodec/tiffenc.c libavcodec/v210dec.c libavcodec/wmv2dec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Align codec declarationsMartin Storsjö2012-04-061-1/+1
| | | | | | | | | | | | | | Also break some long lines, remove codec function placeholder comments and add spaces in sample/pixel format lists. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-031-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (44 commits) replacement Indeo 3 decoder gsm demuxer: do not allocate packet twice. flvenc: use first packet delay as global delay. ac3enc: doxygen update. imc: return error codes instead of 0 for error conditions. imc: return meaningful error codes instead of -1 imc: do not set channel layout for stereo imc: validate channel count imc: check for ff_fft_init() failure imc: check output buffer size before decoding imc: use DSPContext.bswap16_buf() to byte-swap packet data rtsp: add allowed_media_types option libgsm: add flush function to reset the decoder state when seeking libgsm: simplify decoding by using a loop gsm: log error message when packet is too small libgsmdec: do not needlessly set *data_size to 0 gsmdec: do not needlessly set *data_size to 0 gsmdec: add flush function to reset the decoder state when seeking libgsmdec: check output buffer size before decoding gsmdec: log error message when output buffer is too small. ... Conflicts: Changelog ffplay.c libavcodec/indeo3.c libavcodec/mjpeg_parser.c libavcodec/vp3.c libavformat/cutils.c libavformat/id3v2.c libavutil/parseutils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove some stray unnecessary ffmpeg references.Diego Biurrun2011-11-021-1/+1
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-301-6/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mxfdec: Include FF_INPUT_BUFFER_PADDING_SIZE when allocating extradata. H.264: tweak some other x86 asm for Atom probe: Fix insane flow control. mpegts: remove invalid error check s302m: use nondeprecated audio sample format API lavc: use designated initialisers for all codecs. x86: cabac: add operand size suffixes missing from 6c32576 Conflicts: libavcodec/ac3enc_float.c libavcodec/flacenc.c libavcodec/frwu.c libavcodec/pictordec.c libavcodec/qtrleenc.c libavcodec/v210enc.c libavcodec/wmv2dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: use designated initialisers for all codecs.Anton Khirnov2011-07-291-6/+4
| | | | | | | | It's more readable and less prone to breakage.
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.Diego Elio Pettenò2011-01-261-1/+1
| | | | | | | | | | | | | | None of these symbols should be accessed directly, so declare them as hidden. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.Diego Elio Pettenò2011-01-281-1/+1
|/ | | | | | | | None of these symbols should be accessed directly, so declare them as hidden. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit d36beb3f6902b1217beda576aa18abf7eb72b03c)
* Define AVMediaType enum, and use it instead of enum CodecType, whichStefano Sabatini2010-03-301-1/+1
| | | | | | is deprecated and will be dropped at the next major bump. Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: Remove pointless period after copyright statement non-sentences.Diego Biurrun2009-01-191-1/+1
| | | | Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Replace AVSubtitleRect.rgba_palette and bitmap by AVPicture.Michael Niedermayer2009-01-031-4/+4
| | | | Originally committed as revision 16416 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change AVSubtitle.rects to an array of pointers so ABI does not breakMichael Niedermayer2009-01-031-16/+16
| | | | | | when the size of AVSubtitleRect changes. Originally committed as revision 16412 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make AVCodec long_names definition conditional depending on CONFIG_SMALL.Stefano Sabatini2008-06-121-1/+1
| | | | Originally committed as revision 13759 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add long names to AVCodec declarations.Stefano Sabatini2008-04-271-0/+1
| | | | | | patch by Stefano Sabatini, stefano.sabatini-lala poste it Originally committed as revision 13009 to svn://svn.ffmpeg.org/ffmpeg/trunk
* remove some empty close/init functions in avcodecAurelien Jacobs2007-11-251-12/+1
| | | | | | patch by Alex Originally committed as revision 11093 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove editor junk from the end.Alex Beregszaszi2007-11-141-4/+0
| | | | Originally committed as revision 11027 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove duplicate bytestream functionsRamiro Polla2007-05-231-16/+9
| | | | Originally committed as revision 9108 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove empty structures,Steve L'Homme2006-10-141-4/+1
| | | | | | | | | Patch by Steve LHomme Original thread: Date: 13.10.2006 21:55 Subject: [Ffmpeg-devel] [PATCH] Remove empty structures Originally committed as revision 6690 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change license headers to say 'FFmpeg' instead of 'this program/this library'Diego Biurrun2006-10-071-4/+6
| | | | | | and fix GPL/LGPL version mismatches. Originally committed as revision 6577 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Update licensing information: The FSF changed postal address.Diego Biurrun2006-01-121-1/+1
| | | | Originally committed as revision 4842 to svn://svn.ffmpeg.org/ffmpeg/trunk
* COSMETICS: Remove all trailing whitespace.Diego Biurrun2005-12-171-2/+2
| | | | Originally committed as revision 4749 to svn://svn.ffmpeg.org/ffmpeg/trunk
* use PRIxN, %zd, %td formats where neededMåns Rullgård2005-12-121-1/+1
| | | | Originally committed as revision 4740 to svn://svn.ffmpeg.org/ffmpeg/trunk
* dvbsub encoder, patch by Wolfram Gloger < wmglo AH dent POIS med POIS ↵Wolfram Gloger2005-11-141-0/+248
uni-muenchen POIS de > Original thread: Date: 8 Oct 2005 09:35:38 -0000 Subject: [Ffmpeg-devel] [PATCH] dvdsub encoder -- 2nd version Originally committed as revision 4706 to svn://svn.ffmpeg.org/ffmpeg/trunk