[FFmpeg-cvslog] avcodec/intrax8dsp: Copy several bytes at once
Andreas Rheinhardt
git at videolan.org
Thu Feb 27 16:54:49 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Feb 23 21:32:57 2025 +0100| [90d9e2a26c9cf82404eaf274d0b89e2223840927] | committer: Andreas Rheinhardt
avcodec/intrax8dsp: Copy several bytes at once
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=90d9e2a26c9cf82404eaf274d0b89e2223840927
---
libavcodec/intrax8dsp.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/libavcodec/intrax8dsp.c b/libavcodec/intrax8dsp.c
index ff22aecae2..2673316369 100644
--- a/libavcodec/intrax8dsp.c
+++ b/libavcodec/intrax8dsp.c
@@ -23,6 +23,7 @@
#include "intrax8dsp.h"
#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
/*
* area positions, #3 is 1 pixel only, other are 8 pixels
@@ -226,22 +227,16 @@ static void spatial_compensation_1(const uint8_t *restrict src, uint8_t *restric
static void spatial_compensation_2(const uint8_t *restrict src, uint8_t *restrict dst, ptrdiff_t stride)
{
- int x, y;
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x++)
- dst[x] = src[area4 + 1 + y + x];
+ for (int y = 0; y < 8; y++) {
+ AV_COPY64U(dst, src + area4 + 1 + y);
dst += stride;
}
}
static void spatial_compensation_3(const uint8_t *restrict src, uint8_t *restrict dst, ptrdiff_t stride)
{
- int x, y;
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x++)
- dst[x] = src[area4 + ((y + 1) >> 1) + x];
+ for (int y = 0; y < 8; y++) {
+ AV_COPY64U(dst, src + area4 + ((y + 1) >> 1));
dst += stride;
}
}
@@ -274,11 +269,8 @@ static void spatial_compensation_5(const uint8_t *restrict src, uint8_t *restric
static void spatial_compensation_6(const uint8_t *restrict src, uint8_t *restrict dst, ptrdiff_t stride)
{
- int x, y;
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x++)
- dst[x] = src[area3 + x - y];
+ for (int y = 0; y < 8; y++) {
+ AV_COPY64U(dst, src + area3 - y);
dst += stride;
}
}
More information about the ffmpeg-cvslog
mailing list