Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-03avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt
It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27avcodec: Make ff_alloc_packet() based encoders accept user buffersAndreas Rheinhardt
Up until now, these encoders received non-refcounted packets (whose data was owned by the corresponding AVCodecContext) from ff_alloc_packet(); these packets were made refcounted lateron by av_packet_make_refcounted() generically. This commit makes these encoders accept user-supplied buffers by replacing av_packet_make_refcounted() with an equivalent function that is based upon get_encode_buffer(). (I am pretty certain that one can also set the flag for mpegvideo- based encoders, but I want to double-check this later. What is certain is that it reallocates the buffer owned by the AVCodecContext which should maybe be moved to encode.c, so that proresenc_kostya.c and ttaenc.c can make use of it, too.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-24avcodec/gif: Remove unnecessary headersAndreas Rheinhardt
The gif encoder uses the bytestream API, not the PutBit-API. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-31avcodec/gif: Remove redundant castAndreas Rheinhardt
Possible since 529a9893d769f381b72785c500662be2020da5fe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-18avcodec: Make init-threadsafety the defaultAndreas Rheinhardt
and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-05avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt
This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt
Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt
Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-06-08avcodec/encode: Always use intermediate buffer in ff_alloc_packet2()Andreas Rheinhardt
Up until now, ff_alloc_packet2() has a min_size parameter: It is supposed to be a lower bound on the final size of the packet to allocate. If it is not too far from the upper bound (namely, if it is at least half the upper bound), then ff_alloc_packet2() already allocates the final, already refcounted packet; if it is not, then the packet is not refcounted and its data only points to a buffer owned by the AVCodecContext (in this case, the packet will be made refcounted in encode_simple_internal() in libavcodec/encode.c). The goal of this was to avoid data copies and intermediate buffers if one has a precise lower bound. Yet those encoders for which precise lower bounds exist have recently been switched to ff_get_encode_buffer() (which automatically allocates final buffers), leaving only two encoders to actually set the min_size to something else than zero (namely aliaspixenc and hapenc). Both of these encoders use a very low lower bound that is not helpful in any nontrivial case. This commit therefore removes the min_size parameter as well as the codepath in ff_alloc_packet2() for the allocation of final buffers. Furthermore, the function has been renamed to ff_alloc_packet() and moved to encode.h alongside ff_get_encode_buffer(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-02avcodec/gif: Mark encoder as init-threadsafeAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-04-27avcodec: Constify AVCodecsAndreas Rheinhardt
Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-12avcodec/gifenc: Actually use the shrunk paletteDerek Buitenhuis
I have no idea how nobody, including myself, noticed this. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-02-25avcodec/gifenc: Only write frame palette entries that actually usedDerek Buitenhuis
GIF palette entries are not compressed, and writing 256 entries, which can be up to every frame, uses a significant amount of space, especially in extreme cases, where palettes can be very small. Example, first six seconds of Tears of Steel, palette generated with libimagequant, 320x240 resolution, and with transparency optimization + per frame palette: * Before patch: 186765 bytes * After patch: 77895 bytes Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-02-25avcodec/gifenc: Add global_palette optionDerek Buitenhuis
This option will disable the writing of the global palette in global GIF header if it is set to 0, causing only the frame-level palette to ever be written. This will be useful later on when further frame-level palette optimizations are introduced. The default is 1, which maintains current default behavior. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-09-15avcodec/gif: Fix leaks upon allocation errorAndreas Rheinhardt
If one of several allocations the gif encoder performs in its init function fails, the successful allocations leak. Fix this by adding the FF_CODEC_CAP_INIT_CLEANUP flag. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-23avcodec/gif: fix disposal method for first frame and transparent gifsPaul B Mahol
Fixes #7902
2020-07-20avcodec/put_bits: Fix LZW warningSteinar H. Gunderson
lzwenc stores a function pointer to either put_bits or put_bits_le; however, after the recent change, the function pointer's prototype would depend on BitBuf. BitBuf is defined in put_bits.h, whose definition depends on whether BITSTREAM_WRITER_LE is #defined or not. For safety, we set a boolean flag for little/big endian instead, which also allows the definition to be inlined. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-11avcodec/gif: remove flags from gifimage optionPaul B Mahol
It does not belong there.
2019-05-11avcodec/gif: fix issues with transparent cropJacob Graff
Resolves issues with some transparent gifs.
2018-12-13avcodec/gif: use avctx->frame_numberPaul B Mahol
2018-12-13avcodec/gif: enable encoding single gif image per framePaul B Mahol
Unbreaks gif image2 muxer.
2018-12-13avcodec/gif: add support for alphaPaul B Mahol
Based on patch by Bjorn Roche. Fixes #6813.
2018-12-13avcodec: rewrite gif muxing and encodingPaul B Mahol
Now "-c copy" works. Update FATE files. Demuxer only split file into packets, no data is trimmed. Encoder & muxer currently expect completely another format where muxer writes stuff like disposal method which should be really encoder job. With this patch muxer only modifies delay between two packets. Codec copy need to have same behavior between demuxer and muxer to work correctly. Fixes #6640.
2016-09-07avcodec/gif: don't honor transparency if palette changedPaul B Mahol
It generally does not work. Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-01-18avcodec/gif: Fix lzw buffer sizeMichael Niedermayer
Fixes out of array access Fixes: aaa479088e6fb40b04837b3119f47b04/asan_heap-oob_e38c68_8576_9d653078b2470700e2834636f12ff557.tga Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer
* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27lavc: Consistently prefix input buffer definesVittorio Giovara
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27avcodec: Add a min size parameter to ff_alloc_packet2()Michael Niedermayer
This parameter can be used to inform the allocation code about how much downsizing might occur, and can be used to optimize how to allocate the packet Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'Michael Niedermayer
* commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370': Deprecate avctx.coded_frame Conflicts: ffmpeg.c libavcodec/a64multienc.c libavcodec/asvenc.c libavcodec/cljrenc.c libavcodec/dpxenc.c libavcodec/gif.c libavcodec/mpegvideo_enc.c libavcodec/nvenc.c libavcodec/proresenc_kostya.c libavcodec/pthread_frame.c libavcodec/rawenc.c libavcodec/sunrastenc.c libavcodec/tiffenc.c libavcodec/version.h libavcodec/xbmenc.c libavcodec/xwdenc.c libavdevice/v4l2.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21Merge commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534'Michael Niedermayer
* commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534': Gather all coded_frame allocations and free functions to a single place Conflicts: libavcodec/a64multienc.c libavcodec/asvenc.c libavcodec/cljrenc.c libavcodec/dpxenc.c libavcodec/dvenc.c libavcodec/gif.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libopenjpegenc.c libavcodec/libtheoraenc.c libavcodec/libvpxenc.c libavcodec/mpegvideo_enc.c libavcodec/nvenc.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/sunrastenc.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/v210enc.c libavcodec/v410enc.c libavcodec/xbmenc.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20Deprecate avctx.coded_frameVittorio Giovara
The rationale is that coded_frame was only used to communicate key_frame, pict_type and quality to the caller, as well as a few other random fields, in a non predictable, let alone consistent way. There was agreement that there was no use case for coded_frame, as it is a full-sized AVFrame container used for just 2-3 int-sized properties, which shouldn't even belong into the AVCodecContext in the first place. The appropriate AVPacket flag can be used instead of key_frame, while quality is exported with the new AVPacketSideData quality factor. There is no replacement for the other fields as they were unreliable, mishandled or just not used at all. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-20Gather all coded_frame allocations and free functions to a single placeVittorio Giovara
Allocating coded_frame is what most encoders do anyway, so it makes sense to always allocate and free it in a single place. Moreover a lot of encoders freed the frame with av_freep() instead of the correct API av_frame_free(). This bring uniformity to encoder behaviour and prevents applications from erroneusly accessing this field when not allocated. Additionally this helps isolating encoders that export information with coded_frame, and heavily simplifies its deprecation. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-02-16avcodec/gif: fix off by one in column offsetting findingClément Bœsch
2015-02-14Merge commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0'Michael Niedermayer
* commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0': avcodec: Don't anonymously typedef structs Conflicts: libavcodec/alac.c libavcodec/cinepak.c libavcodec/cscd.c libavcodec/dcadec.c libavcodec/g723_1.c libavcodec/gif.c libavcodec/iff.c libavcodec/kgv1dec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/ra288.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14avcodec/gif: support crop and transparency with PAL8Clément Bœsch
2015-02-14avcodec: Don't anonymously typedef structsDiego Biurrun
2013-11-17Merge commit '57e7b3a89f5a0879ad039e8f04273b48649799a8'Michael Niedermayer
* commit '57e7b3a89f5a0879ad039e8f04273b48649799a8': dnxhdenc: use the AVFrame API properly. libx264: use the AVFrame API properly. svq1enc: use the AVFrame API properly. gif: use the AVFrame API properly. Conflicts: libavcodec/gif.c libavcodec/svq1enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-16gif: use the AVFrame API properly.Anton Khirnov
2013-10-04Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'Michael Niedermayer
* 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>
2013-10-04cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun
2013-08-15avcodec/gif: use the whole allocated bufferMichael Niedermayer
Fixes some gif encoding failures Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-15avcodec/gif: move BITSTREAM_WRITER_LE upMichael Niedermayer
This prevents issues in case any header #includes put_bits.h Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-08gif: remove unused AVFrame from encoder private contextPaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-07-08gif: do not set avctx->coded_framePaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-04-30gif: Fix little endian specific codeMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-20lavc/gif: miscellaneous cosmetics.Clément Bœsch
2013-04-20lavc/gif: add flag to enable transparency detection between frames.Clément Bœsch
While this is not always optimal, in practice most of the common cases are. ffmpeg -i big_buck_bunny_1080p_h264.mov -ss 45 -vf scale=320:160 -gifflags -transdiff -frames:v 50 -y bbb-notrans.gif ffmpeg -i big_buck_bunny_1080p_h264.mov -ss 45 -vf scale=320:160 -gifflags +transdiff -frames:v 50 -y bbb-trans.gif -rw-r--r-- 1 ubitux ubitux 1.1M Apr 19 19:00 bbb-notrans.gif -rw-r--r-- 1 ubitux ubitux 378K Apr 19 19:00 bbb-trans.gif
2013-04-20lavc/gif: make possible to disable offsetting.Clément Bœsch
2013-04-19gif: use only one graphic control extension block per image.Clément Bœsch
The encoder now doesn't produce any extra graphic control extension block anymore. Only the image is encoded, and the muxer writing its own GCE containing notably the timing information now includes the optional palette transmitted through packet side data. This commit avoid setting clashes between the two GCE, and reduce the size of the generated file with pal8 output.
2013-04-18lavc/gif: avoid encoding 0x0 images.Clément Bœsch
It seems browsers don't like it very much.