From patchwork Tue Aug 1 11:03:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 4566 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.85 with SMTP id 82csp3521590vsb; Tue, 1 Aug 2017 04:04:00 -0700 (PDT) X-Received: by 10.223.145.106 with SMTP id j97mr4972032wrj.172.1501585440209; Tue, 01 Aug 2017 04:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501585440; cv=none; d=google.com; s=arc-20160816; b=KGlMyqr3EmKHwaUr+odEutYr+wzcq+PbGxje1zXv1TieQrbtxCwGGSWCRdbkTaSH4h ozJkx3aBjraT8owUADbPt4g3I+NmvySlc+hkGJXApLandx0P0fWjvTzJkWtvy0LY4aP2 /k2YCATDvl4blrVhj3XSDadyFYw1+g/Hf6FBX4L66sShJLILNaIiJ/Nl7UdeVAVAAAu6 oHK2cgyy67QRjKRCUBPI7AcTtvNQb5TFPz52NTMA6T9BJw64Xl6KHcqcGEDCP+HWGsGa aOeElEptUofaTUOqmGj/Al1AQDZxsbcXuJ9P/zTzG/x1rh9wwanN5MKQdPEhJQEGOWqQ CdaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=XEHYPzTsu3YH2qPWTUhvJYMK0nskulZMgvpBKdqb/BE=; b=JF+6pTfRh+sfzRGFDCWmL/vvGfPtIxN9ijpkC915zT9YQueFkchJAJK6a7NpBBDGX5 R4Ea9anPzbOSU6w6cRLTLoGrOujWB62LoJixlMuZo291p6VOioqm0aVeimcQDd4KsOvc AoQumjABxe5C4647titgSLcTMk/sYF4ExIGunDrli85iiWQ9H6mm50qmbdshe6e8rjIR 2qEsWZfGUTwhSEZyyaKDIscBaxN0EZSJaOWIk48o0Ixsriq7LLTL9t4MQf5FRbU5T5B0 yWSNySGE1awWuD86RU+Otw/N1euoWiQQFpKHi6aVwTA+kkTz0EyNG2VkddXyZQ6YqEq/ 2CRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=n4GbEUuK; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n128si1006937wmn.122.2017.08.01.04.03.57; Tue, 01 Aug 2017 04:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=n4GbEUuK; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ECBC168A1BC; Tue, 1 Aug 2017 14:03:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 202B868A319 for ; Tue, 1 Aug 2017 14:03:45 +0300 (EEST) Received: by mail-wm0-f66.google.com with SMTP id x64so2475645wmg.1 for ; Tue, 01 Aug 2017 04:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=RfgNEFTb4xvPFIRiuNJPG6CvNhqEyUv9hT0Hz6byhEo=; b=n4GbEUuK11+q07M9ttIUhFZ9vU0cWglaW0Ji+MG79yduoYHAYVTpTtI2ns6vXAHE7A tzhOMUm+s96SpnG2IOo8wmFU+/lXP0OAlRlzvc3OjoRTXXAZPpHdmvZ6Aq4BROzFF/tB 6jyp05K++Gw3hq9O8ZduruqGeynlUOZ5Bm3iNWwc3asxpIadai7B8lIqIXcGPGxIoUoS rUgVvQWC0C2XQbqpimPeSbt8xGyZYkNp6mENkP+zxHXSJP1BzhLe1hJyfZGc7x+wZBck xAnlFdAZGMEE5AtHqMZ0fo8LUWrWjIP/FaTNvV+1t67wyKceaiItgwe1V8AwCYDlMVpm kx/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=RfgNEFTb4xvPFIRiuNJPG6CvNhqEyUv9hT0Hz6byhEo=; b=TMjUSd2n3ZgVoobsU0g/4aoNbPvtnrZCYvFfhajCj4ehP5nNcaMVwtlrM5rPejqlJM T8ukGWfuiq88i6NdeIWGrx1OYWW84XF9N32AXUReN6UkohcGeh3b6krPgRNpRqY2bbDq Lt45JdNJCD2+k3kdhI305JOhW+STZycN/V/ar0rjMiHUCoGzO0x1O4JreiYbaEPJvGPy BW6wTjkfdy9TFdFirqnOehePKBg6RZQDxIFBl3syFsu0MfIkVfYJqhSSUppv0e0d4sAN 7GgbYWQZN9B890ypKUfIIlZxujHY8Y0Uqd0zr8qxc5a1RIrY1aVAcuMXYmV0L799/jnC kCyw== X-Gm-Message-State: AIVw112Oebd9fByPq9/6GIRjEAcfu+QePq1LXQ5DuYW+N7XnN3YP1rdQ 8TZrCsLKgziMJYki X-Received: by 10.28.33.66 with SMTP id h63mr1218913wmh.124.1501585427116; Tue, 01 Aug 2017 04:03:47 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id 15sm1368559wmo.7.2017.08.01.04.03.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 04:03:46 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Aug 2017 13:03:36 +0200 Message-Id: <20170801110336.19704-1-onemda@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170801095358.8569-1-onemda@gmail.com> References: <20170801095358.8569-1-onemda@gmail.com> Subject: [FFmpeg-devel] [PATCH] avfilter: add unpremultiply filter X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paul B Mahol --- doc/filters.texi | 13 ++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_premultiply.c | 307 ++++++++++++++++++++++++++++++++++++------- 4 files changed, 277 insertions(+), 45 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 4089135..a50696a 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -14532,6 +14532,19 @@ ffmpeg -i INPUT -vf trim=duration=1 @end itemize +@section unpremultiply +Apply alpha unpremultiply effect to input video stream using first plane +of second stream as alpha. + +Both streams must have same dimensions and same pixel format. + +The filter accepts the following option: + +@table @option +@item planes +Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +@end table @anchor{unsharp} @section unsharp diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 4d61d78..f0bb8e7 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -314,6 +314,7 @@ OBJS-$(CONFIG_TILE_FILTER) += vf_tile.o OBJS-$(CONFIG_TINTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o OBJS-$(CONFIG_TRIM_FILTER) += trim.o +OBJS-$(CONFIG_UNPREMULTIPLY_FILTER) += vf_premultiply.o framesync2.o OBJS-$(CONFIG_UNSHARP_FILTER) += vf_unsharp.o OBJS-$(CONFIG_USPP_FILTER) += vf_uspp.o OBJS-$(CONFIG_VAGUEDENOISER_FILTER) += vf_vaguedenoiser.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index b1c2d11..0fca662 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -325,6 +325,7 @@ static void register_all(void) REGISTER_FILTER(TINTERLACE, tinterlace, vf); REGISTER_FILTER(TRANSPOSE, transpose, vf); REGISTER_FILTER(TRIM, trim, vf); + REGISTER_FILTER(UNPREMULTIPLY, unpremultiply, vf); REGISTER_FILTER(UNSHARP, unsharp, vf); REGISTER_FILTER(USPP, uspp, vf); REGISTER_FILTER(VAGUEDENOISER, vaguedenoiser, vf); diff --git a/libavfilter/vf_premultiply.c b/libavfilter/vf_premultiply.c index 4bb850e..99d93c9 100644 --- a/libavfilter/vf_premultiply.c +++ b/libavfilter/vf_premultiply.c @@ -33,7 +33,8 @@ typedef struct PreMultiplyContext { int linesize[4]; int nb_planes; int planes; - int half, depth, offset; + int inverse; + int half, depth, offset, max; FFFrameSync fs; void (*premultiply[4])(const uint8_t *msrc, const uint8_t *asrc, @@ -47,11 +48,12 @@ typedef struct PreMultiplyContext { #define OFFSET(x) offsetof(PreMultiplyContext, x) #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM -static const AVOption premultiply_options[] = { +static const AVOption options[] = { { "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS }, { NULL } }; +#define premultiply_options options AVFILTER_DEFINE_CLASS(premultiply); static int query_formats(AVFilterContext *ctx) @@ -199,6 +201,153 @@ static void premultiply16offset(const uint8_t *mmsrc, const uint8_t *aasrc, } } +static void unpremultiply8(const uint8_t *msrc, const uint8_t *asrc, + uint8_t *dst, + ptrdiff_t mlinesize, ptrdiff_t alinesize, + ptrdiff_t dlinesize, + int w, int h, + int half, int max, int offset) +{ + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + if (asrc[x] > 0 && asrc[x] < 255) + dst[x] = FFMIN(msrc[x] * 255 / asrc[x], 255); + else + dst[x] = msrc[x]; + } + + dst += dlinesize; + msrc += mlinesize; + asrc += alinesize; + } +} + +static void unpremultiply8yuv(const uint8_t *msrc, const uint8_t *asrc, + uint8_t *dst, + ptrdiff_t mlinesize, ptrdiff_t alinesize, + ptrdiff_t dlinesize, + int w, int h, + int half, int max, int offset) +{ + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + if (asrc[x] > 0 && asrc[x] < 255) + dst[x] = FFMIN((msrc[x] - 128) * 255 / asrc[x] + 128, 255); + else + dst[x] = msrc[x]; + } + + dst += dlinesize; + msrc += mlinesize; + asrc += alinesize; + } +} + +static void unpremultiply8offset(const uint8_t *msrc, const uint8_t *asrc, + uint8_t *dst, + ptrdiff_t mlinesize, ptrdiff_t alinesize, + ptrdiff_t dlinesize, + int w, int h, + int half, int max, int offset) +{ + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + if (asrc[x] > 0 && asrc[x] < 255) + dst[x] = FFMIN((msrc[x] - offset) * 255 / asrc[x] + offset, 255); + else + dst[x] = msrc[x]; + } + + dst += dlinesize; + msrc += mlinesize; + asrc += alinesize; + } +} + +static void unpremultiply16(const uint8_t *mmsrc, const uint8_t *aasrc, + uint8_t *ddst, + ptrdiff_t mlinesize, ptrdiff_t alinesize, + ptrdiff_t dlinesize, + int w, int h, + int half, int max, int offset) +{ + const uint16_t *msrc = (const uint16_t *)mmsrc; + const uint16_t *asrc = (const uint16_t *)aasrc; + uint16_t *dst = (uint16_t *)ddst; + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + if (asrc[x] > 0 && asrc[x] < max) + dst[x] = FFMIN(msrc[x] * max / asrc[x], max); + else + dst[x] = msrc[x]; + } + + dst += dlinesize / 2; + msrc += mlinesize / 2; + asrc += alinesize / 2; + } +} + +static void unpremultiply16yuv(const uint8_t *mmsrc, const uint8_t *aasrc, + uint8_t *ddst, + ptrdiff_t mlinesize, ptrdiff_t alinesize, + ptrdiff_t dlinesize, + int w, int h, + int half, int max, int offset) +{ + const uint16_t *msrc = (const uint16_t *)mmsrc; + const uint16_t *asrc = (const uint16_t *)aasrc; + uint16_t *dst = (uint16_t *)ddst; + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + if (asrc[x] > 0 && asrc[x] < max) + dst[x] = FFMIN((msrc[x] - half) * max / asrc[x] + half, max); + else + dst[x] = msrc[x]; + } + + dst += dlinesize / 2; + msrc += mlinesize / 2; + asrc += alinesize / 2; + } +} + +static void unpremultiply16offset(const uint8_t *mmsrc, const uint8_t *aasrc, + uint8_t *ddst, + ptrdiff_t mlinesize, ptrdiff_t alinesize, + ptrdiff_t dlinesize, + int w, int h, + int half, int max, int offset) +{ + const uint16_t *msrc = (const uint16_t *)mmsrc; + const uint16_t *asrc = (const uint16_t *)aasrc; + uint16_t *dst = (uint16_t *)ddst; + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + if (asrc[x] > 0 && asrc[x] < max) + dst[x] = FFMIN((msrc[x] - offset) * max / asrc[x] + offset, max); + else + dst[x] = msrc[x]; + } + + dst += dlinesize / 2; + msrc += mlinesize / 2; + asrc += alinesize / 2; + } +} + static int process_frame(FFFrameSync *fs) { AVFilterContext *ctx = fs->parent; @@ -226,48 +375,80 @@ static int process_frame(FFFrameSync *fs) full = base->color_range == AVCOL_RANGE_JPEG; limited = base->color_range == AVCOL_RANGE_MPEG; - switch (outlink->format) { - case AV_PIX_FMT_YUV444P: - s->premultiply[0] = full ? premultiply8 : premultiply8offset; - s->premultiply[1] = premultiply8yuv; - s->premultiply[2] = premultiply8yuv; - break; - case AV_PIX_FMT_YUVJ444P: - s->premultiply[0] = premultiply8; - s->premultiply[1] = premultiply8yuv; - s->premultiply[2] = premultiply8yuv; - break; - case AV_PIX_FMT_GBRP: - s->premultiply[0] = limited ? premultiply8offset : premultiply8; - s->premultiply[1] = limited ? premultiply8offset : premultiply8; - s->premultiply[2] = limited ? premultiply8offset : premultiply8; - break; - case AV_PIX_FMT_YUV444P9: - case AV_PIX_FMT_YUV444P10: - case AV_PIX_FMT_YUV444P12: - case AV_PIX_FMT_YUV444P14: - case AV_PIX_FMT_YUV444P16: - s->premultiply[0] = full ? premultiply16 : premultiply16offset; - s->premultiply[1] = premultiply16yuv; - s->premultiply[2] = premultiply16yuv; - break; - case AV_PIX_FMT_GBRP9: - case AV_PIX_FMT_GBRP10: - case AV_PIX_FMT_GBRP12: - case AV_PIX_FMT_GBRP14: - case AV_PIX_FMT_GBRP16: - s->premultiply[0] = limited ? premultiply16offset : premultiply16; - s->premultiply[1] = limited ? premultiply16offset : premultiply16; - s->premultiply[2] = limited ? premultiply16offset : premultiply16; - break; - case AV_PIX_FMT_GRAY8: - s->premultiply[0] = limited ? premultiply8offset : premultiply8; - break; - case AV_PIX_FMT_GRAY10: - case AV_PIX_FMT_GRAY12: - case AV_PIX_FMT_GRAY16: - s->premultiply[0] = limited ? premultiply16offset : premultiply16; - break; + if (s->inverse) { + switch (outlink->format) { + case AV_PIX_FMT_YUV444P: + s->premultiply[0] = full ? unpremultiply8 : unpremultiply8offset; + s->premultiply[1] = s->premultiply[2] = unpremultiply8yuv; + break; + case AV_PIX_FMT_YUVJ444P: + s->premultiply[0] = unpremultiply8; + s->premultiply[1] = s->premultiply[2] = unpremultiply8yuv; + break; + case AV_PIX_FMT_GBRP: + s->premultiply[0] = s->premultiply[1] = s->premultiply[2] = limited ? unpremultiply8offset : unpremultiply8; + break; + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV444P12: + case AV_PIX_FMT_YUV444P14: + case AV_PIX_FMT_YUV444P16: + s->premultiply[0] = full ? unpremultiply16 : unpremultiply16offset; + s->premultiply[1] = s->premultiply[2] = unpremultiply16yuv; + break; + case AV_PIX_FMT_GBRP9: + case AV_PIX_FMT_GBRP10: + case AV_PIX_FMT_GBRP12: + case AV_PIX_FMT_GBRP14: + case AV_PIX_FMT_GBRP16: + s->premultiply[0] = s->premultiply[1] = s->premultiply[2] = limited ? unpremultiply16offset : unpremultiply16; + break; + case AV_PIX_FMT_GRAY8: + s->premultiply[0] = limited ? unpremultiply8offset : unpremultiply8; + break; + case AV_PIX_FMT_GRAY10: + case AV_PIX_FMT_GRAY12: + case AV_PIX_FMT_GRAY16: + s->premultiply[0] = limited ? unpremultiply16offset : unpremultiply16; + break; + } + } else { + switch (outlink->format) { + case AV_PIX_FMT_YUV444P: + s->premultiply[0] = full ? premultiply8 : premultiply8offset; + s->premultiply[1] = s->premultiply[2] = premultiply8yuv; + break; + case AV_PIX_FMT_YUVJ444P: + s->premultiply[0] = premultiply8; + s->premultiply[1] = s->premultiply[2] = premultiply8yuv; + break; + case AV_PIX_FMT_GBRP: + s->premultiply[0] = s->premultiply[1] = s->premultiply[2] = limited ? premultiply8offset : premultiply8; + break; + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV444P12: + case AV_PIX_FMT_YUV444P14: + case AV_PIX_FMT_YUV444P16: + s->premultiply[0] = full ? premultiply16 : premultiply16offset; + s->premultiply[1] = s->premultiply[2] = premultiply16yuv; + break; + case AV_PIX_FMT_GBRP9: + case AV_PIX_FMT_GBRP10: + case AV_PIX_FMT_GBRP12: + case AV_PIX_FMT_GBRP14: + case AV_PIX_FMT_GBRP16: + s->premultiply[0] = s->premultiply[1] = s->premultiply[2] = limited ? premultiply16offset : premultiply16; + break; + case AV_PIX_FMT_GRAY8: + s->premultiply[0] = limited ? premultiply8offset : premultiply8; + break; + case AV_PIX_FMT_GRAY10: + case AV_PIX_FMT_GRAY12: + case AV_PIX_FMT_GRAY16: + s->premultiply[0] = limited ? premultiply16offset : premultiply16; + break; + } } for (p = 0; p < s->nb_planes; p++) { @@ -282,7 +463,7 @@ static int process_frame(FFFrameSync *fs) base->linesize[p], alpha->linesize[0], out->linesize[p], s->width[p], s->height[p], - s->half, s->depth, s->offset); + s->half, s->inverse ? s->max : s->depth, s->offset); } } out->pts = av_rescale_q(base->pts, s->fs.time_base, outlink->time_base); @@ -310,6 +491,7 @@ static int config_input(AVFilterLink *inlink) s->width[0] = s->width[3] = inlink->w; s->depth = desc->comp[0].depth; + s->max = (1 << s->depth) - 1; s->half = (1 << s->depth) / 2; s->offset = 16 << (s->depth - 8); @@ -369,6 +551,16 @@ static int activate(AVFilterContext *ctx) return ff_framesync2_activate(&s->fs); } +static av_cold int init(AVFilterContext *ctx) +{ + PreMultiplyContext *s = ctx->priv; + + if (!strcmp(ctx->filter->name, "unpremultiply")) + s->inverse = 1; + + return 0; +} + static av_cold void uninit(AVFilterContext *ctx) { PreMultiplyContext *s = ctx->priv; @@ -398,6 +590,8 @@ static const AVFilterPad premultiply_outputs[] = { { NULL } }; +#if CONFIG_PREMULTIPLY_FILTER + AVFilter ff_vf_premultiply = { .name = "premultiply", .description = NULL_IF_CONFIG_SMALL("PreMultiply first stream with first plane of second stream."), @@ -410,3 +604,26 @@ AVFilter ff_vf_premultiply = { .priv_class = &premultiply_class, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, }; + +#endif /* CONFIG_PREMULTIPLY_FILTER */ + +#if CONFIG_UNPREMULTIPLY_FILTER + +#define unpremultiply_options options +AVFILTER_DEFINE_CLASS(unpremultiply); + +AVFilter ff_vf_unpremultiply = { + .name = "unpremultiply", + .description = NULL_IF_CONFIG_SMALL("UnPreMultiply first stream with first plane of second stream."), + .priv_size = sizeof(PreMultiplyContext), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + .activate = activate, + .inputs = premultiply_inputs, + .outputs = premultiply_outputs, + .priv_class = &unpremultiply_class, + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, +}; + +#endif /* CONFIG_UNPREMULTIPLY_FILTER */