Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -191,11 +191,14 @@ static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) · 190 unmodified lines | ||
| 191 | 191 | const int slice_start = (s->planeheight[plane] * jobnr) / nb_jobs; |
| 192 | 192 | const int slice_end = (s->planeheight[plane] * (jobnr+1)) / nb_jobs; |
| 193 | 193 | 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; | |
| 194 | 197 | |
| 195 | 198 | 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; | |
| 199 | 202 | } |
| 200 | 203 | } |
| 201 | 204 | break; |