From: Jason Garrett-Glaser Date: Wed, 4 Nov 2009 08:03:14 +0000 (-0800) Subject: Fix miscompilation with gcc 4.3 on ARM X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=820380f981da35ae4f8fc124cb8b5ee1c4cbad4b;p=x264.git Fix miscompilation with gcc 4.3 on ARM Aliasing violation in spatial prediction caused nasty artifacts. Shut up two other GCC warnings while we're at it. --- diff --git a/common/macroblock.c b/common/macroblock.c index 56e771f5..fe4aa0ee 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -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] ); diff --git a/encoder/analyse.c b/encoder/analyse.c index 51dd2278..26e68e14 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -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;