aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-06-30 00:40:16 -0300
committerJames Almer <jamrial@gmail.com>2017-07-04 22:49:45 -0300
commit440285474bb894ae4bd5717ae0470fd3601bc977 (patch)
tree8c32267534a6919c0aacbd98ebe089d53a0e44fd /libavcodec/x86
parentc07af720984acaafaa273369080b458d73975775 (diff)
downloadffmpeg-440285474bb894ae4bd5717ae0470fd3601bc977.tar.gz
x86/utvideodsp: make restore_rgb_planes functions work on x86_32
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/x86')
-rw-r--r--libavcodec/x86/utvideodsp.asm20
-rw-r--r--libavcodec/x86/utvideodsp_init.c2
2 files changed, 15 insertions, 7 deletions
diff --git a/libavcodec/x86/utvideodsp.asm b/libavcodec/x86/utvideodsp.asm
index a74d6e9ec1..e44c1ea471 100644
--- a/libavcodec/x86/utvideodsp.asm
+++ b/libavcodec/x86/utvideodsp.asm
@@ -21,8 +21,6 @@
%include "libavutil/x86/x86util.asm"
-%if ARCH_X86_64
-
SECTION_RODATA
pb_128: times 16 db 128
@@ -36,12 +34,18 @@ INIT_XMM sse2
; void restore_rgb_planes(uint8_t *src_r, uint8_t *src_g, uint8_t *src_b,
; ptrdiff_t linesize_r, ptrdiff_t linesize_g, ptrdiff_t linesize_b,
; int width, int height)
-cglobal restore_rgb_planes, 8,9,4, src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, w, h, x
+cglobal restore_rgb_planes, 7 + ARCH_X86_64, 7 + ARCH_X86_64 * 2, 4, src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, w, h, x
movsxdifnidn wq, wd
add src_rq, wq
add src_gq, wq
add src_bq, wq
neg wq
+%if ARCH_X86_64 == 0
+ mov wm, wq
+DEFINE_ARGS src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, x
+%define wq r6m
+%define hd r7mp
+%endif
mova m3, [pb_128]
.nextrow:
mov xq, wq
@@ -65,7 +69,7 @@ cglobal restore_rgb_planes, 8,9,4, src_r, src_g, src_b, linesize_r, linesize_g,
jg .nextrow
REP_RET
-cglobal restore_rgb_planes10, 8,9,5, src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, w, h, x
+cglobal restore_rgb_planes10, 7 + ARCH_X86_64, 7 + ARCH_X86_64 * 2, 5, src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, w, h, x
shl wd, 1
shl linesize_rq, 1
shl linesize_gq, 1
@@ -76,6 +80,12 @@ cglobal restore_rgb_planes10, 8,9,5, src_r, src_g, src_b, linesize_r, linesize_g
mova m3, [pw_512]
mova m4, [pw_1023]
neg wq
+%if ARCH_X86_64 == 0
+ mov wm, wq
+DEFINE_ARGS src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, x
+%define wq r6m
+%define hd r7mp
+%endif
.nextrow:
mov xq, wq
@@ -99,5 +109,3 @@ cglobal restore_rgb_planes10, 8,9,5, src_r, src_g, src_b, linesize_r, linesize_g
sub hd, 1
jg .nextrow
REP_RET
-
-%endif
diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c
index d4156926bd..f8b2a9b074 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -36,7 +36,7 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
{
int cpu_flags = av_get_cpu_flags();
- if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+ if (EXTERNAL_SSE2(cpu_flags)) {
c->restore_rgb_planes = ff_restore_rgb_planes_sse2;
c->restore_rgb_planes10 = ff_restore_rgb_planes10_sse2;
}