Commit 72156b0e authored by lorenm's avatar lorenm

remove a branch from an inner loop.

1% faster flac encoding.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10865 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f5123b7a
...@@ -474,16 +474,15 @@ static uint32_t calc_optimal_rice_params(RiceContext *rc, int porder, ...@@ -474,16 +474,15 @@ static uint32_t calc_optimal_rice_params(RiceContext *rc, int porder,
uint32_t all_bits; uint32_t all_bits;
part = (1 << porder); part = (1 << porder);
all_bits = 0; all_bits = 4 * part;
cnt = (n >> porder) - pred_order; cnt = (n >> porder) - pred_order;
for(i=0; i<part; i++) { for(i=0; i<part; i++) {
if(i == 1) cnt = (n >> porder);
k = find_optimal_param(sums[i], cnt); k = find_optimal_param(sums[i], cnt);
rc->params[i] = k; rc->params[i] = k;
all_bits += rice_encode_count(sums[i], cnt, k); all_bits += rice_encode_count(sums[i], cnt, k);
cnt = n >> porder;
} }
all_bits += (4 * part);
rc->porder = porder; rc->porder = porder;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment