summaryrefslogtreecommitdiffstats
path: root/libavcodec/flacenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-07-02 09:30:51 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-07-02 09:30:51 +0000
commit78f67b7ad33e0b5df41c9df5048bde5ffcef06ed (patch)
tree0f84933bec1aa6c13919f1202a357e5b3921e8b1 /libavcodec/flacenc.c
parent7943355485cf889c14f9c4151f917ae2be01ee73 (diff)
downloadffmpeg-streaming-78f67b7ad33e0b5df41c9df5048bde5ffcef06ed.zip
ffmpeg-streaming-78f67b7ad33e0b5df41c9df5048bde5ffcef06ed.tar.gz
simplify
Originally committed as revision 5571 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r--libavcodec/flacenc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 75d77d1..aba02ab 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -301,20 +301,19 @@ static void calc_sums(int pmax, uint32_t *data, int n, int pred_order,
uint32_t sums[][256])
{
int i, j;
- int parts, cnt;
- uint32_t *res;
+ int parts;
+ uint32_t *res, *res_end;
/* sums for highest level */
parts = (1 << pmax);
res = &data[pred_order];
- cnt = (n >> pmax) - pred_order;
+ res_end = &data[n >> pmax];
for(i=0; i<parts; i++) {
- if(i == 1) cnt = (n >> pmax);
- if(i > 0) res = &data[i*cnt];
sums[pmax][i] = 0;
- for(j=0; j<cnt; j++) {
- sums[pmax][i] += res[j];
+ while(res < res_end){
+ sums[pmax][i] += *(res++);
}
+ res_end+= n >> pmax;
}
/* sums for lower levels */
for(i=pmax-1; i>=0; i--) {
OpenPOWER on IntegriCloud