History

avfilter/vf_thumbnail: optimize planar processing path

Paul B Mahol committed 3 years ago

Commit 46642ce1 parent 6c814091 file · +6 −3Browse files

Unified · Split

libavfilter/vf_thumbnail.c+6−3
@@ -191,11 +191,14 @@ static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) · 190 unmodified lines
191191 const int slice_start = (s->planeheight[plane] * jobnr) / nb_jobs;
192192 const int slice_end = (s->planeheight[plane] * (jobnr+1)) / nb_jobs;
193193 const uint8_t *p = frame->data[plane] + slice_start * frame->linesize[plane];
194+ const ptrdiff_t linesize = frame->linesize[plane];
195+ const int planewidth = s->planewidth[plane];
196+ int *hhist = hist + 256 * plane;
194197
195198 for (int j = slice_start; j < slice_end; j++) {
196− for (int i = 0; i < s->planewidth[plane]; i++)
197− hist[256*plane + p[i]]++;
198− p += frame->linesize[plane];
199+ for (int i = 0; i < planewidth; i++)
200+ hhist[p[i]]++;
201+ p += linesize;
199202 }
200203 }
201204 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t