aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_lut3d.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2014-05-14 07:47:21 +0200
committerClément Bœsch <u@pkh.me>2014-05-14 07:51:10 +0200
commitbc2e39c4cc35e8b08ca2ba45496ab3048ae7a426 (patch)
tree991dbbbe79607dcb785644d7225ed3449cadff83 /libavfilter/vf_lut3d.c
parent6ab37221c8eeb9736b6bad046322bec19536b3ee (diff)
downloadffmpeg-bc2e39c4cc35e8b08ca2ba45496ab3048ae7a426.tar.gz
avfilter/lut3d: move the scale calc out of the inner loop.
Diffstat (limited to 'libavfilter/vf_lut3d.c')
-rw-r--r--libavfilter/vf_lut3d.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 7b2f83f3c2..7c3a7dac15 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -216,12 +216,12 @@ static int interp_##nbits##_##name(AVFilterContext *ctx, void *arg, int jobnr, i
const int slice_end = (in->height * (jobnr+1)) / nb_jobs; \
uint8_t *dstrow = out->data[0] + slice_start * out->linesize[0]; \
const uint8_t *srcrow = in ->data[0] + slice_start * in ->linesize[0]; \
+ const float scale = (1. / ((1<<nbits) - 1)) * (lut3d->lutsize - 1); \
\
for (y = slice_start; y < slice_end; y++) { \
uint##nbits##_t *dst = (uint##nbits##_t *)dstrow; \
const uint##nbits##_t *src = (const uint##nbits##_t *)srcrow; \
for (x = 0; x < in->width * step; x += step) { \
- const float scale = (1. / ((1<<nbits) - 1)) * (lut3d->lutsize - 1); \
const struct rgbvec scaled_rgb = {src[x + r] * scale, \
src[x + g] * scale, \
src[x + b] * scale}; \