mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
regainplay_analysis : Work around GCC optimizer bug.
Discussion: http://lists.xiph.org/pipermail/flac-dev/2014-June/004720.html Patch-from: lvqcl <lvqcl.mail@gmail.com>
This commit is contained in:
@@ -536,7 +536,11 @@ analyzeResult ( Uint32_t* Array, size_t len )
|
|||||||
if ( elems == 0 )
|
if ( elems == 0 )
|
||||||
return GAIN_NOT_ENOUGH_SAMPLES;
|
return GAIN_NOT_ENOUGH_SAMPLES;
|
||||||
|
|
||||||
|
#if 0 /* GCC bug workaround: it incorrectly calculates 'elems * (1. - RMS_PERCENTILE)' with -O3 -msse2 ... options */
|
||||||
upper = (Int32_t) ceil (elems * (1. - RMS_PERCENTILE));
|
upper = (Int32_t) ceil (elems * (1. - RMS_PERCENTILE));
|
||||||
|
#else
|
||||||
|
upper = (Int32_t) (elems / 20 + ((elems % 20) ? 1 : 0));
|
||||||
|
#endif
|
||||||
for ( i = len; i-- > 0; ) {
|
for ( i = len; i-- > 0; ) {
|
||||||
if ( (upper -= Array[i]) <= 0 )
|
if ( (upper -= Array[i]) <= 0 )
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user