[FFmpeg-devel] [PATCH 11/12] lavfi/vf_histogram: replace round by lrint
Ganesh Ajjanagadde
gajjanagadde at gmail.com
Mon Dec 21 17:35:14 CET 2015
On Fri, Dec 18, 2015 at 9:45 PM, Ganesh Ajjanagadde
<gajjanagadde at gmail.com> wrote:
> lrint is at least as fast, and more accurate.
>
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
> libavfilter/vf_histogram.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_histogram.c b/libavfilter/vf_histogram.c
> index 8e6f531..3f50f12 100644
> --- a/libavfilter/vf_histogram.c
> +++ b/libavfilter/vf_histogram.c
> @@ -281,7 +281,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> int col_height;
>
> if (h->levels_mode)
> - col_height = round(h->level_height * (1. - (log2(h->histogram[i] + 1) / max_hval_log)));
> + col_height = lrint(h->level_height * (1. - (log2(h->histogram[i] + 1) / max_hval_log)));
> else
> col_height = h->level_height - (h->histogram[i] * (int64_t)h->level_height + max_hval - 1) / max_hval;
>
> --
> 2.6.4
>
pushed
More information about the ffmpeg-devel
mailing list