summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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]>
* avutil/log: Set AVClass* in av_expr_eval()Andreas Rheinhardt2025-03-081-5/+7
| | | | | | | | Otherwise it is possible for av_log() to receive a non-NULL object with a NULL AVClass pointer; the default log callback handles it gracefully, yet this is probably an API violation. Signed-off-by: Andreas Rheinhardt <[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]>
* avcodec/mpegvideo_enc: Move H.263 specific check to ituh263enc.cAndreas Rheinhardt2025-03-072-3/+3
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Move vbv_delay warning to mpeg12enc.cAndreas Rheinhardt2025-03-072-11/+9
| | | | | | It is MPEG-1/2 only. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Move q_scale_type check to mpeg12enc.cAndreas Rheinhardt2025-03-072-8/+8
| | | | | | The MPEG-2 encoder is the only encoder supporting q_scale_type. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Move q_matrix init to init_matrices()Andreas Rheinhardt2025-03-071-16/+14
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Don't init matrices unnecessarily for MJPEGAndreas Rheinhardt2025-03-071-0/+4
| | | | | | The MJPEG initialization happens later. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Only allocate inter matrices when neededAndreas Rheinhardt2025-03-071-14/+13
| | | | | | Also allocate them jointly with intra matrices when needed. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Factor checks out of loopAndreas Rheinhardt2025-03-071-22/+27
| | | | | | | Also move this code to init_matrices(). Reviewed-by: Ramiro Polla <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Set chroma_intra_matrix for SpeedHQAndreas Rheinhardt2025-03-071-4/+1
| | | | | | | Used with trellis; notice that inter_matrix is unused for (intra-only) SpeedHQ, so it is irrelevant that its value changes. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Only allocate chroma intra matrices when neededAndreas Rheinhardt2025-03-071-9/+18
| | | | | | | Also start factoring the matrix-init code out into a function of its own to declutter ff_mpv_encode_init(). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg4video: Move IS_3IV1 macro to mpeg4videodec.cAndreas Rheinhardt2025-03-072-6/+6
| | | | | | Also add parentheses around the replacement to make it safer. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg4video: Split ff_mpeg4_pred_dc()Andreas Rheinhardt2025-03-073-50/+55
| | | | | | | | | | | | | | | | | | | | | It currently does two things: a) Get a prediction for the dc and the dc direction and b) process said prediction. Processing the prediction differs for encoding (getting a diff) and decoding (getting the level via diff+prediction). So having a common function performing b) makes no sense. Even worse, there is a decoding mode where the dc coefficient (diff) is not coded specially and therefore unavailable before entering the block decoding loop, so that one can only perform a). Before this commit, the decoder simply called ff_mpeg4_pred_dc() twice; the results of the b) part of the call before the loop were ignored (but the compiler could not elide them because they involved error messages) and a) was also performed twice. This commit changes this by splitting b) out of ff_mpeg4_pred_dc() and moving this code to decoder and encoder. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg4videodec: Bail out earlier when parsingAndreas Rheinhardt2025-03-071-6/+6
| | | | | | | The scantables are unused for the parser (and in fact the IDCT permutation used has not been initialized at all). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ituh263dec: Reorder branchesAndreas Rheinhardt2025-03-071-3/+3
| | | | | | | | | (To perform this optimization a compiler would have to look at both ff_rv_decode_dc() and av_log(). The latter seems very unlikely.) Reviewed-by: Ramiro Polla <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/flvenc: Remove redundant setting of dc_scale_tablesAndreas Rheinhardt2025-03-071-10/+0
| | | | | | | | h263_aic is always zero for FLV and ff_mpeg1_dc_scale_table is already the default dc_scale table for both y and c. h263_aic is also always zero for the FLV decoder. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ituh263enc: Use memset where appropriateAndreas Rheinhardt2025-03-071-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ituh263enc: Make SVQ1+Snowenc stop calling ff_h263_encode_init()Andreas Rheinhardt2025-03-074-126/+127
| | | | | | | | | | They only do it for the mv_penalty table. Factor initializating the static tables out into a function of its own; also move everything not needed by SVQ1 or Snow behind #if CONFIG_H263_ENCODER (this involved moving ff_h263_encode_motion() which is used by svq1enc). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ituh263enc: Combine branchesAndreas Rheinhardt2025-03-071-4/+3
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ituh263enc: Remove redundant setting of dc_scale_tablesAndreas Rheinhardt2025-03-071-4/+0
| | | | | | | ff_mpeg1_dc_scale_table is already the default dc_scale table for both y and c. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ituh263enc: Move MPEG-4 fcode_tab to mpeg4videoenc.cAndreas Rheinhardt2025-03-072-12/+11
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegutils: Move MAX_FCODE to mpegvideoenc.hAndreas Rheinhardt2025-03-072-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_enc: Move default_mv_penalty to h261enc.cAndreas Rheinhardt2025-03-072-2/+6
| | | | | | | | | | | MPEG-1/2 and the H.263-based encoders overwrite the default later and SpeedHQ and MJPEG-based encoders are intra-only and don't need a mv_penalty table at all. So only H.261 uses this table. Also add a comment to explain why it exists and is non-const. Reviewed-by: Ramiro Polla <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/h261: Use forward-declaration for MpegEncContextAndreas Rheinhardt2025-03-071-2/+2
| | | | | | Avoids an indirect inclusion of mpegvideo.h in h261data.c. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/h261dec: Don't call ff_set_qscale()Andreas Rheinhardt2025-03-071-4/+6
| | | | | | Most of what it does is unneeded for H.261. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12dec: Mark flush as coldAndreas Rheinhardt2025-03-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12dec: Don't count errors from first thread twiceAndreas Rheinhardt2025-03-071-3/+11
| | | | | | | | | | Compilers can not perform this optimization on their own given that they don't know that the different thread_context pointers don't alias. Also avoid using sequentially consistent operations with atomics when only a single thread accesses them. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vc1dec: Don't initialize unused parts of ScanTableAndreas Rheinhardt2025-03-071-2/+2
| | | | | | | The VC-1 decoders don't need ScanTable.raster_end as they don't call any of the unquantize functions. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vc1_block: Inline y_dc_scale_tableAndreas Rheinhardt2025-03-072-13/+11
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vc1_block, vc1dec: Don't use c_dc_scale(_table)?Andreas Rheinhardt2025-03-072-33/+11
| | | | | | It coincides with the luma values. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/rv34: Make ff_rv34_get_start_offset() honor its nameAndreas Rheinhardt2025-03-073-7/+3
| | | | | | | | Up until now, it only returned the number of bits for the start offset, but not the start offset; the GetBitContext passed to it was unused. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/aarch64/vvc: Optimize vvc_avg{8, 10, 12}Krzysztof Pyrkosz2025-03-071-47/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces integer widening with halving addition, and multi-step "emulated" rounding shift with a single asm instruction doing exactly that. Benchmarks before and after: A78 avg_8_64x64_neon: 2686.2 ( 6.12x) avg_8_128x128_neon: 10734.2 ( 5.88x) avg_10_64x64_neon: 2536.8 ( 5.40x) avg_10_128x128_neon: 10079.0 ( 5.22x) avg_12_64x64_neon: 2548.2 ( 5.38x) avg_12_128x128_neon: 10133.8 ( 5.19x) avg_8_64x64_neon: 897.8 (18.26x) avg_8_128x128_neon: 3608.5 (17.37x) avg_10_32x32_neon: 444.2 ( 8.51x) avg_10_64x64_neon: 1711.8 ( 8.00x) avg_12_64x64_neon: 1706.2 ( 8.02x) avg_12_128x128_neon: 7010.0 ( 7.46x) A72 avg_8_64x64_neon: 5823.4 ( 3.88x) avg_8_128x128_neon: 17430.5 ( 4.73x) avg_10_64x64_neon: 5228.1 ( 3.71x) avg_10_128x128_neon: 16722.2 ( 4.17x) avg_12_64x64_neon: 5379.1 ( 3.51x) avg_12_128x128_neon: 16715.7 ( 4.17x) avg_8_64x64_neon: 2006.5 (10.61x) avg_8_128x128_neon: 9158.7 ( 8.96x) avg_10_64x64_neon: 3357.7 ( 5.60x) avg_10_128x128_neon: 12411.7 ( 5.56x) avg_12_64x64_neon: 3317.5 ( 5.67x) avg_12_128x128_neon: 12358.5 ( 5.58x) A53 avg_8_64x64_neon: 8327.8 ( 5.18x) avg_8_128x128_neon: 31631.3 ( 5.34x) avg_10_64x64_neon: 8783.5 ( 4.98x) avg_10_128x128_neon: 32617.0 ( 5.25x) avg_12_64x64_neon: 8686.0 ( 5.06x) avg_12_128x128_neon: 32487.5 ( 5.25x) avg_8_64x64_neon: 6032.3 ( 7.17x) avg_8_128x128_neon: 22008.5 ( 7.69x) avg_10_64x64_neon: 7738.0 ( 5.68x) avg_10_128x128_neon: 27813.8 ( 6.14x) avg_12_64x64_neon: 7844.5 ( 5.60x) avg_12_128x128_neon: 26999.5 ( 6.34x) Signed-off-by: Martin Storsjö <[email protected]>
* Added support for direct RGB input to AMF encoderDmitrii Ovchinnikov2025-03-062-0/+9
|