[FFmpeg-devel] [PATCH 1/5] lavfi/vf_hue: replace rint by lrint

Ganesh Ajjanagadde gajjanag at mit.edu
Sat Dec 26 02:50:02 CET 2015


On Fri, Dec 25, 2015 at 5:41 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Fri, Dec 25, 2015 at 04:00:16PM -0800, Ganesh Ajjanagadde wrote:
>> avoids float to int cast, and is slightly superior in terms of rounding
>> ("Dutch/Gauss rounding").
>>
>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> ---
>>  libavfilter/vf_hue.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c
>> index 2c1b34e..92607f1 100644
>> --- a/libavfilter/vf_hue.c
>> +++ b/libavfilter/vf_hue.c
>> @@ -105,8 +105,8 @@ static inline void compute_sin_and_cos(HueContext *hue)
>>       * the saturation.
>>       * This will be useful in the apply_lut function.
>>       */
>> -    hue->hue_sin = rint(sin(hue->hue) * (1 << 16) * hue->saturation);
>> -    hue->hue_cos = rint(cos(hue->hue) * (1 << 16) * hue->saturation);
>> +    hue->hue_sin = lrint(sin(hue->hue) * (1 << 16) * hue->saturation);
>> +    hue->hue_cos = lrint(cos(hue->hue) * (1 << 16) * hue->saturation);
>
> the change LGTM
>
> thx

goes without saying, but all patches in the series have removed the
bogus line regarding rounding; remark regarding cast preserved.

>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The worst form of inequality is to try to make unequal things equal.
> -- Aristotle
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list