aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mips
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mpegvideo: Add missing headersAndreas Rheinhardt2025-07-031-0/+1
| | | | | | | These files currently rely on implicit inclusions of avassert.h and/or mathops.h via get_bits.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/g728dec: G.728 decoderPeter Ross2025-06-231-0/+1
|
* avcodec/mips: fix build failure when specific decoder/encoder enabledPeter Ross2025-06-221-0/+24
| | | | | | | | | | acelp_kelvin, g729, qcelp, sipr and wmavoice decoders all depend upon mips/{acelp_filters_mips,celp_filters_mips,acelp_vectors_mips}.o when arch is mips. g723_1 depends on mips/{celp_filters_mips,acelp_vectors_mips}.o. comfortnoise, evrc, ra144 and ra288 depend on mips/celp_filters_mips.o.
* configure: Factor mpegvideoencdsp out of mpegvideoencAndreas Rheinhardt2025-06-211-3/+3
| | | | | | | This will allow to relax the dependency on mpegvideoenc for several codecs. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: add celp_math componentPeter Ross2025-06-171-2/+1
| | | | | | libavcodec/tests/celp_math depends on libavcodec/celp_math.o This fixes fate when configuring with --disable-everything
* avcodec/iirfilter: Remove iirfilter, psy-preprocessingAndreas Rheinhardt2025-06-062-210/+0
| | | | | | | | The iirfilter is only used in its test tool since 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec which stopped using it in AAC, its only user. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pixblockdsp: Improve 8 vs 16 bit checkAndreas Rheinhardt2025-05-311-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the input in get_pixels and get_pixels_unaligned has been treated inconsistenly: - The generic code treated 9, 10, 12 and 14 bits as 16bit input (these bits correspond to what FFmpeg's dsputils supported), everything with <= 8 bits as 8 bit and everything else as 8 bit when used via AVDCT (which exposes these functions and purports to support up to 14 bits). - AARCH64, ARM, PPC and RISC-V, x86 ignore this AVDCT special case. - RISC-V also ignored the restriction to 9, 10, 12 and 14 for its 16bit check and treated everything > 8 bits as 16bit. - The mmi MIPS code treats everything as 8 bit when used via AVDCT (this is certainly broken); otherwise it checks for <= 8 bits. The msa MIPS code behaves like the generic code. This commit changes this to treat 9..16 bits as 16 bit input, everything else as 8 bit (the former because it makes sense, the latter to preserve the behaviour for external users*). *: The only internal user of AVDCT (the spp filter) always uses 8, 9 or 10 bits. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/{x86,mips}/xvididct_init: Remove redundant checksAndreas Rheinhardt2025-05-161-11/+5
| | | | | | | ff_xvid_idct_init() already checks in case of high_bit_depth, lowres or an incompatible idct_algo. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/celp_math: Mark ff_celp_math_init() as av_coldAndreas Rheinhardt2025-04-091-1/+2
| | | | | | Also do the same for ff_celp_math_init_mips(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Only keep the actually used unquantize funcsAndreas Rheinhardt2025-03-261-4/+5
| | | | | | | | | | | | | | For all encoders and all decoders except MPEG-4 the unquantize functions to use don't change at all and therefore needn't be kept in the context. So discard them after setting them; for MPEG-4, the functions get assigned on a per-frame basis. Decoders not using any unquantize functions (H.261, MPEG-1/2) as well as decoders that only call ff_mpv_reconstruct_mb() through error resilience (RV30/40, the VC-1 family) don't have the remaining pointers set at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move unquantize functions into a file of their ownAndreas Rheinhardt2025-03-261-0/+1
| | | | | | | This is in preparation for only keeping the actually used unquantize functions in MpegEncContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideoenc: Add MPVEncContextAndreas Rheinhardt2025-03-268-35/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the fields of MpegEncContext (which is also used by decoders) are actually only used by encoders. Therefore this commit adds a new encoder-only structure and moves all of the encoder-only fields to it except for those which require more explicit synchronisation between the main slice context and the other slice contexts. This synchronisation is currently mainly provided by ff_update_thread_context() which simply copies most of the main slice context over the other slice contexts. Fields which are moved to the new MPVEncContext no longer participate in this (which is desired, because it is horrible and for the fields b) below wasteful) which means that some fields can only be moved when explicit synchronisation code is added in later commits. More explicitly, this commit moves the following fields: a) Fields not copied by ff_update_duplicate_context(): dct_error_sum and dct_count; the former does not need synchronisation, the latter is synchronised in merge_context_after_encode(). b) Fields which do not change after initialisation (these fields could also be put into MPVMainEncContext at the cost of an indirection to access them): lambda_table, adaptive_quant, {luma,chroma}_elim_threshold, new_pic, fdsp, mpvencdsp, pdsp, {p,b_forw,b_back,b_bidir_forw,b_bidir_back,b_direct,b_field}_mv_table, [pb]_field_select_table, mb_{type,var,mean}, mc_mb_var, {min,max}_qcoeff, {inter,intra}_quant_bias, ac_esc_length, the *_vlc_length fields, the q_{intra,inter,chroma_intra}_matrix{,16}, dct_offset, mb_info, mjpeg_ctx, rtp_mode, rtp_payload_size, encode_mb, all function pointers, mpv_flags, quantizer_noise_shaping, frame_reconstruction_bitfield, error_rate and intra_penalty. c) Fields which are already (re)set explicitly: The PutBitContexts pb, tex_pb, pb2; dquant, skipdct, encoding_error, the statistics fields {mv,i_tex,p_tex,misc,last}_bits and i_count; last_mv_dir, esc_pos (reset when writing the header). d) Fields which are only used by encoders not supporting slice threading for which synchronisation doesn't matter: esc3_level_length and the remaining mb_info fields. e) coded_score: This field is only really used when FF_MPV_FLAG_CBP_RD is set (which implies trellis) and even then it is only used for non-intra blocks. For these blocks dct_quantize_trellis_c() either sets coded_score[n] or returns a last_non_zero value of -1 in which case coded_score will be reset in encode_mb_internal(). Therefore no old values are ever used. The MotionEstContext has not been moved yet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/libm: Only include intfloat.h when neededAndreas Rheinhardt2025-03-223-0/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mips/mpegvideo_mmi: Don't check alternate_scan unnecessarilyAndreas Rheinhardt2025-03-041-4/+1
| | | | | | | Forgotten in 4f7aeffd8c3607aea6464a20eba4cc9106173c52. Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/bit_depth_template: Remove empty macro INIT_CLIPZhao Zhili2025-01-151-2/+0
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mpegvideoencdsp: convert stride parameters from int to ptrdiff_tRamiro Polla2024-09-012-2/+2
|
* lavc/h264dsp: remove MMI 8-bit 4:2:2 chroma DC dequantRémi Denis-Courmont2024-07-143-38/+0
| | | | | The function is exactly identical to the C reference, only with the constant propagated and the loop unrolled manually.
* lavc/h264dsp: remove MMI 8-bit chroma DC dequantRémi Denis-Courmont2024-07-143-19/+1
| | | | | The function is exactly identical to the C reference, only with the constant propagated manually. It does not optimise anything.
* avcodec/mips/mpegvideo: Set denoise_dct only for encoderAndreas Rheinhardt2024-06-125-75/+134
| | | | | | | | The C version is set in ff_dct_encode_init(), yet the MIPS version is set in dct_init() (in ff_mpv_common_init() and therefore also for decoders). This commit fixes this inconsistency. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/hevc/pred: stop accessing parameter sets through HEVCParamSetsAnton Khirnov2024-06-112-148/+147
| | | | | | Instead, accept PPS/SPS as function arguments. Makes the code shorter and significantly reduces diff in future commits.
* lavc/hevc*: move to hevc/ subdirAnton Khirnov2024-06-044-4/+4
|
* lavc/hevcdec: rename HEVCContext.ref to cur_frameAnton Khirnov2024-06-041-34/+34
| | | | Since it stores a pointer to the current frame.
* lavc/hevc_ps/HEVCSPS: change flags into uint8_tAnton Khirnov2024-05-311-3/+3
| | | | | | | Reduces sizeof(HEVCSPS) by 64 bytes. Also improve flag names: drop redundant suffixes and prefixes, and consistently use disabled/enabled.
* aacdec: remove AAC-specific MIPS optimizationsLynne2024-04-238-3466/+1
| | | | | | The code was written in 2012, but seems to have been broken for just as long. Compilation is broken on every MIPS/MIPS64 system with an FPU (which the code depends on).
* aacdec: template LTP windowing separatelyLynne2024-04-231-1/+29
| | | | | | | | | The function is called only internally in DSP, so we do not need to expose it. apply_ltp on MIPS uses this function, but due to the function being just a glue function with no real optimizations, duplicate it there.
* aacdec: template windowing and transforms separatelyLynne2024-04-231-1/+1
|
* aacdec: template LTP application separatelyLynne2024-04-231-1/+1
|
* aacdec: template TNS application separatelyLynne2024-04-231-1/+1
|
* avcodec/aacdec: Use same AACDecContext for fixed and floatAndreas Rheinhardt2024-04-231-3/+3
| | | | | | | | | | | | | | | | | | Up until now, there was one AACDecContext for the fixed and one for the floating point decoder. These differed mostly in certain arrays which were int for the fixed-point and float for the floating point decoder; there were also differences in corresponding function pointers. Yet in order to deduplicate the enormous amount of currently duplicated code between the float and the fixed-point decoder, one needs common contexts. Given that int and float have the same size on all common systems, this commit replaces these arrays by unions of int arrays and of float arrays. The names of these arrays have been chosen to be compatible with AAC_RENAME(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacsbr: Make ff_aac_sbr_* funcs accept ChannelElement*Andreas Rheinhardt2024-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | Each ChannelElement contains exactly one SpectralBandReplication structure; the latter structure contains lots of buffers whose size depend upon USE_FIXED (i.e. AAC_FLOAT arrays). This complicates deduplicating the parts of the AAC decoder that are duplicated between the fixed-point and the floating point decoder. In order to fix this, the SpectralBandReplication structure will be moved from the part of ChannelElement visible to the common code. Therefore the ff_aac_sbr_* functions are ported to accept a ChannelElement*; they will then have to translate that to the corresponding SpectralBandReplication* themselves (which is possible, because there are floating-point and fixed-point versions of these functions). While just at it, also ensure that these functions are properly namespaced. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mips/ac3dsp_mips: Add missing includesAndreas Rheinhardt2024-03-311-0/+2
| | | | | | Likely broken in d7a75d21635eab4f4a1efea22945933059c2e36f. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mips/aaccoder_mips: Remove MIPS-specific aaccoderAndreas Rheinhardt2024-03-182-2504/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ff_aac_coder_init_mips() modifies a static const structure of function pointers. This will crash if the binary uses relro and is a data race in any case. Furthermore it points to a maintainability issue: The AACCoefficientsEncoder structures have been constified in commit fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3, a Libav commit merged in 318778de9ebec276cb9dfc65509231ca56590d13. Libav did not have the MIPS-specific AAC code and so this was fine for them; yet FFmpeg had them, but this was not recognized. Commit 75a099fc734a4ee2b1347d0a3d8c53d883b95174 points to another maintainability issue: Contrary to ordinary DSP code, this code here is way more complex and needs to be constantly kept in sync with the ordinary code which it mimicks and replaces. Said commit is the only commit actually changing aaccoder.c in the last few years and the same change has not been performed for the MIPS clone; before that, it even happened several times that the mips code was broken due to changes of the generic code (see commits 97437bd17a8c5d4135b2f3b1b299bd7bb72ce02c and de262d018d7d7d9c967af1dfd1b861c4b9eb2a60 or 860dbe0275e57cbf4228f3f653f872ff66ca596b or 933309a6ca0f18bf1d40e917fff455221f57fb4b or b65ffa316e377213c29736929beba584d0d80d7c). This might even lead to scenarios where someone changing non-dsp aacenc code would have to modify mips inline asm in order to keep them in sync. This is obviously a significant burden (if the AAC encoder were actively developed). Finally, the code does not even compile here due to errors like "Error: float register should be even, was 1". Reviewed-by: Lynne <dev@lynne.ee> Reviewed-by: Jean-Baptiste Kempf <jb@videolan.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Remove av_restrictAndreas Rheinhardt2024-03-157-21/+21
| | | | | | | | | All versions of MSVC that support C11 (namely >= v19.27) also support the restrict keyword, therefore av_restrict is no longer necessary since 75697836b1db3e0f0a3b7061be6be28d00c675a0. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacenc: Move initializing DSP out of aacenc.cAndreas Rheinhardt2024-03-021-0/+1
| | | | | | | | | | | | Otherwise aacenc.o gets pulled in by the aacencdsp checkasm test and it in turn pulls the rest of lavc in. Besides being bad size-wise this also has the downside that it pulls in avpriv_(cga|vga16)_font from libavutil which are marked as being imported from another library when building libavcodec as a DLL and this breaks checkasm because it links both lavc and lavu statically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/sbr: Remove unused AACDecContext* parameter from sbr_lf_gen_mipsAndreas Rheinhardt2024-02-271-1/+1
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacdec: Rename AACContext to AACDecContextAndreas Rheinhardt2024-02-272-5/+5
| | | | | | | | | | It is decoder-only; furthermore, there is already an AACContext in use by libfdk-aacenc. Also make aacdec.h provide the typedef for AACContext; up until now, this has been done by sbr.h. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avocdec/aac: Move decoder-only stuff to new header aacdec.hAndreas Rheinhardt2024-02-274-4/+4
| | | | | | | AACContext is not used by the encoder at all. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevcdsp: Offset ff_hevc_.pel_filters to simplify addressingAndreas Rheinhardt2024-02-136-25/+25
| | | | | | | | | | | | Besides simplifying address computations (it saves 432B of .text in hevcdsp.o alone here) it also fixes undefined behaviour that occurs if mx or my are 0 (happens when the filters are unused) because they lead to an array index of -1 in the old code. This happens in the checkasm-hevc_pel FATE-test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Reviewed-by: Nuo Mi <nuomi2021@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* mips/ac3dsp_mips: add missing stddef.h header includeJames Almer2023-11-251-0/+2
| | | | | | | Fixes compilation failures after 567c67c6c8cb9be083f56198bfa979e4bda84c99. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/ac3dsp: make len a size_t in float_to_fixed24James Almer2023-11-221-1/+1
| | | | | | Should simplify asm implementations, and prevent UB on at least win64. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Remove DCT, FFT, MDCT and RDFTAndreas Rheinhardt2023-10-012-517/+0
| | | | | | | | | | | | | They were replaced by TX from libavutil; the tremendous work to get to this point (both creating TX as well as porting the users of the components removed in this commit) was completely performed by Lynne alone. Removing the subsystems from configure may break some command lines, because the --disable-fft etc. options are no longer recognized. Co-authored-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* mips: fix build fail on MIPS R6Junxian Zhu2023-03-262-0/+4
| | | | | | | | Add macro define to avoid causing build fail with incompatible assembler code on MIPS R6. Signed-off-by: Junxian Zhu <zhujunxian@oss.cipunited.com> Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mips/aacsbr: port to lavu/txLynne2022-11-061-6/+6
| | | | Fixes compilation after the recent commit which ported the C code to lavu/tx.
* aacdec: convert to lavu/tx and support fixed-point 960-sample decodingLynne2022-11-061-2/+2
| | | | | | | | | | | This patch replaces the transform used in AAC with lavu/tx and removes the limitation on only being able to decode 960-sample files with the float decoder. This commit also removes a whole bunch of unnecessary and slow lifting steps the decoder did to compensate for the poor accuracy of the old integer transformation code. Overall float decoder speedup on Zen 3 for 64kbps: 32%
* avcodec/ac3dsp: Remove unused parameterAndreas Rheinhardt2022-09-291-1/+2
| | | | | | Forgotten in fd98594a8831ce037a495b6d7e090bd8f81e83a1. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/lsp: Make ff_lsp2polyf() staticAndreas Rheinhardt2022-09-291-6/+6
| | | | | | | | | | | | Possible since 48ac225db2563fe534b1d9e999bf8e70d5a577f8. Furthermore, the current code would not work on mips in case ff_lsp2polyf() were used outside of lsp.c, because it is not compiled on mips since commit 3827a86eacd04d9d7b356f769be553f7b8cca361 at all; instead it is overridden with a static av_always_inline function which only works for the callers in lsp.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/fmtconvert: Remove unused AVCodecContext parameterAndreas Rheinhardt2022-09-211-1/+0
| | | | | | | Unused since d74a8cb7e42f703be5796eeb485f06af710ae8ca. Reviewed-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/mips: Fix hevc decoding bugs on MIPS paltform.Hao Chen2022-09-166-1628/+3021
| | | | | | | | The patch fixes the bugs that occurred when running fate-checkasm-hevc_pel on MIPS paltform. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/mips: Fix bugs in me_cmp_msa.c file.Lu Wang2022-09-161-28/+173
| | | | | | | | This patch fixes a bug where the fate-checkasm-motion fails when h is not a multiple of 8. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp8dsp: Constify src in vp8_mc_funcAndreas Rheinhardt2022-09-112-127/+127
| | | | | | Reviewed-by: Peter Ross <pross@xvid.org> Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>