shithub: libvpx

Download patch

ref: 47613d071c1d9300a8ecfcef2765be20118b1ba7
parent: 0f20c839d7f5c6944ce5eac5a391aa441991cd82
author: Johann <johannkoenig@google.com>
date: Tue Oct 29 08:16:26 EDT 2013

idct_blk_mmx.c: use vpx_memset instead of cast

Fix warning with -Wstrict-aliasing=1

Change-Id: Ic37013e6477cf213925830d0bd8e6f17364ff7cc

--- a/vp8/common/x86/idct_blk_mmx.c
+++ b/vp8/common/x86/idct_blk_mmx.c
@@ -11,6 +11,7 @@
 #include "vpx_config.h"
 #include "vp8_rtcd.h"
 #include "vp8/common/blockd.h"
+#include "vpx_mem/vpx_mem.h"
 
 extern void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q);
 
@@ -35,7 +36,7 @@
         else if (eobs[0] == 1)
         {
             vp8_dc_only_idct_add_mmx (q[0]*dq[0], dst, stride, dst, stride);
-            ((int *)q)[0] = 0;
+            vpx_memset(q, 0, 2 * sizeof(q[0]));
         }
 
         if (eobs[1] > 1)
@@ -44,7 +45,7 @@
         {
             vp8_dc_only_idct_add_mmx (q[16]*dq[0], dst+4, stride,
                                       dst+4, stride);
-            ((int *)(q+16))[0] = 0;
+            vpx_memset(q + 16, 0, 2 * sizeof(q[0]));
         }
 
         if (eobs[2] > 1)
@@ -53,7 +54,7 @@
         {
             vp8_dc_only_idct_add_mmx (q[32]*dq[0], dst+8, stride,
                                       dst+8, stride);
-            ((int *)(q+32))[0] = 0;
+            vpx_memset(q + 32, 0, 2 * sizeof(q[0]));
         }
 
         if (eobs[3] > 1)
@@ -62,7 +63,7 @@
         {
             vp8_dc_only_idct_add_mmx (q[48]*dq[0], dst+12, stride,
                                       dst+12, stride);
-            ((int *)(q+48))[0] = 0;
+            vpx_memset(q + 48, 0, 2 * sizeof(q[0]));
         }
 
         q    += 64;
@@ -84,7 +85,7 @@
         else if (eobs[0] == 1)
         {
             vp8_dc_only_idct_add_mmx (q[0]*dq[0], dstu, stride, dstu, stride);
-            ((int *)q)[0] = 0;
+            vpx_memset(q, 0, 2 * sizeof(q[0]));
         }
 
         if (eobs[1] > 1)
@@ -93,7 +94,7 @@
         {
             vp8_dc_only_idct_add_mmx (q[16]*dq[0], dstu+4, stride,
                                       dstu+4, stride);
-            ((int *)(q+16))[0] = 0;
+            vpx_memset(q + 16, 0, 2 * sizeof(q[0]));
         }
 
         q    += 32;
@@ -108,7 +109,7 @@
         else if (eobs[0] == 1)
         {
             vp8_dc_only_idct_add_mmx (q[0]*dq[0], dstv, stride, dstv, stride);
-            ((int *)q)[0] = 0;
+            vpx_memset(q, 0, 2 * sizeof(q[0]));
         }
 
         if (eobs[1] > 1)
@@ -117,7 +118,7 @@
         {
             vp8_dc_only_idct_add_mmx (q[16]*dq[0], dstv+4, stride,
                                       dstv+4, stride);
-            ((int *)(q+16))[0] = 0;
+            vpx_memset(q + 16, 0, 2 * sizeof(q[0]));
         }
 
         q    += 32;