aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* avcodec/mpegvideo: Allocate ac_val jointlyAndreas Rheinhardt2025-06-212-44/+52
| | | | | | | | | | | | | | | They are currently allocated separately per slice; allocating them jointly allows to avoid saving them in ff_update_duplicate_context(). The way it is done also avoids allocating ac_val for encoders that don't need it (e.g. H.263 or H.263+ with AIC). This entailed moving setting nb_slices to ff_mpv_init_context_frame() which is called from ff_mpv_common_frame_size_change(). The resultant nb_slices will always be one when called from a decoder using ff_mpv_common_frame_size_change(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Only use a single ac_val pointerAndreas Rheinhardt2025-06-218-23/+19
| | | | | | The chroma pointers ac_val[1] and ac_val[2] are no longer used anywhere. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video: Don't use ac_val[1], ac_val[2] when cleaning buffersAndreas Rheinhardt2025-06-211-4/+5
| | | | | | | This is in preparation for removing removing ac_val[1] and ac_val[2]. ff_mpeg4_clean_buffers() was the last user of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Combine storesAndreas Rheinhardt2025-06-211-4/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Don't reset AC values of upper-left luma blockAndreas Rheinhardt2025-06-211-1/+3
| | | | | | | | Said block will only be referenced by blocks from the same macroblock, which will read the new AC values instead of the reset values from this function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Provide alignment hint to compilerAndreas Rheinhardt2025-06-211-4/+6
| | | | | | | | | | The underlying element type has always a size of 32B, so that the pointer is always at least 16B aligned. Clang uses this to upgrade the (inlined) memset to aligned stores. GCC doesn't (it does it only when the alignment hint is provided via __builtin_assume_aligned). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Avoid {a,d}c_val[{1,2}]Andreas Rheinhardt2025-06-211-7/+8
| | | | | | | | These are already mostly unused; not using them here is in preparation for removing them altogether. Use block_index[4..5] instead for addressing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Redo resetting intra table entryAndreas Rheinhardt2025-06-215-10/+16
| | | | | | | | | | | | | | All callers check the corresponding entry of MpegEncContext.mbintra_table and if set (indicating that the intra tables might have been written to when decodeing a intra MB, so that they are "dirty"), call ff_clean_intra_table_entries(), which resets them to default values and resets the mbintra_table entry. Move resetting to the callers (via an inline function that also performs the checks). This currently has the advantage that the additional load of the mbintra_table ptr can be avoided. It will also allow to simplify ff_clean_intra_table_entries() (by using block_index[4] and [5]). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/flvenc: Move ff_flv2_encode_ac_esc() to ituh263enc.cAndreas Rheinhardt2025-06-213-27/+23
| | | | | | This is the only place where it is used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/flvenc: Combine writing bitsAndreas Rheinhardt2025-06-211-10/+13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263enc: Simplify AIC handlingAndreas Rheinhardt2025-06-211-16/+7
| | | | | | Namely with block_index and block_wrap. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263dec: Simplify AIC handlingAndreas Rheinhardt2025-06-211-22/+13
| | | | | | Possible by using block_index. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Simplify allocating non-slice buffersAndreas Rheinhardt2025-06-211-75/+73
| | | | | | | Allocate them before the slice contexts, so that they are automatically copied to the slice contexts. This avoids having to set them in a loop. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Defer init of enc slice ctxs in ff_mpv_common_init()Andreas Rheinhardt2025-06-212-6/+11
| | | | | | | | This will allow to perform initializations between ff_mpv_common_init() and ff_mpv_init_duplicate_contexts() that will be automatically copied to the slice contexts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Don't zero unnecessarilyAndreas Rheinhardt2025-06-211-1/+1
| | | | | | | The whole dc_val array is initialized (to 1024) immediately after the allocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Don't reset thread_context ptrs unnecessarilyAndreas Rheinhardt2025-06-211-1/+0
| | | | | | They are freed with av_freep(), so the pointers are already consistent. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Relax snowenc->mpegvideoenc dependencyAndreas Rheinhardt2025-06-212-2/+3
| | | | | | It only needs mpegvideoencdsp, motion_est.o and ratecontrol.o. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Relax diracdec->mpegvideoenc dependencyAndreas Rheinhardt2025-06-211-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Relax svq1enc->mpegvideoenc dependencyAndreas Rheinhardt2025-06-214-22/+28
| | | | | | | It only needs mpegvideoencdsp, motion_est.o and some H.263 specific parts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Factor mpegvideoencdsp out of mpegvideoencAndreas Rheinhardt2025-06-2115-60/+60
| | | | | | | This will allow to relax the dependency on mpegvideoenc for several codecs. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq1enc: Don't initialize unneeded block_indexAndreas Rheinhardt2025-06-211-2/+0
| | | | | | | | The motion estimation code only uses block_index[0..3], so only initialize that (just like estimate_motion_thread() in mpegvideo_enc.c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq1enc: Set MpegEncContext.avctx only onceAndreas Rheinhardt2025-06-211-1/+0
| | | | | | It is already set during init. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq1enc: Remove write-only c_block_{width,height}Andreas Rheinhardt2025-06-211-7/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq1enc: Stop calling ff_mpv_common_init()Andreas Rheinhardt2025-06-211-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | It is not really needed, as none of the buffers allocated in ff_mpv_common_init() are used lateron; in fact, ff_mpv_common_init() is called with MpegEncContext.width and height equal to zero (as well as encoding equal to zero, so that the error resilience parts are initialized...), so that all the buffers are too small anyway. The call to ff_mpv_common_init() has been added in commit f6774f905fb3cfdc319523ac640be30b14c1bc55 in order to allocate {current,last,new}_picture.f (an AVFrame). Yet this is unnecessary since 7814dd77aa61703e3d43fc72bfaf6a9fbc42ff9c. The only task that ff_mpv_common_init() does that may be used is initializing the HpelDSPContext embedded in the MpegEncContext. In fact, it was not initialized before f6774f905fb3cfdc319523ac640be30b14c1bc55 and not initializing it passes FATE, yet I can't prove that it is indeed unnecessary. Therefore it is still initialized and used instead of SVQ1EncContext.hdsp. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq1enc: Allocate motion_val{8,16} during initAndreas Rheinhardt2025-06-211-19/+15
| | | | | | It only depends upon the dimensions (which do not change). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/svq1enc: Don't free scratchbuf upon errorAndreas Rheinhardt2025-06-211-1/+0
| | | | | | | | | Forgotten in 65015003f5c4b83a8202abfa7420ccf37cde6ce3; after said commit, freeing scratchbuf on error in svq1_encode_frame() could lead to segfaults lateron, because the buffer will not be allocated again. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/motion_est: Fix indentationAndreas Rheinhardt2025-06-211-90/+90
| | | | | | Forgotten after 919e749772d09900b41877e21ccb994fab0013ab. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Remove always-true branchAndreas Rheinhardt2025-06-211-4/+2
| | | | | | | Always-true since 1c40a179222f638e88c8e7b1a374753a00b0f979 which made 4863671d888273392e9dcc2429f3852c00330498 superfluous. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg_er: Mark ff_mpeg_er_init() as av_coldAndreas Rheinhardt2025-06-211-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rv10: Avoid indirection when reading VLC codesAndreas Rheinhardt2025-06-211-18/+13
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg12dec: Don't store block_last_index unnecessarilyAndreas Rheinhardt2025-06-212-5/+2
| | | | | | | | | | | Given that the MPEG-1/2 decoders unquantize the blocks on their own, block_last_index is only used to signal to ff_mpv_reconstruct_mb() whether a block is skipped or not; but this is only checked for inter macroblocks, so it is unnecessary to set block_last_index for intra macroblocks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263enc: Fix indentationAndreas Rheinhardt2025-06-211-15/+15
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263enc: Don't use array unnecessarilyAndreas Rheinhardt2025-06-211-3/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263dec: Remove redundant storeAndreas Rheinhardt2025-06-211-4/+5
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ituh263dec: Don't process unnecessarily many coefficientsAndreas Rheinhardt2025-06-211-2/+1
| | | | | | | | | | | | Overriding the number of coefficients is only necessary if ac_pred is in used, not for h263_aic alone (for which only the DC coefficient is predicted) as it is done here. And since d50635cd247e17fe16c63219b9ae80d45a8185b1 the H.263 unquantize-intra functions override the number of coefficients in case of ac_pred, so we don't have to do this here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rv10: Perform RV20 check only for RV20Andreas Rheinhardt2025-06-211-7/+7
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rv10: Perform RV20 initialization during initAndreas Rheinhardt2025-06-211-4/+4
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videodec: Don't zero blocks twiceAndreas Rheinhardt2025-06-211-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Fix a regression when probing link.exeAlexander Strasser2025-06-211-4/+3
| | | | | | | | | | | | The version ident is printed on stdout for link.exe and redirecting stdout to /dev/null will cause the output of link.exe to be paged. This caused configure to hang for some configurations and by extension some FATE clients. You might want to check if you run affected configurations automated in FATE clients or similar setups. Fixes: 45a30e03613a3c63d74a40f7ac86ce28dce14ff8 Signed-off-by: Martin Storsjö <martin@martin.st>
* avfilter/af_aresample: rework activate logic to follow the advised flow more ↵Marton Balint2025-06-211-40/+34
| | | | | | | | | | | | strictly This should prevent the possibility of audio data accumulating. The commit also cleans up and simplifies the code a bit so all frame producers (filter_frame(), flush_frame()) functions follow similar logic as ff_inlink_consume_frame() for the return code. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_aresample: make aresample return FFERROR_NOT_READY when no ↵Marton Balint2025-06-211-2/+1
| | | | | | | | progress can be made FF_FILTER_FORWARD_WANTED() already sets the ready status as needed. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/af_aresample: merge request_frame into activate functionMarton Balint2025-06-211-24/+14
| | | | | | No functional change. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/split: consume all frames before forwarding inlink statusMarton Balint2025-06-211-0/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffmpeg_filter: simplify control flow in read_framesMarton Balint2025-06-211-2/+2
| | | | | | No functional change. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/x86/f_ebur128: implement AVX peak calculationNiklas Haas2025-06-214-8/+31
| | | | Stereo only, for simplicity. Slightly faster than the C code.
* avfilter/f_ebur128: move peak detection to reusable DSP functionNiklas Haas2025-06-212-28/+37
| | | | | True peak and sample peak share almost the same logic. Define this logic in a separate function for reusability, and so we can write SIMD versions.
* avfilter/f_ebur128: move variable declarations to usage siteNiklas Haas2025-06-211-9/+9
| | | | This is actually allowed by non-ancient versions of C.
* avfilter/f_ebur128: lift sample peak calculation out of main loopNiklas Haas2025-06-211-20/+18
| | | | | This is substantially faster (~55%) than the transposed loop, and also avoids an unnecessary macro.
* avfilter/f_ebur128: move true peak calculation out of main loopNiklas Haas2025-06-211-9/+14
| | | | | | | | Easier to read, less convoluted, and ~30% faster. Most importantly, this avoids repeating the redundant recalculation of the true peak on every single sample, by moving the FIND_PEAK() loop out of the main loop. (Note that FIND_PEAK() does not depend on the current sample index at all, so there is no reason for it to ever be recomputed here)
* avfilter/f_ebur128: remove pointless macroNiklas Haas2025-06-211-13/+11
| | | | This macro is not shortening the code nor aiding readability.