shithub: openh264

Download patch

ref: f56bdc3aa40de8ea3c03188ef984b316b69fbd74
parent: 2eb88007121a85b23bdfe85b16a36b06a3f793ba
author: Sindre Aamås <[email protected]>
date: Thu Apr 21 12:29:02 EDT 2016

[Encoder/x86] Minor CavlcParamCal_sse42 tweak

Avoid loading single-use parameter.

--- a/codec/encoder/core/x86/coeff.asm
+++ b/codec/encoder/core/x86/coeff.asm
@@ -517,12 +517,13 @@
 %define p_run          r1
 %define p_level        r2
 %define p_total_coeffs r3
-%define i_endidxd      r4d
+%define i_endidxd      dword arg5d
 
 %ifdef X86_32
+    push            r4
     push            r5
     push            r6
-    %assign push_num 2
+    %assign push_num 3
     %define r_mask  r5
     %define r_maskd r5d
     %define p_shufb_lut wels_cavlc_param_cal_shufb_lut
@@ -544,7 +545,7 @@
     lea             p_shufb_lut, [wels_cavlc_param_cal_shufb_lut]
 %endif
 
-    LOAD_5_PARA
+    LOAD_4_PARA
     PUSH_XMM 2
 
     ; Free up rcx/ecx because only cl is accepted as shift amount operand.
@@ -644,10 +645,11 @@
 .done:
     mov             retrq, i_total_zeros
     POP_XMM
-    LOAD_5_PARA_POP
+    LOAD_4_PARA_POP
 %ifdef X86_32
     pop             r6
     pop             r5
+    pop             r4
 %elifdef WIN64
     pop             rbx
 %endif