summaryrefslogtreecommitdiff
path: root/libavfilter/vf_colorlevels.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-16 14:36:53 -0500
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-21 08:17:13 -0800
commit7af14b37260d4923cdd75c8a19d6a82dad7470c4 (patch)
treedc9a27a854ff707a5c841eddae129d851a533d27 /libavfilter/vf_colorlevels.c
parentcc37b31ad3815dfea6157eb784db7665bd990fcc (diff)
lavfi/vf_colorlevels: replace round by lrint
lrint avoids an implicit cast, and is not slower on non-broken libm's. Thus this represents a Pareto improvement. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavfilter/vf_colorlevels.c')
-rw-r--r--libavfilter/vf_colorlevels.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index cb3314b8ac..dedbe30d19 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -132,10 +132,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
const uint8_t offset = s->rgba_map[i];
const uint8_t *srcrow = in->data[0];
uint8_t *dstrow = out->data[0];
- int imin = round(r->in_min * UINT8_MAX);
- int imax = round(r->in_max * UINT8_MAX);
- int omin = round(r->out_min * UINT8_MAX);
- int omax = round(r->out_max * UINT8_MAX);
+ int imin = lrint(r->in_min * UINT8_MAX);
+ int imax = lrint(r->in_max * UINT8_MAX);
+ int omin = lrint(r->out_min * UINT8_MAX);
+ int omax = lrint(r->out_max * UINT8_MAX);
double coeff;
if (imin < 0) {
@@ -179,10 +179,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
const uint8_t offset = s->rgba_map[i];
const uint8_t *srcrow = in->data[0];
uint8_t *dstrow = out->data[0];
- int imin = round(r->in_min * UINT16_MAX);
- int imax = round(r->in_max * UINT16_MAX);
- int omin = round(r->out_min * UINT16_MAX);
- int omax = round(r->out_max * UINT16_MAX);
+ int imin = lrint(r->in_min * UINT16_MAX);
+ int imax = lrint(r->in_max * UINT16_MAX);
+ int omin = lrint(r->out_min * UINT16_MAX);
+ int omax = lrint(r->out_max * UINT16_MAX);
double coeff;
if (imin < 0) {