aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hapenc.c
Commit message (Collapse)AuthorAgeFilesLines
* all: fix typos found by codespellTimo Rothenpieler31 hours1-1/+1
|
* avcodec/codec_internal, all: Use macros to set deprecated AVCodec fieldsAndreas Rheinhardt2025-03-101-3/+1
| | | | | | | | | | | | | | The aim of this is twofold: a) Clang warns when setting a deprecated field in a definition and because several of the widely set AVCodec fields are deprecated, one gets several hundred warnings from Clang for an ordinary build. Yet fortunately Clang (unlike GCC) allows to disable deprecation warnings inside a definition, so that one can create simple macros to set these fields that also suppress deprecation warnings for Clang. This has already been done in fdff1b9cbfd8cf5a9810c29efa4baf13a4786742 for AVCodec.channel_layouts. b) Using macros will allow to easily migrate these fields to internal ones. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-1/+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>
* lavc/texturedsp: require explicitly-set frame dimensionsConnor Worley2024-02-181-0/+2
| | | | | | | | | | | | This change decouples the frame dimensions from avctx, which is useful for DXV decoding, and fixes incorrect behavior in the existing implementation. Tested with `make fate THREADS=7` and `make fate THREADS=7 THREAD_TYPE=slice`. Signed-off-by: Connor Worley <connorbworley@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-141-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* avcodec/texturedsp: Factor common code outAndreas Rheinhardt2024-01-281-1/+1
| | | | | | Namely calling avctx->execute2(avctx,...). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/texturedsp: Add separate TextureDSPEncContextAndreas Rheinhardt2024-01-281-1/+1
| | | | | | | | ff_texturedspenc_init() doesn't support most of the function types supported for decoding; add a separate context containing only pointers for the actually supported types. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dxvenc, hap(dec|enc): Move TextureDSPContext to stackAndreas Rheinhardt2024-01-281-4/+5
| | | | | | Only used during init. 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>
* lavc: support AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE in all no-delay encodersAnton Khirnov2023-01-291-1/+2
| | | | 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: Make ff_alloc_packet() based encoders accept user buffersAndreas Rheinhardt2022-08-271-1/+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-2/+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>
* avcodec/hapenc: use the common texturedsp encode functionMarton Balint2022-04-101-18/+16
| | | | | | And add slice thread capabilities. Signed-off-by: Marton Balint <cus@passwd.hu>
* 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-1/+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>
* avcodec/encoders: Remove redundant setting of AV_PKT_FLAG_KEYAndreas Rheinhardt2021-09-281-1/+0
| | | | | | | It is now set generically for all those encoders whose corresponding AVCodecDescriptor has the AV_CODEC_PROP_INTRA_ONLY. 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: 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/hap: add "compressor" option to Hap encoder to disable secondary ↵Tom Butterworth2016-11-101-19/+46
| | | | | | | | | | | | | compression The secondary compression in Hap is optional, this change exposes that option to the user as some use-cases favour higher bitrate files to reduce workload decoding. Adds "none" or "snappy" as options for "compressor". Selecting "none" disregards "chunks" option: chunking is only of benefit decompressing Snappy. Reviewed-by: Martin Vignali <martin.vignali@gmail.com> Signed-off-by: Tom Butterworth <bangnoise@gmail.com>
* avcodec/hap: pass texture-compression destination as argument, not in contextTom Butterworth2016-11-081-3/+9
| | | | | | | This allows a subsequent change to compress directly into the output packet when possible. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Tom Butterworth <bangnoise@gmail.com>
* avcodec/hap: consistent name for codecTom Butterworth2016-11-041-1/+1
| | | | | | | "Vidvox Hap", not "Vidvox Hap encoder" or "Vidvox Hap decoder". Fixes bad name in "ffmpeg -codecs", matches other codec naming. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavc/hapenc: Use the correct printf length modifier for size_t arguments.Carl Eugen Hoyos2016-11-021-1/+1
| | | | | | | Fixes the following warning: libavcodec/hapenc.c:122:20: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ [-Wformat] Based on a patch by Diego Biurrun.
* avcodec/hap: set bits_per_coded_sampleTom Butterworth2015-10-231-0/+3
| | | | | | fixes issue where alpha is ignored in some players Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hapenc: Remove use of deprecated ff_alloc_packet()Michael Niedermayer2015-08-051-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hap: (trivial) rename enum values and document their meaningTom Butterworth2015-07-231-11/+13
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hap: (trivial) clarify commentTom Butterworth2015-07-231-2/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Support the Hap chunked frame formatTom Butterworth2015-07-221-32/+155
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '7ca3e5203f133eb41a0b5c3a1d753a7427ba72e7'Michael Niedermayer2015-06-221-4/+4
| | | | | | | | | | | | | | * commit '7ca3e5203f133eb41a0b5c3a1d753a7427ba72e7': Hap decoder and encoder Conflicts: Changelog configure doc/general.texi libavcodec/allcodecs.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Hap decoder and encoderVittorio Giovara2015-06-221-0/+204
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>