]> granicus.if.org Git - libx264/commitdiff
Fix miscompilation with gcc 4.3 on ARM
authorFiona Glaser <fiona@x264.com>
Wed, 4 Nov 2009 08:03:14 +0000 (00:03 -0800)
committerFiona Glaser <fiona@x264.com>
Mon, 9 Nov 2009 04:21:46 +0000 (20:21 -0800)
Aliasing violation in spatial prediction caused nasty artifacts.
Shut up two other GCC warnings while we're at it.

common/macroblock.c
encoder/analyse.c

index 27e010ba1668bf7983182dd76747aa1da57ec760..0e0151577f95b8c998efcf0e32e9dac6008a3b3d 100644 (file)
@@ -259,11 +259,17 @@ static int x264_mb_predict_mv_direct16x16_spatial( x264_t *h )
     if( ref[0] >= 0 )
         x264_mb_predict_mv_16x16( h, 0, ref[0], mv[0] );
     else
-        *(uint32_t*)mv[0] = 0;
+    {
+        mv[0][0] = 0;
+        mv[0][1] = 0;
+    }
     if( ref[1] >= 0 )
         x264_mb_predict_mv_16x16( h, 1, ref[1], mv[1] );
     else
-        *(uint32_t*)mv[1] = 0;
+    {
+        mv[1][0] = 0;
+        mv[1][1] = 0;
+    }
 
     x264_macroblock_cache_ref( h, 0, 0, 4, 4, 0, ref[0] );
     x264_macroblock_cache_ref( h, 0, 0, 4, 4, 1, ref[1] );
index e518fd554976ff7df7f15dc69b6cd5c27a7601e2..47aa0c231ce9c3764e8c493e84540f194e01c07d 100644 (file)
@@ -236,7 +236,7 @@ static const int i_sub_mb_p_cost_table[4] = {
 static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a );
 
 static uint16_t x264_cost_ref[92][3][33];
-static x264_pthread_mutex_t cost_ref_mutex = X264_PTHREAD_MUTEX_INITIALIZER;
+static UNUSED x264_pthread_mutex_t cost_ref_mutex = X264_PTHREAD_MUTEX_INITIALIZER;
 
 int x264_analyse_init_costs( x264_t *h, int qp )
 {
@@ -1101,7 +1101,7 @@ static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
         {
             uint64_t pels_h = 0;
             uint8_t pels_v[7];
-            uint16_t i_nnz[2];
+            uint16_t i_nnz[2] = {0}; //shut up gcc
             uint8_t *p_dst_by;
             int j;
             int cbp_luma_new = 0;