mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
ac3dec: unroll inner loop in exponent decoding. 46% faster decode_exponents().
Originally committed as revision 16018 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
806703243e
commit
96f229d6c0
@ -390,12 +390,15 @@ static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,
|
|||||||
|
|
||||||
/* convert to absolute exps and expand groups */
|
/* convert to absolute exps and expand groups */
|
||||||
prevexp = absexp;
|
prevexp = absexp;
|
||||||
for(i=0; i<ngrps*3; i++) {
|
for(i=0,j=0; i<ngrps*3; i++) {
|
||||||
prevexp += dexp[i] - 2;
|
prevexp += dexp[i] - 2;
|
||||||
if (prevexp < 0 || prevexp > 24)
|
if (prevexp < 0 || prevexp > 24)
|
||||||
return -1;
|
return -1;
|
||||||
for(j=0; j<group_size; j++) {
|
switch (group_size) {
|
||||||
dexps[(i*group_size)+j] = prevexp;
|
case 4: dexps[j++] = prevexp;
|
||||||
|
dexps[j++] = prevexp;
|
||||||
|
case 2: dexps[j++] = prevexp;
|
||||||
|
case 1: dexps[j++] = prevexp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user