Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -131,6 +131,7 @@ static const enum AVPixelFormat pix_fmts[] = { · 130 unmodified lines | ||
| 131 | 131 | AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, |
| 132 | 132 | AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16, |
| 133 | 133 | AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16, |
| 134 | + AV_PIX_FMT_GRAYF32, AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, | |
| 134 | 135 | AV_PIX_FMT_NONE |
| 135 | 136 | }; |
| 136 | 137 | |
| @@ -214,8 +215,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 77 unmodified lines | ||
| 214 | 215 | float *bptr = s->buffer; |
| 215 | 216 | const uint8_t *src = in->data[plane]; |
| 216 | 217 | const uint16_t *src16 = (const uint16_t *)in->data[plane]; |
| 218 | + const float *src32 = (const float *)in->data[plane]; | |
| 217 | 219 | uint8_t *dst = out->data[plane]; |
| 218 | 220 | uint16_t *dst16 = (uint16_t *)out->data[plane]; |
| 221 | + float *dst32 = (float *)out->data[plane]; | |
| 219 | 222 | int y, x; |
| 220 | 223 | |
| 221 | 224 | if (!(s->planes & (1 << plane))) { |
| @@ -234,7 +237,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 12 unmodified lines | ||
| 234 | 237 | bptr += width; |
| 235 | 238 | src += in->linesize[plane]; |
| 236 | 239 | } |
| 237 | − } else { | |
| 240 | + } else if (s->depth <= 16) { | |
| 238 | 241 | for (y = 0; y < height; y++) { |
| 239 | 242 | for (x = 0; x < width; x++) { |
| 240 | 243 | bptr[x] = src16[x]; |
| @@ -242,6 +245,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 1 unmodified line | ||
| 242 | 245 | bptr += width; |
| 243 | 246 | src16 += in->linesize[plane] / 2; |
| 244 | 247 | } |
| 248 | + } else { | |
| 249 | + for (y = 0; y < height; y++) { | |
| 250 | + for (x = 0; x < width; x++) { | |
| 251 | + memcpy(bptr, src32, width * sizeof(float)); | |
| 252 | + } | |
| 253 | + bptr += width; | |
| 254 | + src32 += in->linesize[plane] / 4; | |
| 255 | + } | |
| 245 | 256 | } |
| 246 | 257 | |
| 247 | 258 | diriir2d(ctx, plane); |
| @@ -255,7 +266,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 7 unmodified lines | ||
| 255 | 266 | bptr += width; |
| 256 | 267 | dst += out->linesize[plane]; |
| 257 | 268 | } |
| 258 | − } else { | |
| 269 | + } else if (s->depth <= 16) { | |
| 259 | 270 | for (y = 0; y < height; y++) { |
| 260 | 271 | for (x = 0; x < width; x++) { |
| 261 | 272 | dst16[x] = av_clip_uintp2_c(lrintf(bptr[x]), s->depth); |
| @@ -263,6 +274,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 1 unmodified line | ||
| 263 | 274 | bptr += width; |
| 264 | 275 | dst16 += out->linesize[plane] / 2; |
| 265 | 276 | } |
| 277 | + } else { | |
| 278 | + for (y = 0; y < height; y++) { | |
| 279 | + for (x = 0; x < width; x++) { | |
| 280 | + memcpy(dst32, bptr, width * sizeof(float)); | |
| 281 | + } | |
| 282 | + bptr += width; | |
| 283 | + dst32 += out->linesize[plane] / 4; | |
| 284 | + } | |
| 266 | 285 | } |
| 267 | 286 | } |
| 268 | 287 | |