Browse Source

remove a branch from an inner loop.

1% faster flac encoding.

Originally committed as revision 10865 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Loren Merritt 17 years ago
parent
commit
90f0344165
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      libavcodec/flacenc.c

+ 2
- 3
libavcodec/flacenc.c View File

@@ -474,16 +474,15 @@ static uint32_t calc_optimal_rice_params(RiceContext *rc, int porder,
uint32_t all_bits;

part = (1 << porder);
all_bits = 0;
all_bits = 4 * part;

cnt = (n >> porder) - pred_order;
for(i=0; i<part; i++) {
if(i == 1) cnt = (n >> porder);
k = find_optimal_param(sums[i], cnt);
rc->params[i] = k;
all_bits += rice_encode_count(sums[i], cnt, k);
cnt = n >> porder;
}
all_bits += (4 * part);

rc->porder = porder;



Loading…
Cancel
Save