mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/vf_thumbnail: optimize planar processing path
This commit is contained in:
parent
6c814093d8
commit
46642ceeaf
|
@ -191,11 +191,14 @@ static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
|
||||||
const int slice_start = (s->planeheight[plane] * jobnr) / nb_jobs;
|
const int slice_start = (s->planeheight[plane] * jobnr) / nb_jobs;
|
||||||
const int slice_end = (s->planeheight[plane] * (jobnr+1)) / nb_jobs;
|
const int slice_end = (s->planeheight[plane] * (jobnr+1)) / nb_jobs;
|
||||||
const uint8_t *p = frame->data[plane] + slice_start * frame->linesize[plane];
|
const uint8_t *p = frame->data[plane] + slice_start * frame->linesize[plane];
|
||||||
|
const ptrdiff_t linesize = frame->linesize[plane];
|
||||||
|
const int planewidth = s->planewidth[plane];
|
||||||
|
int *hhist = hist + 256 * plane;
|
||||||
|
|
||||||
for (int j = slice_start; j < slice_end; j++) {
|
for (int j = slice_start; j < slice_end; j++) {
|
||||||
for (int i = 0; i < s->planewidth[plane]; i++)
|
for (int i = 0; i < planewidth; i++)
|
||||||
hist[256*plane + p[i]]++;
|
hhist[p[i]]++;
|
||||||
p += frame->linesize[plane];
|
p += linesize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue