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/roqvideoenc: Remove internal.h inclusionAndreas Rheinhardt
Possible since c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a. 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-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-05-11lavc/encode: add an encoder-specific get_buffer() variantAnton Khirnov
Several encoders (roqvideo, svq1, snow, and the mpegvideo family) currently call ff_get_buffer(). However this function is written assuming it is called by a decoder. Though nothing has been obviously broken by this until now, that may change in the future. To avoid potential future issues, introduce a simple encode-specific wrapper around avcodec_default_get_buffer2() and enforce its use in encoders.
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-12-03all: Remove unused-but-set variablesAndreas Rheinhardt
Newer versions of Clang detect this and emit warnings for it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24avcodec/elbg: Add flags to avpriv_elbg_do()Andreas Rheinhardt
This is currently unused and it is only added to enable changes while maintaining ABI compatibility. The type is uintptr_t in order to potentially accept a pointer argument. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20avcodec/elbg: Add persistent ELBGContextAndreas Rheinhardt
It will be used in future commits to avoid having to allocate and free all the buffers used. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20avcodec/elbg: Merge avpriv_init_elbg() into avpriv_do_elbg()Andreas Rheinhardt
These functions are always called directly after another with the exact same arguments. This avoids exporting a symbol; it also avoids having to perform two calls for every caller. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt
They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> 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/roqvideoenc: 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-01avcodec/roqvideoenc: Avoid allocating buffers separatelyAndreas Rheinhardt
This is possible because their size is known at compile-time; so they can be put directly into the context and don't need to be allocated for every frame. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-01avcodec/roqvideoenc: Avoid intermediate bufferAndreas Rheinhardt
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-01avcodec/roqvideoenc: Reuse buffers instead of alloc+free for each frameAndreas Rheinhardt
In case of the cel evaluators it even allows to perform the initialization of the source coordinates only once instead of for each frame. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-01avcodec/roqvideo: Use dedicated context for encoderAndreas Rheinhardt
Up until now, the RoQ video decoder and encoder used the same context; and said context contained several fields that are only used by the encoder. This commit changes this and uses a dedicated context for the encoder; it contains the common context as first element in order to use functions common to the de- and encoder. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30avcodec/roqvideoenc: Cleanup generically after init failureAndreas Rheinhardt
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2017-03-19Merge commit 'dab2034b8679aaacd8aef832cdeb71d0ee8a3358'Clément Bœsch
* commit 'dab2034b8679aaacd8aef832cdeb71d0ee8a3358': roqvideoenc: Drop broken disabled cruft Merged-by: Clément Bœsch <u@pkh.me>
2016-08-17roqvideoenc: Drop broken disabled cruftDiego Biurrun
2016-06-21Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
2016-05-04cosmetics: Fix spelling mistakesVittorio Giovara
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-09-12avcodec/roqvideoenc: use AV_OPT_TYPE_BOOL for quake3_compat optionClément Bœsch
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 '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-20Merge commit '95e2317ed85502dd8d96bcd9b12084dbfb8f9e8e'Michael Niedermayer
* commit '95e2317ed85502dd8d96bcd9b12084dbfb8f9e8e': roqvideoenc: Drop unneeded initialization Conflicts: libavcodec/roqvideoenc.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20roqvideoenc: Drop unneeded initializationVittorio Giovara
Its fields are never initialized to begin with.
2015-03-11roqvideoenc: set enc->avctx in roq_encode_initAndreas Cadhalpun
So far it is only set in roq_encode_frame, but it is used in roq_encode_end to free the coded_frame. This currently segfaults if roq_encode_frame is not called between roq_encode_init and roq_encode_end. CC:libav-stable@libav.org Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-09roqvideoenc: set enc->avctx in roq_encode_initAndreas Cadhalpun
So far it is only set in roq_encode_frame, but it is used in roq_encode_end to free the coded_frame. This currently segfaults if roq_encode_frame is not called between roq_encode_init and roq_encode_end. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-23avcodec/roqvideoenc: Allocate and reference coded_frame correctlyMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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: Don't anonymously typedef structsDiego Biurrun
2015-01-13avcodec/roqvideoenc: Check for av_malloc_array() failureMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-19Merge commit '3beb9cbad35218ed1fb3473eeb3cfc97a931bff4'Michael Niedermayer
* commit '3beb9cbad35218ed1fb3473eeb3cfc97a931bff4': roqvideo: check memory allocations and propagate errors Conflicts: libavcodec/roqvideoenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-19roqvideo: check memory allocations and propagate errorsVittorio Giovara
2014-11-17avcodec/roqvideoenc: clear freed pointersMichael Niedermayer
Avoid leaving stale pointers in memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-09avcodec/roqvideoenc: Print the correct max resolutionMichael Niedermayer
Thanks-to: Vitor Sessak <vitor1001@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-09avcodec/roqvideoenc: More verbose warning about no power of 2 dimensionsMichael Niedermayer
Thanks-to: Vitor Sessak <vitor1001@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-08avcodec/roqvideoenc: check dimensions against maximumMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-08avcodec/roqvideoenc: fix infinite lambda increasing loopMichael Niedermayer
The threshold was choosen so that no further size decrease happened with larger lambda with the test video. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-07avcodec/roqvideo: use JPEG color rangeEric Lasota
Signed-off-by: ejlasota <ejlasota@gmail.com> Also update fate test checksums Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-18avcodec/roqvideoenc: use av_malloc(z)_array()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-03RoQ encoder: support different integer frameratesaddr-see-the-website@aetey.se
Even though the most common framerate for RoQ is 30fps, the format supports other framerates too. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02RoQ-encoder: introducing Quake 3 compatibility optionaddr-see-the-website@aetey.se
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-13lavc/elbg: rename ff_ symbols to avpriv_, so they can be used in shared libsStefano Sabatini
In particular, allows the use of elbg in other FFmpeg libraries, required by the pending elbg filter.
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