x86/h264_weight: use appropriate register size for weight parameters

Message ID 20160929112846.28943-1-martin@martin.st
State Committed
Commit 8d1267932ca9c2e343ef303349101bab6681d02e
Headers show

Commit Message

Martin Storsjö Sept. 29, 2016, 11:28 a.m.
From: Hendrik Leppkes <h.leppkes@gmail.com>

This fixes decoding corruption on 64 bit windows.
---
 libavcodec/x86/h264_weight.asm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Luca Barbato Sept. 29, 2016, 12:40 p.m. | #1
On 29/09/16 13:28, Martin Storsjö wrote:
> From: Hendrik Leppkes <h.leppkes@gmail.com>
> 
> This fixes decoding corruption on 64 bit windows.
> ---
>  libavcodec/x86/h264_weight.asm | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 

Looks fine.
Anton Khirnov Sept. 29, 2016, 12:44 p.m. | #2
Quoting Martin Storsjö (2016-09-29 13:28:46)
> From: Hendrik Leppkes <h.leppkes@gmail.com>
> 
> This fixes decoding corruption on 64 bit windows.
> ---
>  libavcodec/x86/h264_weight.asm | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/x86/h264_weight.asm b/libavcodec/x86/h264_weight.asm
> index 9ad26de..e421ec8 100644
> --- a/libavcodec/x86/h264_weight.asm
> +++ b/libavcodec/x86/h264_weight.asm
> @@ -134,16 +134,16 @@ WEIGHT_FUNC_HALF_MM 8, 8
>      mov  off_regd, r7m
>      add  off_regd, 1
>      or   off_regd, 1
> -    add        r4, 1
> -    cmp        r6d, 128
> +    add       r4d, 1
> +    cmp       r6d, 128
>      je .nonnormal
> -    cmp        r5, 128
> +    cmp       r5d, 128
>      jne .normal
>  .nonnormal
> -    sar        r5, 1
> -    sar        r6, 1
> +    sar       r5d, 1
> +    sar       r6d, 1
>      sar  off_regd, 1
> -    sub        r4, 1
> +    sub       r4d, 1
>  .normal
>  %if cpuflag(ssse3)
>      movd       m4, r5d
> -- 
> 2.8.4 (Apple Git-73)

Is this not tested by FATE?

Patch

diff --git a/libavcodec/x86/h264_weight.asm b/libavcodec/x86/h264_weight.asm
index 9ad26de..e421ec8 100644
--- a/libavcodec/x86/h264_weight.asm
+++ b/libavcodec/x86/h264_weight.asm
@@ -134,16 +134,16 @@  WEIGHT_FUNC_HALF_MM 8, 8
     mov  off_regd, r7m
     add  off_regd, 1
     or   off_regd, 1
-    add        r4, 1
-    cmp        r6d, 128
+    add       r4d, 1
+    cmp       r6d, 128
     je .nonnormal
-    cmp        r5, 128
+    cmp       r5d, 128
     jne .normal
 .nonnormal
-    sar        r5, 1
-    sar        r6, 1
+    sar       r5d, 1
+    sar       r6d, 1
     sar  off_regd, 1
-    sub        r4, 1
+    sub       r4d, 1
 .normal
 %if cpuflag(ssse3)
     movd       m4, r5d