aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/roqvideoenc.c
Commit message (Collapse)AuthorAgeFilesLines
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/roqvideo: Use void*, not AVCodecContext* for logctxAndreas Rheinhardt2023-10-011-5/+3
| | | | | | Also stop setting the field once per encode-frame. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc: support AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE in all no-delay encodersAnton Khirnov2023-01-291-1/+1
| | | | Including fake-delay encoders marked with FF_CODEC_CAP_EOF_FLUSH.
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | 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>
* avcodec/roqvideoenc: Remove internal.h inclusionAndreas Rheinhardt2022-08-271-1/+0
| | | | | | Possible since c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make ff_alloc_packet() based encoders accept user buffersAndreas Rheinhardt2022-08-271-0/+1
| | | | | | | | | | | | | | | | | | 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>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+1
| | | | | | | | | | | 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>
* lavc/encode: add an encoder-specific get_buffer() variantAnton Khirnov2022-05-111-2/+2
| | | | | | | | | | | 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.
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | 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>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-7/+7
| | | | | | | | | | | | | | | | 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>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-0/+1
| | | | | | | | | | 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>
* all: Remove unused-but-set variablesAndreas Rheinhardt2021-12-031-2/+0
| | | | | | Newer versions of Clang detect this and emit warnings for it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/elbg: Add flags to avpriv_elbg_do()Andreas Rheinhardt2021-09-241-1/+1
| | | | | | | | | 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>
* avcodec/elbg: Add persistent ELBGContextAndreas Rheinhardt2021-09-201-2/+5
| | | | | | | | 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>
* avcodec/elbg: Merge avpriv_init_elbg() into avpriv_do_elbg()Andreas Rheinhardt2021-09-201-4/+0
| | | | | | | | | 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>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-201-2/+2
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/encode: Always use intermediate buffer in ff_alloc_packet2()Andreas Rheinhardt2021-06-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* avcodec/roqvideoenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-021-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | 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>
* avcodec/roqvideoenc: Avoid allocating buffers separatelyAndreas Rheinhardt2021-03-011-78/+68
| | | | | | | | | 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>
* avcodec/roqvideoenc: Avoid intermediate bufferAndreas Rheinhardt2021-03-011-17/+8
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/roqvideoenc: Reuse buffers instead of alloc+free for each frameAndreas Rheinhardt2021-03-011-70/+55
| | | | | | | | | 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>
* avcodec/roqvideo: Use dedicated context for encoderAndreas Rheinhardt2021-03-011-92/+126
| | | | | | | | | | | 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>
* avcodec/roqvideoenc: Cleanup generically after init failureAndreas Rheinhardt2020-08-301-6/+3
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Merge commit 'dab2034b8679aaacd8aef832cdeb71d0ee8a3358'Clément Bœsch2017-03-191-15/+0
|\ | | | | | | | | | | | | * commit 'dab2034b8679aaacd8aef832cdeb71d0ee8a3358': roqvideoenc: Drop broken disabled cruft Merged-by: Clément Bœsch <u@pkh.me>
| * roqvideoenc: Drop broken disabled cruftDiego Biurrun2016-08-171-15/+0
| |
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-1/+1
|\| | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/roqvideoenc: use AV_OPT_TYPE_BOOL for quake3_compat optionClément Bœsch2015-09-121-1/+1
| |
* | avcodec: Add a min size parameter to ff_alloc_packet2()Michael Niedermayer2015-07-271-1/+1
| | | | | | | | | | | | | | | | 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>
* | Merge commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534'Michael Niedermayer2015-07-201-3/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | Merge commit '95e2317ed85502dd8d96bcd9b12084dbfb8f9e8e'Michael Niedermayer2015-07-201-3/+0
|\| | | | | | | | | | | | | | | | | | | * commit '95e2317ed85502dd8d96bcd9b12084dbfb8f9e8e': roqvideoenc: Drop unneeded initialization Conflicts: libavcodec/roqvideoenc.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * roqvideoenc: Drop unneeded initializationVittorio Giovara2015-07-201-2/+0
| | | | | | | | Its fields are never initialized to begin with.
| * roqvideoenc: set enc->avctx in roq_encode_initAndreas Cadhalpun2015-03-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* | roqvideoenc: set enc->avctx in roq_encode_initAndreas Cadhalpun2015-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | avcodec/roqvideoenc: Allocate and reference coded_frame correctlyMichael Niedermayer2015-02-231-2/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0'Michael Niedermayer2015-02-141-8/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * avcodec: Don't anonymously typedef structsDiego Biurrun2015-02-141-8/+4
| |
* | avcodec/roqvideoenc: Check for av_malloc_array() failureMichael Niedermayer2015-01-131-0/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3beb9cbad35218ed1fb3473eeb3cfc97a931bff4'Michael Niedermayer2014-12-191-22/+58
|\| | | | | | | | | | | | | | | | | | | * commit '3beb9cbad35218ed1fb3473eeb3cfc97a931bff4': roqvideo: check memory allocations and propagate errors Conflicts: libavcodec/roqvideoenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * roqvideo: check memory allocations and propagate errorsVittorio Giovara2014-12-181-23/+62
| |
* | avcodec/roqvideoenc: clear freed pointersMichael Niedermayer2014-11-161-7/+7
| | | | | | | | | | | | Avoid leaving stale pointers in memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/roqvideoenc: Print the correct max resolutionMichael Niedermayer2014-07-091-1/+1
| | | | | | | | | | Thanks-to: Vitor Sessak <vitor1001@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/roqvideoenc: More verbose warning about no power of 2 dimensionsMichael Niedermayer2014-07-091-1/+1
| | | | | | | | | | Thanks-to: Vitor Sessak <vitor1001@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/roqvideoenc: check dimensions against maximumMichael Niedermayer2014-07-081-0/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/roqvideoenc: fix infinite lambda increasing loopMichael Niedermayer2014-07-081-2/+9
| | | | | | | | | | | | | | 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>
* | avcodec/roqvideo: use JPEG color rangeEric Lasota2014-07-061-1/+1
| | | | | | | | | | | | | | Signed-off-by: ejlasota <ejlasota@gmail.com> Also update fate test checksums Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/roqvideoenc: use av_malloc(z)_array()Michael Niedermayer2014-04-181-10/+10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>