summaryrefslogtreecommitdiffstats
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/decode: Move is_open check to avcodec_receive_frame()Andreas Rheinhardt2025-03-132-3/+3
| | | | | | | It also applies to scenarios where ff_encode_receive_frame() is used. Also remove the redundant av_codec_is_decoder(). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/cuviddec: use pre-existing chroma format informationTimo Rothenpieler2025-03-131-23/+8
| | | | Fixes #11505
* avcodec/Makefile: remove redundant objectTimo Rothenpieler2025-03-131-1/+0
| | | | | It's already listed in OBJS-$(CONFIG_JNI), which should cover all cases STLIBOBJS does and more.
* avcodec/pthread*: Mark init, free, flush functions as av_coldAndreas Rheinhardt2025-03-123-16/+13
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/sbcdec_data: Merge data into headerAndreas Rheinhardt2025-03-124-166/+126
| | | | | | | sbcdec_data.h is only included by sbcdec.c, so this won't cause the data to be included multiple times in the binary. Signed-off-by: Andreas Rheinhardt <[email protected]>
* all: Fix doxy comments wrongly designated as trailing ///<Andreas Rheinhardt2025-03-129-24/+21
| | | | | | | | | | | The ///< or /**< form of doxygen comments are only to be used when the documentation follows the member and the comment block starts on the same line as the member. This commit fixes wrong uses of them; in particular, this fixes the comment for mb_height in H.264 SPS's structure which was wrongly added to mb_width. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vc2enc: Avoid excessive inliningAndreas Rheinhardt2025-03-121-2/+7
| | | | | | | | | | There is no reason to inline put_vc2_ue_uint() everywhere; only one call site is actually hot: The one in encode_subband() (which accounts for 35735040 of 35739495 calls to said function in a FATE run). Uninline all the others. Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/snow: Remove ff_snow_release_buffer()Andreas Rheinhardt2025-03-124-14/+4
| | | | | | Pointless after 7e41f95dce6390f39a5134a25213828ed65fac6b. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vc2enc: Use LUT to assemble interleaved golomb codeAndreas Rheinhardt2025-03-121-12/+33
| | | | | | | | Up until now, the encoder processed only one bit at a time. With this patch, it is eight bits. Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ffv1enc_template: Be a bit more verbose on errorMichael Niedermayer2025-03-111-2/+2
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/ffv1: Fix remap and float with golomb riceMichael Niedermayer2025-03-114-79/+113
| | | | | | Sponsored-by: Sovereign Tech Fund Reviewed-by: Lynne <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/ffv1enc: Fix slice coding mode 1 with rgb framesMichael Niedermayer2025-03-112-5/+4
| | | | | Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/dvdsubenc: Remove pointless wrapperAndreas Rheinhardt2025-03-111-14/+3
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/put_bits: Add and use put_bits63()Andreas Rheinhardt2025-03-114-13/+28
| | | | | | | | | | | When using a 64bit PutBitContext (i.e. on x64), put_bits_no_assert() can naturally write up to 63 bits. So one can avoid treating the cases <32bits, 32 bits and <63 bits differently. As it turns out, no user actually wants to write 64 bit at once (maybe except testprograms). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vc2enc: Simplify writing dirac golomb codesAndreas Rheinhardt2025-03-111-27/+3
| | | | | | | | | | The earlier code used a loop to determine the number of bits used and called ff_log2() on a power of two (and it would be easy to keep track of the exponent of said power-of-two); neither GCC nor Clang optimized the loop away or avoided the ff_log2(). This patch replaces the loop and the log2 with a single av_log2(). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/exr: use luma+alpha float pixel formatsJames Almer2025-03-101-46/+24
| | | | Signed-off-by: James Almer <[email protected]>
* avcodec/wmaenc: Don't unnecessarily reset AVPacket.sizeAndreas Rheinhardt2025-03-101-1/+0
| | | | | | The packet is unreferenced generically lateron anyway. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/wma: Mark ff_wma_end() as av_coldAndreas Rheinhardt2025-03-101-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* all: Use put_bytes_output() instead of put_bits_ptr - pb->bufAndreas Rheinhardt2025-03-103-3/+3
| | | | | | Avoids accessing internals of PutBitContext. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/codec_internal, all: Use macros to set deprecated AVCodec fieldsAndreas Rheinhardt2025-03-10213-834/+451
| | | | | | | | | | | | | | 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 <[email protected]>
* avcodec/vp8: Remove always-false hwaccel checks for VP7Andreas Rheinhardt2025-03-101-1/+1
| | | | | Reviewed-by: Peter Ross <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp8: Move VPx specific functions inside #if CONFIG_VPx blockAndreas Rheinhardt2025-03-101-38/+36
| | | | | | | | where appropriate. Avoids including ff_vp8_decode_frame() when the VP8 decoder is disabled. Reviewed-by: Peter Ross <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp8: Move codec-specific init code out of common initAndreas Rheinhardt2025-03-101-24/+24
| | | | | | | | | | While just at it, also move the init functions inside the #if CONFIG_VP?_DECODER (to avoid linking failures). While just at it, also declare these init functions as av_cold and uninline the remaining common init function. Reviewed-by: Peter Ross <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp8: Fix wrong #endif commentAndreas Rheinhardt2025-03-101-1/+1
| | | | | Reviewed-by: Peter Ross <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* lavc/vvc: Stricter bound on pps_exp_slice_height_in_ctus_minus1Frank Plowman2025-03-091-1/+1
| | | | | | | | | | When pps_num_exp_slices_in_tile[i] is nonzero, the ith tile is made up of pps_num_exp_slices_in_tile[i] slices stacked atop one another, where the height of the jth slice in the ith tile is given by pps_exp_slice_height_in_ctus_minus1[i][j]. The sum of the heights of the slices in the tile should not exceed the height of the tile itself. Signed-off-by: Frank Plowman <[email protected]>
* avcodec/snow: Remove outdated assertAndreas Rheinhardt2025-03-091-3/+0
| | | | | | | | | It comes from a time before frames were refcounted; it has indeed been added in a follow-up commit to c13e490dce1a66d79e1f053d8a38fb9b2eb53267: "codec_release_buffer: fix handling of non user buffers". This type of check is obsolete now. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/sbcenc: Don't use deprecated AVCodec.supported_sampleratesAndreas Rheinhardt2025-03-091-3/+5
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/sbcenc: Mark sbc_encode_init() as av_coldAndreas Rheinhardt2025-03-091-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ffv1: Use dual run coder for fltmapMichael Niedermayer2025-03-082-8/+32
| | | | | | | | | | | This improves compression by 0.1% overall and 44% for the changed table I tried several other things but so far this is the best compromise between complexity and compression This can also be extended to 32 and 64bit floats Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/ffv1: Store remap flag per sliceMichael Niedermayer2025-03-085-4/+16
| | | | | | | | | This allows switching it on conditionally and also for non float, it may improve compression for RGB data that was paletted or other synthetic images Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/ffv1: flip half of float16 and Compactify floatsMichael Niedermayer2025-03-083-0/+71
| | | | | | | | | | | | | | | | | | | | | | | float16 (and more so float32) have many odd values half the values are negative, many are larger than "1.0" and many values are very close to 0. Storing the 16bits as is, looses compression because of the mixture of dense and sparse regions and also many completely unused ones. This simply remaps the 65536 values so no unused values remain This improves compression by about 1.5% for the ACES_OT_VWG_SampleFrames testset (this testset contains all kind of funny values including many images with negative rgb values) The space needed for the map is insignificant compared to the compression gained This patch also flips half the float range as it can be done using the same table. Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/ffv1: Basic float16 supportMichael Niedermayer2025-03-083-3/+20
| | | | | Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/sanm: ignore unknown codecs in FOBJsManuel Lauss2025-03-081-1/+2
| | | | | | | | | | Don't error out, just ignore unknown codec numbers and pretend decode succeeded. This is useful for older LucasArts titles which stack a lot of different FOBJs with different codecs into a single frame. Signed-off-by: Manuel Lauss <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec: Don't log to private contextAndreas Rheinhardt2025-03-0810-40/+43
| | | | | | | While it is save for these codecs (they all have private contexts), it is customary to always use the AVCodecContext for logging. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/{h263,ituh263,msmpeg4,snow}dec: Use proper logcontextAndreas Rheinhardt2025-03-084-7/+9
| | | | | | | | | The logging functions here can be reached by codecs without private class, so that the log callback will receive a non-NULL object whose AVClass pointer is NULL. Although the default log callback handles this gracefully, it is probably an API violation. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12dec: Use CHROMA_* definesAndreas Rheinhardt2025-03-071-10/+10
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegenc: Constify parent ctx in encode_block()Andreas Rheinhardt2025-03-071-3/+3
| | | | | | | | | Said parent is shared between all slice contexts and encode_block() can be run concurrently by slice threads, so the parent context must not be (and is not) modified. So constify the pointers. Reviewed-by: Ramiro Polla <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegenc_common: Constify ff_mjpeg_encode_{dc,picture_header}()Andreas Rheinhardt2025-03-072-13/+13
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegenc: Don't use ff_ prefix for static functionsAndreas Rheinhardt2025-03-071-8/+8
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegenc: Use forward decl for MpegEncContext, MJpegHuffmanCodeAndreas Rheinhardt2025-03-072-16/+17
| | | | | | Avoids an indirect inclusion of mpegvideo.h in mjpegenc_common.c. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc, motion_est: Pre-center fcode_tabAndreas Rheinhardt2025-03-075-6/+5
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo: Move vbv_delay to Mpeg1ContextAndreas Rheinhardt2025-03-072-3/+3
| | | | | | Only used there and only by the main thread. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12enc: Simplify writing bitsAndreas Rheinhardt2025-03-071-12/+4
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegenc: Don't log to private contextAndreas Rheinhardt2025-03-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegenc: Remove nonsensical AMV optionsAndreas Rheinhardt2025-03-071-3/+4
| | | | | | | Both these options are unsupported and silently ignored for AMV; so it is better to not offer them at all. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/speedhqenc: Inline ff_speedhq_mb_y_order_to_mb()Andreas Rheinhardt2025-03-072-17/+15
| | | | | | | It is an extremely simple function that is only called once, so it should be inlined. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/speedhqenc: Don't log to the private contextAndreas Rheinhardt2025-03-071-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo: Mark ff_mpv_common_defaults() as av_coldAndreas Rheinhardt2025-03-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo: Move temp ratecontrol bufs to RateControlContextAndreas Rheinhardt2025-03-074-12/+17
| | | | | | | Also only allocate them when they are needed (namely iff adaptive quant is true) and allocate them jointly. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo: Move ratecontrol-only options to RateControlContextAndreas Rheinhardt2025-03-075-30/+32
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>