[FFmpeg-devel] [PATCH] lavc/aacenc_utils: replace powf(x, y) by expf(logf(x), y)

Ganesh Ajjanagadde gajjanag at gmail.com
Wed Mar 9 03:14:01 CET 2016


On Tue, Mar 8, 2016 at 9:10 PM, Rostislav Pehlivanov
<atomnuker at gmail.com> wrote:
> On 9 March 2016 at 01:02, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>
>> Hi,
>>
>> On Mon, Mar 7, 2016 at 10:48 PM, Ganesh Ajjanagadde <gajjanag at gmail.com>
>> wrote:
>>
>> > This is ~2x faster for y not an integer on Haswell+GCC, and should
>> > generally be faster due to the fact that anyway powf essentially does
>> > this under the hood.
>>
> There's two changes here. Which gives the speedup? I don't like the second
>> (pow -> exp(log())) if it doesn't give a speedup (I don't see why it would,
>> also).
>>
>> Ronald
>
>
> Since the function is supposed to be inlined maybe GCC is clever enough not
> to have a separate branch for the case where nzslope == 2 for that
> particular usage of the function? Not sure though. I did see a slight speed
> increase just above the noise.

As discussed with Reimar, there are integer power optimizations for
powf. The speedup actually comes from the pow -> exp(log()) as
suggested by the commit heading. The reason the branch now needs to be
manually inserted is that exp(log()*) can't use the integer
optimizations.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list