shithub: openh264

Download patch

ref: 4769d4d0b8917e16106747442e24336cf44f5ad8
parent: 17eed992af381d05e0a3af811aa4320d5b2cbbda
author: Sindre Aamås <[email protected]>
date: Tue Mar 7 09:33:29 EST 2017

[Processing/x86] Simplify denoisefilter X86_32_PICASM handling

Utilize program counter-relative offsets to simplify X86_32_PICASM
code.

In order for this to work with nasm, data constants are placed in
the text segment.

--- a/codec/processing/src/x86/denoisefilter.asm
+++ b/codec/processing/src/x86/denoisefilter.asm
@@ -44,7 +44,11 @@
 ;***********************************************************************
 ; Constant
 ;***********************************************************************
+%ifdef X86_32_PICASM
+SECTION .text align=16
+%else
 SECTION .rodata align=16
+%endif
 
 sse2_32 times 8 dw 32
 sse2_20 times 8 dw 20
@@ -147,20 +151,7 @@
     movdqa      %2, %1
     psrldq      %2, 2
     punpcklbw   %2, %4
-%ifdef X86_32_PICASM
-    push        r0
-    mov         r0, esp
-    and         esp, 0xfffffff0
-    push        0x00140014
-    push        0x00140014
-    push        0x00140014
-    push        0x00140014
-    pmullw      %2, [esp]
-    mov         esp, r0
-    pop         r0
-%else
-    pmullw      %2, [sse2_20]
-%endif
+    pmullw      %2, [pic(sse2_20)]
     paddw       %3, %2
 
     movdqa      %2, %1
@@ -254,6 +245,7 @@
 
     %assign push_num 1
 
+    INIT_X86_32_PIC r4
     LOAD_2_PARA
 
     mov     r3, r1
@@ -285,6 +277,7 @@
     movq        [r0 + 2],       xmm3
 
 
+    DEINIT_X86_32_PIC
     pop r3
 
     %assign push_num 0