[FFmpeg-cvslog] x86/utvideodsp: make restore_rgb_planes functions work on x86_32

James Almer git at videolan.org
Wed Jul 5 05:03:23 EEST 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Jun 30 00:40:16 2017 -0300| [440285474bb894ae4bd5717ae0470fd3601bc977] | committer: James Almer

x86/utvideodsp: make restore_rgb_planes functions work on x86_32

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=440285474bb894ae4bd5717ae0470fd3601bc977
---

 libavcodec/x86/utvideodsp.asm    | 20 ++++++++++++++------
 libavcodec/x86/utvideodsp_init.c |  2 +-
 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;
     }



More information about the ffmpeg-cvslog mailing list