Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -183,6 +183,47 @@ static int temperature_slice16(AVFilterContext *ctx, void *arg, int jobnr, int n · 182 unmodified lines | |||
| 183 | return 0; | 183 | return 0; |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | static int temperature_slice32(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) | ||
| 187 | { | ||
| 188 | ColorTemperatureContext *s = ctx->priv; | ||
| 189 | AVFrame *frame = arg; | ||
| 190 | const int width = frame->width; | ||
| 191 | const int height = frame->height; | ||
| 192 | const float preserve = s->preserve; | ||
| 193 | const float mix = s->mix; | ||
| 194 | const float *color = s->color; | ||
| 195 | const int slice_start = (height * jobnr) / nb_jobs; | ||
| 196 | const int slice_end = (height * (jobnr + 1)) / nb_jobs; | ||
| 197 | const ptrdiff_t glinesize = frame->linesize[0] / sizeof(float); | ||
| 198 | const ptrdiff_t blinesize = frame->linesize[1] / sizeof(float); | ||
| 199 | const ptrdiff_t rlinesize = frame->linesize[2] / sizeof(float); | ||
| 200 | float *gptr = (float *)frame->data[0] + slice_start * glinesize; | ||
| 201 | float *bptr = (float *)frame->data[1] + slice_start * blinesize; | ||
| 202 | float *rptr = (float *)frame->data[2] + slice_start * rlinesize; | ||
| 203 | |||
| 204 | for (int y = slice_start; y < slice_end; y++) { | ||
| 205 | for (int x = 0; x < width; x++) { | ||
| 206 | float g = gptr[x]; | ||
| 207 | float b = bptr[x]; | ||
| 208 | float r = rptr[x]; | ||
| 209 | float nr, ng, nb; | ||
| 210 | float l0, l1, l; | ||
| 211 | |||
| 212 | PROCESS() | ||
| 213 | |||
| 214 | gptr[x] = ng; | ||
| 215 | bptr[x] = nb; | ||
| 216 | rptr[x] = nr; | ||
| 217 | } | ||
| 218 | |||
| 219 | gptr += glinesize; | ||
| 220 | bptr += blinesize; | ||
| 221 | rptr += rlinesize; | ||
| 222 | } | ||
| 223 | |||
| 224 | return 0; | ||
| 225 | } | ||
| 226 | |||
| 186 | static int temperature_slice8p(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) | 227 | static int temperature_slice8p(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
| 187 | { | 228 | { |
| 188 | ColorTemperatureContext *s = ctx->priv; | 229 | ColorTemperatureContext *s = ctx->priv; |
| @@ -285,6 +326,7 @@ static const enum AVPixelFormat pixel_fmts[] = { · 96 unmodified lines | |||
| 285 | AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, | 326 | AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, |
| 286 | AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, | 327 | AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, |
| 287 | AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16, | 328 | AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16, |
| 329 | AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, | ||
| 288 | AV_PIX_FMT_RGB48, AV_PIX_FMT_BGR48, | 330 | AV_PIX_FMT_RGB48, AV_PIX_FMT_BGR48, |
| 289 | AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64, | 331 | AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64, |
| 290 | AV_PIX_FMT_NONE | 332 | AV_PIX_FMT_NONE |
| @@ -308,6 +350,8 @@ static av_cold int config_input(AVFilterLink *inlink) · 17 unmodified lines | |||
| 308 | s->do_slice = s->depth <= 8 ? temperature_slice8 : temperature_slice16; | 350 | s->do_slice = s->depth <= 8 ? temperature_slice8 : temperature_slice16; |
| 309 | if (!planar) | 351 | if (!planar) |
| 310 | s->do_slice = s->depth <= 8 ? temperature_slice8p : temperature_slice16p; | 352 | s->do_slice = s->depth <= 8 ? temperature_slice8p : temperature_slice16p; |
| 353 | if (s->depth == 32) | ||
| 354 | s->do_slice = temperature_slice32; | ||
| 311 | 355 | ||
| 312 | ff_fill_rgba_map(s->rgba_map, inlink->format); | 356 | ff_fill_rgba_map(s->rgba_map, inlink->format); |
| 313 | 357 | ||