From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AFE0743AC8 for ; Tue, 12 Jul 2022 14:18:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 851B568B8C0; Tue, 12 Jul 2022 17:18:13 +0300 (EEST) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 735F068B813 for ; Tue, 12 Jul 2022 17:18:07 +0300 (EEST) Received: by mail-ed1-f42.google.com with SMTP id t3so10053457edd.0 for ; Tue, 12 Jul 2022 07:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=mTemimFSfuuY89e9Y237CieMQWJ+tYaIGKDG/ia+/s4=; b=ID3K6YNnIKbD61TPpeFXpbPCJsIWCb6mJx1FH+kfcs43Lf9o6Uf3XUQV5ofPMvUP3v jowxH3HdJpsTF5NeYd8xN4bb45xSVaHzp/Kd5LwOwGgYZnDJAo18UldO1FpZTQHRrGaj 2SmwcGEEmf2a7juOU4HcR1H8tpxYOUOYDaMgWqsSISW/Rlvj8yUv+SNCXI2qHQnZtHbK Rh4aa6d6vJrpF1ddtuiGq/9PFIOe8yssWq6Utd+ymP5lgHN6lu9ts4JRCHbLmAcrunX6 crWECWFp3fl2aoG02lfK0BJ8vG3vciqAzp7GLr7kfckDHcPks2hyBoQmQUlzBoEP1Ni7 Q8SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=mTemimFSfuuY89e9Y237CieMQWJ+tYaIGKDG/ia+/s4=; b=sviz3SPsKI0kEHvRvSimLUgMFvC/VfAPV972JZXU4TylYv9+ne/kWXp3W7vJm6OagJ M738Bgcp3hOZKZ3z3QP9DOcAoMzOwLMawpQXBqa+tCFjsX5BVuOa9BWqGuTDt4kPtprv dcQs9U/HkI4bZNHuLo0mho2rL0odj8+ck4oW4MSIY9I23fTq24LctSzr0mXNlw6RsBXR gBX8bW4yxboyyXf+ixNv2ET3QtuMTnXK6ubnyz19u1WWzLxuFAdPdiIDodKBWTAoOBIg hcTpn4hjYIlBN88emzYvzyfpgppUMDLJ+zyovpyY4jgsXOZsi3J3FJcOt1ttwl5bl7Tj Abkw== X-Gm-Message-State: AJIora+mD+Jc31MWaCRj4GbTmV0VcyoVmQIf3OG0TSp0OIEncgRaf4xc y5UrWSm1F1usKkflyF9wHgr/MG03mLQ= X-Google-Smtp-Source: AGRyM1utJJGqEZ35dq/LX2MBgS/q8znwt3QxB/9WvgnJWGTKX8GsG9C2LYe6PlHtW7VROh9sIqmb4g== X-Received: by 2002:a05:6402:695:b0:435:65f3:38c2 with SMTP id f21-20020a056402069500b0043565f338c2mr33190373edy.347.1657635486580; Tue, 12 Jul 2022 07:18:06 -0700 (PDT) Received: from ?IPV6:2a02:2f00:5209:6800:6a26:4ae9:8dce:b77f? ([2a02:2f00:5209:6800:6a26:4ae9:8dce:b77f]) by smtp.gmail.com with ESMTPSA id kx26-20020a170907775a00b00722c44f9301sm3787220ejc.224.2022.07.12.07.18.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jul 2022 07:18:06 -0700 (PDT) Message-ID: Date: Tue, 12 Jul 2022 17:18:04 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: George Floarea To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH] avfilter/vf_xfade: fixed slideleft/slideright/slideup/slidedown bug X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: zx and zy comparison were wrong when zx=0 or zy=0. This resulted in the wrong column/row being chosen. This can be seen best when using xfade on streams with transparency. For example: in case of a slideleft transition, the first column from the first input will overwrite the first column of the second stream throught the transition. https://www.youtube.com/shorts/qSMuDSg_K9g Signed-off-by: George Floarea --- libavfilter/vf_xfade.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c index 294928c134..9f66927365 100644 --- a/libavfilter/vf_xfade.c +++ b/libavfilter/vf_xfade.c @@ -433,7 +433,7 @@ static void slideleft##name##_transition(AVFilterContext *ctx, for (int x = 0; x < width; x++) { \ const int zx = z + x; \ const int zz = zx % width + width * (zx < 0); \ - dst[x] = (zx > 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ + dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ } \ \ dst += out->linesize[p] / div; \ @@ -466,7 +466,7 @@ static void slideright##name##_transition(AVFilterContext *ctx, for (int x = 0; x < out->width; x++) { \ const int zx = z + x; \ const int zz = zx % width + width * (zx < 0); \ - dst[x] = (zx > 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ + dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ } \ \ dst += out->linesize[p] / div; \ @@ -499,7 +499,7 @@ static void slideup##name##_transition(AVFilterContext *ctx, const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \ \ for (int x = 0; x < out->width; x++) { \ - dst[x] = (zy > 0) && (zy < height) ? xf1[x] : xf0[x]; \ + dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \ } \ \ dst += out->linesize[p] / div; \ @@ -530,7 +530,7 @@ static void slidedown##name##_transition(AVFilterContext *ctx, const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \ \ for (int x = 0; x < out->width; x++) { \ - dst[x] = (zy > 0) && (zy < height) ? xf1[x] : xf0[x]; \ + dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \ } \ \ dst += out->linesize[p] / div; \ -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".