[Libav-user] Audio quality loss while encoding

Nicolas George nicolas.george at normalesup.org
Fri May 3 12:32:19 CEST 2013


Le duodi 12 floréal, an CCXXI, Claudio Freire a écrit :
> Ok... I had to forfeit my right to sleep, but here it is. Managed to
> make both the fast and 2loop methods work reasonably well (albeit I
> don't know why anyone would use fast, because it's not faster. I
> assume it's an experiment?).
> 
> I don't have access to AAC standards, though, since they're paywalled
> (at least the ones I found), so most of the changes were done blind,
> assuming from what I know of audio codecs, and by trial and error.
> 
> In particular, fast has some magic numbers there that I got from trial
> and error, and nothing more... profound.
> 
> In any case, attached it is, git diff.

Thanks for the patch. I believe you should submit it to ffmpeg-devel, as it
will receive more attention.

Also, you should use git format-patch rather than git diff, so that author
information is included in the patch, and so would be the commit message,
where you can explain the changes for future reference.

A small style comment; I know nothing about AAC so I can not tell about the
validity of changes.

> +    float lowlambda = av_clip(120.f / lambda, 0.25f, 1.f);
> +    float rlambda = av_clip(120.f / lambda, 0.3f, 2.f);
> +    const int minq = av_clip(2 * log2f(120.f / lambda) + 150, 100, 218 - SCALE_MAX_DIFF);
> +    const int maxq = minq + SCALE_MAX_DIFF - 1;

Do you have a specific reason to use float instead of double?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130503/053f5181/attachment.asc>


More information about the Libav-user mailing list