[FFmpeg-devel] [PATCH 2/2] avfilter/avf_showcqt: avoid using fminf()

Michael Niedermayer michaelni at gmx.at
Fri Jun 6 21:29:17 CEST 2014


On Fri, Jun 06, 2014 at 02:39:53PM -0300, James Almer wrote:
> On 06/06/14 12:21 PM, Michael Niedermayer wrote:
> > On Fri, Jun 06, 2014 at 04:49:21PM +0200, Clément Bœsch wrote:
> >> On Fri, Jun 06, 2014 at 04:42:16PM +0200, Michael Niedermayer wrote:
> >>> The loop with fminf() changes from 18093856 to 17403218 dezicycles (gcc 4.6.3, sandybridge i7)
> >>>
> >>> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> >>> ---
> >>>  libavfilter/avf_showcqt.c |    6 +++---
> >>>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
> >>> index eaa632d..0870507 100644
> >>> --- a/libavfilter/avf_showcqt.c
> >>> +++ b/libavfilter/avf_showcqt.c
> >>> @@ -357,9 +357,9 @@ static int plot_cqt(AVFilterLink *inlink)
> >>>          result[x][2] = r.re * r.re + r.im * r.im;
> >>>          result[x][1] = 0.5f * (result[x][0] + result[x][2]);
> >>>          result[x][3] = result[x][1];
> >>> -        result[x][0] = 255.0f * powf(fminf(1.0f,result[x][0]), g);
> >>> -        result[x][1] = 255.0f * powf(fminf(1.0f,result[x][1]), g);
> >>> -        result[x][2] = 255.0f * powf(fminf(1.0f,result[x][2]), g);
> >>> +        result[x][0] = 255.0f * powf(FFMIN(1.0f,result[x][0]), g);
> >>> +        result[x][1] = 255.0f * powf(FFMIN(1.0f,result[x][1]), g);
> >>> +        result[x][2] = 255.0f * powf(FFMIN(1.0f,result[x][2]), g);
> >>>      }
> >>>  
> >>
> >> LGTM
> > 
> > patch applied
> 
> Either revert the fminf() emulation on libm.h or include lavu/common.h in it, 
> because libm.h currently does not have the FFMIN define and it throws errors 
> on msvc 2012.

fixed

thanks

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140606/6242063b/attachment.asc>


More information about the ffmpeg-devel mailing list