changeset 5731:976b4c5e68bb libavcodec

gcc isn't smart enough to factor out duplicate stores
author lorenm
date Sat, 29 Sep 2007 01:54:25 +0000
parents 4134f79e37b3
children d6fc148d1a48
files flacenc.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flacenc.c	Fri Sep 28 20:38:32 2007 +0000
+++ b/flacenc.c	Sat Sep 29 01:54:25 2007 +0000
@@ -499,10 +499,11 @@
     res = &data[pred_order];
     res_end = &data[n >> pmax];
     for(i=0; i<parts; i++) {
-        sums[pmax][i] = 0;
+        uint32_t sum = 0;
         while(res < res_end){
-            sums[pmax][i] += *(res++);
+            sum += *(res++);
         }
+        sums[pmax][i] = sum;
         res_end+= n >> pmax;
     }
     /* sums for lower levels */