Commit 8d2fcd71 authored by banan's avatar banan

Simplify, patch by Ramiro Polla.

ramiro ta lisha tod ufsc tod br



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8754 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 874c03c7
...@@ -413,12 +413,7 @@ static void categorize(COOKContext *q, int* quant_index_table, ...@@ -413,12 +413,7 @@ static void categorize(COOKContext *q, int* quant_index_table,
num_bits = 0; num_bits = 0;
index = 0; index = 0;
for (j=q->total_subbands ; j>0 ; j--){ for (j=q->total_subbands ; j>0 ; j--){
exp_idx = (i - quant_index_table[index] + bias) / 2; exp_idx = av_clip((i - quant_index_table[index] + bias) / 2, 0, 7);
if (exp_idx<0){
exp_idx=0;
} else if(exp_idx >7) {
exp_idx=7;
}
index++; index++;
num_bits+=expbits_tab[exp_idx]; num_bits+=expbits_tab[exp_idx];
} }
...@@ -430,12 +425,7 @@ static void categorize(COOKContext *q, int* quant_index_table, ...@@ -430,12 +425,7 @@ static void categorize(COOKContext *q, int* quant_index_table,
/* Calculate total number of bits. */ /* Calculate total number of bits. */
num_bits=0; num_bits=0;
for (i=0 ; i<q->total_subbands ; i++) { for (i=0 ; i<q->total_subbands ; i++) {
exp_idx = (bias - quant_index_table[i]) / 2; exp_idx = av_clip((bias - quant_index_table[i]) / 2, 0, 7);
if (exp_idx<0) {
exp_idx=0;
} else if(exp_idx >7) {
exp_idx=7;
}
num_bits += expbits_tab[exp_idx]; num_bits += expbits_tab[exp_idx];
exp_index1[i] = exp_idx; exp_index1[i] = exp_idx;
exp_index2[i] = exp_idx; exp_index2[i] = exp_idx;
......
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