1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

vf_lut: optimize rgb codepath

19k -> 15k cpu cycles

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-04-03 18:13:33 +02:00
parent 79a1d98676
commit 002d9ded4a

View File

@ -297,11 +297,20 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
outrow0 = outpic->data[0] + y * outpic->linesize[0];
for (i = 0; i < h; i ++) {
int w = inlink->w;
inrow = inrow0;
outrow = outrow0;
for (j = 0; j < inlink->w; j++) {
for (k = 0; k < lut->step; k++)
outrow[k] = lut->lut[lut->rgba_map[k]][inrow[k]];
for (j = 0; j < w; j++) {
outrow[0] = lut->lut[lut->rgba_map[0]][inrow[0]];
if (lut->step>1) {
outrow[1] = lut->lut[lut->rgba_map[1]][inrow[1]];
if (lut->step>2) {
outrow[2] = lut->lut[lut->rgba_map[2]][inrow[2]];
if (lut->step>3) {
outrow[3] = lut->lut[lut->rgba_map[3]][inrow[3]];
}
}
}
outrow += lut->step;
inrow += lut->step;
}