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 C045243098 for ; Wed, 20 Jul 2022 04:41:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4795568B82B; Wed, 20 Jul 2022 07:41:33 +0300 (EEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 30CAD68B7D4 for ; Wed, 20 Jul 2022 07:41:25 +0300 (EEST) Received: by mail-pl1-f175.google.com with SMTP id g17so13898752plh.2 for ; Tue, 19 Jul 2022 21:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VT5Jq3nHG6f9ea/3i4Kb1djNuxPV6b/LWW/4zfLKLhc=; b=nhMV3ZSVJcE2YgE6AEEqdwxwvLgr5IHyNVJJhtubYifCgsxyeTM1KG3v+uFq+4iUgq w88aSCTCRp2uAiuvOnKoXwpdP2sIMYmZ9fnbc1QyAhnjUnOqa4swhrxznopsxbdbcoSa +vFb+5FUv4a+dBj5yaJ/fZdqa2r+2Ob920QW0ByPdeDJeqRVmBKzCLNjzx7FiRIPoT4j FGM+95bE/XVmycJsJ5teFaNHBiDZ9C+m1WD4ECK+Na5oCPTtdlbwfN5N+JG/Z1faLxfV ZXIPSBUSjx+szdzvq2fDl9giphMTCVfQvR6eqQ6r5XJFcB2oJts/TevePltIXjRUSx/o aVjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VT5Jq3nHG6f9ea/3i4Kb1djNuxPV6b/LWW/4zfLKLhc=; b=rHt9n6yoixvgY7qumm8Q2UVkeAhjDbcK+7SBkvuWLwcgyMQiWfI6ukHSHynC1dcwfo qiA9u7z2cTQxqc6P09OnbtlFF0oVAS3R3lKwqy3MaJ9W+4ZS2WBXgYUYHr9SYFo3JoVa +xD5S5D8WGrQLxdUXxWF4aaHtHQne3AWwYpHtlLilzSr3PYBV5Bl2avet7+dJPjRIvHz sAWEeR+4eWR8KYXl3yHKzULa9wjRC5W9ljjVloeRIq914rVt3l/mTCmGbC4hf/6eEKhQ LDHSfXvD2opO1ZmGZ9cxSXm99MAuXRq+wgTlJ9t1PDnb3jB4aARX7Vj9FQsP5jvLsBty QthA== X-Gm-Message-State: AJIora8w7xRWCq3Msp5okSUEFVzgd3uVYRQMgenKXJbEMhz1p0uRRzvP 2Al84rlvBcsS+NTZPiyyMFcW8nrWLaVFag== X-Google-Smtp-Source: AGRyM1tP8HG0jqfTU25oB6gQjv86TlbyR8LSTAZwYRhzm7Hc6tVVp4E6CpAIHYm6aCkjkmkSqs/MsQ== X-Received: by 2002:a17:903:120f:b0:15f:99f:9597 with SMTP id l15-20020a170903120f00b0015f099f9597mr36516141plh.45.1658292082955; Tue, 19 Jul 2022 21:41:22 -0700 (PDT) Received: from localhost.localdomain (23-121-159-29.lightspeed.sntcca.sbcglobal.net. [23.121.159.29]) by smtp.googlemail.com with ESMTPSA id f16-20020a635110000000b003fba1a97c49sm10855907pgb.61.2022.07.19.21.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 21:41:22 -0700 (PDT) From: Chris Phlipot To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Jul 2022 21:41:15 -0700 Message-Id: <20220720044117.1282961-3-cphlipot0@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720044117.1282961-1-cphlipot0@gmail.com> References: <20220720044117.1282961-1-cphlipot0@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] avfilter/vf_yadif: reformat code to improve readability 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 Cc: Chris Phlipot Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Reformat some of the code to improve readability and reduce code duplication. This change is intended to be purely cosmentic and shouldn't result in any functional changes. Signed-off-by: Chris Phlipot --- libavfilter/vf_yadif.c | 11 +++++------ libavfilter/yadif.h | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 42f6246330..54109566be 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -211,16 +211,15 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) uint8_t *cur = &s->cur ->data[td->plane][y * refs]; uint8_t *next = &s->next->data[td->plane][y * refs]; uint8_t *dst = &td->frame->data[td->plane][y * td->frame->linesize[td->plane]]; + int prefs = y + 1 < td->h ? refs : -refs; + int mrefs = y ? -refs : refs; + int parity = td->parity ^ td->tff; int mode = y == 1 || y + 2 == td->h ? 2 : s->mode; s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3, next + pix_3, td->w - edge, - y + 1 < td->h ? refs : -refs, - y ? -refs : refs, - td->parity ^ td->tff, mode); + prefs, mrefs, parity, mode); s->filter_edges(dst, prev, cur, next, td->w, - y + 1 < td->h ? refs : -refs, - y ? -refs : refs, - td->parity ^ td->tff, mode, s->req_align); + prefs, mrefs, parity, mode, s->req_align); } else { memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane]], &s->cur->data[td->plane][y * refs], td->w * df); diff --git a/libavfilter/yadif.h b/libavfilter/yadif.h index b81f2fc1d9..f271fe8304 100644 --- a/libavfilter/yadif.h +++ b/libavfilter/yadif.h @@ -67,8 +67,7 @@ typedef struct YADIFContext { * Required alignment for filter_line */ int req_align; - void (*filter_line)(void *dst, - void *prev, void *cur, void *next, + void (*filter_line)(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode); void (*filter_edges)(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode, -- 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".