aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pixblockdsp.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/pixblockdsp: Pass bits_per_raw_sample directlyAndreas Rheinhardt2025-05-311-4/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pixblockdsp: Improve 8 vs 16 bit checkAndreas Rheinhardt2025-05-311-20/+13
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lavc/pixblockdsp: specialise aligned 16-bit get_pixelsRémi Denis-Courmont2024-08-011-1/+8
| | | | | | The current code assumes that we have unaligned rows, which hurts on platforms with slower unaligned accesses. (Also, this lets the compiler unroll manually, which it seems to do in practice.)
* libavcodec/alpha: remove DSP & support codeSean McGovern2024-06-131-2/+0
| | | | | | | | | | | | | | | | | | Introduced in 1992, the Alpha was a 64-bit RISC processor designed to replace the VAX CISC machines sold by Digital Equipment Corporation. After Digital was acquired by Compaq in 1998 -- who themselves would be later purchased by Hewlett-Packard, the architecture was phased out over the following decade. It became effectively defunct in 2007, the last publicly available processor being the Alpha 21364. FFmpeg has not added any DSP code for this architecture since lowres2 was introduced in 2012, and it is more than unlikely someone still wishes to maintain it. Remove the DSP and support code. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* configure: Remove av_restrictAndreas Rheinhardt2024-03-151-3/+3
| | | | | | | | | 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>
* lavc/pixblockdsp: RISC-V I get_pixelsRémi Denis-Courmont2022-09-271-0/+2
| | | | | | Benchmarks on SiFive U74-MC (courtesy of Shanghai StarFive Tech): get_pixels_c: 180.0 get_pixels_rvi: 136.7
* all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt2022-06-151-13/+14
| | | | | | | | | | | | | | | | | | This is more spec-compliant because it does not rely on dead-code elimination by the compiler. Especially MSVC has problems with this, as can be seen in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html or https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html This commit does not eliminate every instance where we rely on dead code elimination: It only tackles branching to the initialization of arch-specific dsp code, not e.g. all uses of CONFIG_ and HAVE_ checks. But maybe it is already enough to compile FFmpeg with MSVC with whole-programm-optimizations enabled (if one does not disable too many components). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavcodec: aarch64: Add a NEON implementation of pixblockdspMartin Storsjö2020-05-151-0/+2
| | | | | | | | | | | | | | Cortex A53 A72 A73 get_pixels_c: 140.7 87.7 72.5 get_pixels_neon: 46.0 20.0 19.5 get_pixels_unaligned_c: 140.7 87.7 73.0 get_pixels_unaligned_neon: 49.2 20.2 26.2 diff_pixels_c: 209.7 133.7 138.7 diff_pixels_neon: 54.2 31.7 23.5 diff_pixels_unaligned_c: 209.7 134.2 139.0 diff_pixels_unaligned_neon: 68.0 27.7 41.7 Signed-off-by: Martin Storsjö <martin@martin.st>
* pixblockdsp, avdct: Add get_pixels_unalignedMartin Storsjö2020-05-131-0/+2
| | | | | | | | | | | | | Use this in vf_spp.c, where the get_pixels operation is done on unaligned source addresses. Hook up the x86 (mmx and sse) versions of get_pixels to this function pointer, as those implementations seem to support unaligned use. This fixes fate-filter-spp on armv7. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/me_cmp: Fix crashes on ARM due to misalignmentMichael Niedermayer2017-08-211-0/+1
| | | | | | | | Adds a diff_pixels_unaligned() Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=872503 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'de452e503734ebb0fdbce86e9d16693b3530fad3'Clément Bœsch2017-03-201-12/+12
|\ | | | | | | | | | | | | * commit 'de452e503734ebb0fdbce86e9d16693b3530fad3': pixblockdsp: Change type of stride parameters to ptrdiff_t Merged-by: Clément Bœsch <u@pkh.me>
| * pixblockdsp: Change type of stride parameters to ptrdiff_tDiego Biurrun2016-09-141-1/+1
| | | | | | | | | | | | | | This avoids SIMD-optimized functions having to sign-extend their line size argument manually to be able to do pointer arithmetic. Also adjust parameter names to be "stride" everywhere.
* | pixblockdsp: Use AV_COPY128U for get_pixels_16_cTimothy Gu2015-10-311-5/+32
| | | | | | | | | | | | | | Before: 15543 decicycles in get_pixels, 4193214 runs, 1090 skips After: 5713 decicycles in get_pixels, 8387564 runs, 1044 skips
* | avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for pixblock functionsShivraj Patil2015-06-291-0/+2
| | | | | | | | | | | | | | | | This patch adds MSA (MIPS-SIMD-Arch) optimizations for pixblock functions in new file pixblockdsp_msa.c Adds new generic macros (needed for this patch) in libavutil/mips/generic_macros_msa.h Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | alpha/pixblockdsp: move code out of dsputilJames Almer2014-07-101-0/+2
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f46bb608d9d76c543e4929dc8cffe36b84bd789e'Michael Niedermayer2014-07-101-6/+10
|/ | | | | | | | | | | | | | | * commit 'f46bb608d9d76c543e4929dc8cffe36b84bd789e': dsputil: Split off pixel block routines into their own context Conflicts: configure libavcodec/dsputil.c libavcodec/mpegvideo_enc.c libavcodec/pixblockdsp_template.c libavcodec/x86/dsputilenc.asm libavcodec/x86/dsputilenc_mmx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* dsputil: Split off pixel block routines into their own contextDiego Biurrun2014-07-091-0/+76