shithub: openh264

Download patch

ref: 44bce08d6076fa167e77e8124c1ea8fe25c7e097
parent: a5cb0ea22c6e3a386b19463a0973ebc3afa570bf
author: Martin Storsjö <martin@martin.st>
date: Fri Jun 27 12:06:32 EDT 2014

Avoid a spurious valgrind warning in DecoderIntraPredictionTest.WelsDecoderI16x16LumaPredPlane_sse2

valgrind thinks xmm2 is uninitialized - in fact it is, but
its value here doesn't really matter. Instead set it to a known value
before using it in SUMW_HORIZON.

--- a/codec/decoder/core/x86/intra_pred.asm
+++ b/codec/decoder/core/x86/intra_pred.asm
@@ -259,6 +259,13 @@
     pmullw  xmm7,   xmm6
     psubw   xmm7,   xmm0
 
+    ; Indicate that xmm2 is fully initialized. Its actual value doesn't
+    ; matter in SUMW_HORIZON below, but after being used in LOAD_COLUMN above,
+    ; valgrind thinks that xmm2 contains uninitalized data (if the columns outside
+    ; of the left are uninitialized, such as in DecUT_IntraPrediction), which taints
+    ; r2d below, even if actually isn't based on the uninitialized data.
+    pxor xmm2, xmm2
+
     SUMW_HORIZON   xmm7,xmm0,xmm2
     movd    r2d,   xmm7         ; V
     movsx   r2, r2w