+ return 0;
+}
+
+typedef struct ThreadData {
+ int height;
+ int width;
+ int plane;
+ int linesize;
+} ThreadData;
+
+static int slice_geq_filter(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ GEQContext *geq = ctx->priv;
+ ThreadData *td = arg;
+ const int height = td->height;
+ const int width = td->width;
+ const int plane = td->plane;
+ const int linesize = td->linesize;
+ const int slice_start = (height * jobnr) / nb_jobs;
+ const int slice_end = (height * (jobnr+1)) / nb_jobs;
+ int x, y;
+ uint8_t *ptr;
+ uint16_t *ptr16;
+
+ double values[VAR_VARS_NB];
+ values[VAR_W] = geq->values[VAR_W];
+ values[VAR_H] = geq->values[VAR_H];
+ values[VAR_N] = geq->values[VAR_N];
+ values[VAR_SW] = geq->values[VAR_SW];
+ values[VAR_SH] = geq->values[VAR_SH];
+ values[VAR_T] = geq->values[VAR_T];
+
+ if (geq->bps == 8) {
+ for (y = slice_start; y < slice_end; y++) {
+ ptr = geq->dst + linesize * y;
+ values[VAR_Y] = y;
+
+ for (x = 0; x < width; x++) {
+ values[VAR_X] = x;
+ ptr[x] = av_expr_eval(geq->e[plane], values, geq);
+ }
+ ptr += linesize;
+ }
+ }
+ else {
+ for (y = slice_start; y < slice_end; y++) {
+ ptr16 = geq->dst16 + (linesize/2) * y;
+ values[VAR_Y] = y;
+ for (x = 0; x < width; x++) {
+ values[VAR_X] = x;
+ ptr16[x] = av_expr_eval(geq->e[plane], values, geq);
+ }
+ }
+ }