[FFmpeg-devel] [PATCH] HE-AAC v1 decoder

Alex Converse alex.converse
Wed Jan 27 17:15:23 CET 2010


On Wed, Jan 27, 2010 at 8:53 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Jan 27, 2010 at 05:53:24AM -0500, Alexander Strange wrote:
>>
>> On Jan 26, 2010, at 10:10 PM, Alex Converse wrote:
> [...]
>> > + ? ?for (k = 0; k < num_bands-1; k++) {
>> > + ? ? ? ?prod *= base;
>> > + ? ? ? ?present ?= lroundf(start * prod);
>> > + ? ? ? ?bands[k] = present - previous;
>> > + ? ? ? ?previous = present;
>> > + ? ?}
>>
>> You use lroundf() a lot, which is a library call for me. Can't you set the rounding direction (or just ignore it) and cast instead?
>
> whats wrong with lrintf() ?

*round*() family functions round their argument to the nearest integer
value, rounding away from zero, regardless of the current rounding
direction. *rint*() uses the current rounding direction. There are a
few cases where things can end up at exactly 0.5 and it makes a big
difference.



More information about the ffmpeg-devel mailing list