mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-10 20:19:56 +00:00
Correct pulse amplitude application - a negative or 0 coefficient implies the
pulse is subtracted, else it is added. Also avoid a divide by 0. Based on a patch by Alex Converse (alex converse gmail com) Fixes part of issue632 Originally committed as revision 15294 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
67ce33162a
commit
febcbd65fa
1 changed files with 3 additions and 1 deletions
|
|
@ -753,7 +753,9 @@ static int decode_spectrum_and_dequant(AACContext * ac, float coef[1024], GetBit
|
|||
if (pulse_present) {
|
||||
for(i = 0; i < pulse->num_pulse; i++){
|
||||
float co = coef_base[ pulse->pos[i] ];
|
||||
float ico = co / sqrtf(sqrtf(fabsf(co))) + pulse->amp[i];
|
||||
float ico = -pulse->amp[i];
|
||||
if (co)
|
||||
ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
|
||||
coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue