diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-04-17 12:08:13 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-04-17 19:18:08 +0200 |
commit | 4c6fa4ef45b934d9a372a35df9b0427054a873b7 (patch) | |
tree | 90bf4922bd4b0b569e106ae0af22ae9a9e60e3b7 /libavfilter | |
parent | 45f5bf917b5404c3b14fb7413a27aea19abffd56 (diff) | |
download | ffmpeg-streaming-4c6fa4ef45b934d9a372a35df9b0427054a873b7.zip ffmpeg-streaming-4c6fa4ef45b934d9a372a35df9b0427054a873b7.tar.gz |
lavfi/lut: simplify nested component stepping.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_lut.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index b272fda..5cc9026 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -285,15 +285,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) inrow = inrow0; outrow = outrow0; for (j = 0; j < w; j++) { - outrow[0] = tab[0][inrow[0]]; - if (lut->step>1) { - outrow[1] = tab[1][inrow[1]]; - if (lut->step>2) { - outrow[2] = tab[2][inrow[2]]; - if (lut->step>3) { - outrow[3] = tab[3][inrow[3]]; - } - } + switch (lut->step) { + case 3: outrow[3] = tab[3][inrow[3]]; // Fall-through + case 2: outrow[2] = tab[2][inrow[2]]; // Fall-through + case 1: outrow[1] = tab[1][inrow[1]]; // Fall-through + default: outrow[0] = tab[0][inrow[0]]; } outrow += lut->step; inrow += lut->step; |