From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id E79554CF5C for ; Fri, 30 May 2025 05:29:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id E66FB68D117; Fri, 30 May 2025 08:29:28 +0300 (EEST) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id C74F568CF06 for ; Fri, 30 May 2025 08:29:22 +0300 (EEST) Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-72bc3987a05so1081822a34.1 for ; Thu, 29 May 2025 22:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748582961; x=1749187761; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=mFkA/QCsMXmU+S4hY9S0zLlDDn4uqbdX56HSSUectDI=; b=cz0ysGkmT07BhJ/qIT+FOqwaSO8/QcLiS3yajMtStCqvZ9nhlY1KTCjOZ0jKa53emY 6FM8LAuq/pfrmzex4qOSHo7QYAB4j2HYvPUzcy3m+z4tD6VS3LMAEiyZ4HhZp2/A88Gw uoiA6sv5Wc5cwbL5wnlaH+PST1ohD2RvQOmMSSw+6M4N1dF2X2xKKjAvxlJR8rw4HOrz iPlM1U5qnwhT6TZF7y7gLTcYIwlnCbK0rGrDsiDMXUqyzur2V2NmEdMIKDNN8EujLdaF 7HlqifgHTU58QcsR+1fHjsY3iLB8HqArcrbV4+gioqIKLCf1UqiSi9QopHzNcO6Jhhnp ftMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748582961; x=1749187761; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mFkA/QCsMXmU+S4hY9S0zLlDDn4uqbdX56HSSUectDI=; b=BmAWOAYV/SKZEcCXoTES05ecZT2zYtG4xVhB7fbZfAmcj35QBimkhpsIzJfsaRRsYz eIXtp6/0GsKd2YeNlvFwqm8fcfevw99WB7Q2nJ8sc6tM7jvGZQCkRjKQASwLrWYIz5bm 7qZl2SkcPBthkSPOiREncfakh7ecZ5Fi4vD4Xp/l9pSrqYmR/j+S1n9Ot3UnTj8N+Pxe wrdLcIuwsTdbain6YFnWfewnBi55owPA4u1rUnDZ8fAFww0fRnN7ysWv5z4l9et8s7OP LZ3/Ws72NIPU78nNWXvu4cTaMhHIPpDf2XjEbvRus2ndU6F545NqJNG0Z/nPdX/GEReV cpGw== X-Gm-Message-State: AOJu0YxLdOAYtM2GcMuTXV4lenCBx1qDS5T9VGxea1athhGVzUoXiW1c +PlZjfGZWzlGA5I8PQtf36tfHEgGmX10l7ky+jpSsWhI9zMPEJiEix209+QauAH2 X-Gm-Gg: ASbGncsoeVrSblXZFp2NpubaVXUidsK2p0rc3eZvFgkGB3KalJgjs5SXZ1D7ibwPQ2/ rJUufL0PaO3Pft8NjoAMge4DC1rayskLnIerARDtsYMFblV3K0gB+1V9dIqQSN8ThlF6kgKdUw1 8fPFt6t5nvtA0TVcG/yWp0r49NRZeXWHreVb+T1yP2x2UglWK+glB0u6XALibpzWbkTH2eOEfbk 4muByJHFU2QAgqZpZvRU3P+zinxq834rwQ1PvLxtNMLL5fCLnRNykGfsFmmYYNH9AYRTvEK4BBf k/W2KRrqwioTCCmt5KZ5nevfgynUFtFJSd9KLIzbNxwxtnNNS/9gKitTfAE= X-Google-Smtp-Source: AGHT+IHgsN3McdnNg/OiePwSyDEaCiWRyqSHAHtR99ZXXqWxutlsrtWSd5KXti8Ly2bV+8MisMPhzA== X-Received: by 2002:a05:6830:350a:b0:72a:1222:9e8a with SMTP id 46e09a7af769-73676c306b3mr1285648a34.14.1748582960652; Thu, 29 May 2025 22:29:20 -0700 (PDT) Received: from [192.168.1.30] ([97.125.40.144]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-735af9bc85bsm498906a34.46.2025.05.29.22.29.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 May 2025 22:29:20 -0700 (PDT) Message-ID: Date: Fri, 30 May 2025 00:29:19 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <90c31845-ef4f-4aa2-b87d-93800e1a469b@gmail.com> <20250530005839.GG29660@pb2> Content-Language: en-US From: Ethan Halsall In-Reply-To: <20250530005839.GG29660@pb2> Subject: Re: [FFmpeg-devel] [PATCH] add yuv444p support to mcdeint 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: On 5/29/25 7:58 PM, Michael Niedermayer wrote: > On Tue, May 27, 2025 at 01:24:57PM -0500, Ethan Halsall wrote: >> Signed-off-by: Ethan Halsall >> --- >> libavfilter/vf_mcdeint.c | 32 ++++++++++++++++++++++++++++---- >> 1 file changed, 28 insertions(+), 4 deletions(-) >> >> diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c >> index 82048b51d0..11ad19f5cd 100644 >> --- a/libavfilter/vf_mcdeint.c >> +++ b/libavfilter/vf_mcdeint.c >> @@ -51,8 +51,10 @@ >> #include "libavutil/opt.h" >> #include "libavcodec/avcodec.h" >> +#include "libavutil/pixdesc.h" >> #include "avfilter.h" >> #include "filters.h" >> +#include "formats.h" >> #include "video.h" >> enum MCDeintMode { >> @@ -76,6 +78,7 @@ typedef struct MCDeintContext { >> AVPacket *pkt; >> AVFrame *frame_dec; >> AVCodecContext *enc_ctx; >> + const AVPixFmtDescriptor *pix_fmt_desc; >> } MCDeintContext; >> #define OFFSET(x) offsetof(MCDeintContext, x) >> @@ -99,6 +102,17 @@ static const AVOption mcdeint_options[] = { >> AVFILTER_DEFINE_CLASS(mcdeint); >> +static const enum AVPixelFormat pix_fmts[] = { >> + AV_PIX_FMT_YUV420P, >> + AV_PIX_FMT_YUV444P, >> + AV_PIX_FMT_NONE >> +}; >> + > > Applying: add yuv444p support to mcdeint > error: corrupt patch at line 18 > > this patch is somehow corrupted, that above is not a valid diff > make sure the output of git format-patch is not modified > > thx > > > [...] > > > > _______________________________________________ > 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". I followed the instructions on the "Sending patches from email clients" section of https://ffmpeg.org/developer.html#Submitting-patches-1. I think Thunderbird removed some line breaks in the patch though when I opened the .eml file. Let's try this one: Signed-off-by: Ethan Halsall --- libavfilter/vf_mcdeint.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c index 82048b51d0..11ad19f5cd 100644 --- a/libavfilter/vf_mcdeint.c +++ b/libavfilter/vf_mcdeint.c @@ -51,8 +51,10 @@ #include "libavutil/opt.h" #include "libavcodec/avcodec.h" +#include "libavutil/pixdesc.h" #include "avfilter.h" #include "filters.h" +#include "formats.h" #include "video.h" enum MCDeintMode { @@ -76,6 +78,7 @@ typedef struct MCDeintContext { AVPacket *pkt; AVFrame *frame_dec; AVCodecContext *enc_ctx; + const AVPixFmtDescriptor *pix_fmt_desc; } MCDeintContext; #define OFFSET(x) offsetof(MCDeintContext, x) @@ -99,6 +102,17 @@ static const AVOption mcdeint_options[] = { AVFILTER_DEFINE_CLASS(mcdeint); +static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_NONE +}; + +static int query_formats(AVFilterContext *ctx) +{ + return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); +} + static int config_props(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; @@ -122,13 +136,16 @@ static int config_props(AVFilterLink *inlink) mcdeint->enc_ctx = avcodec_alloc_context3(enc); if (!mcdeint->enc_ctx) return AVERROR(ENOMEM); + mcdeint->pix_fmt_desc = av_pix_fmt_desc_get(inlink->format); + if (!mcdeint->pix_fmt_desc) + return AVERROR(ENOMEM); enc_ctx = mcdeint->enc_ctx; enc_ctx->width = inlink->w; enc_ctx->height = inlink->h; enc_ctx->time_base = (AVRational){1,25}; // meaningless enc_ctx->gop_size = INT_MAX; enc_ctx->max_b_frames = 0; - enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P; + enc_ctx->pix_fmt = inlink->format; enc_ctx->flags = AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_LOW_DELAY | AV_CODEC_FLAG_RECON_FRAME; enc_ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; enc_ctx->global_quality = 1; @@ -201,8 +218,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic) for (i = 0; i < 3; i++) { int is_chroma = !!i; - int w = AV_CEIL_RSHIFT(inlink->w, is_chroma); - int h = AV_CEIL_RSHIFT(inlink->h, is_chroma); + int w, h; + if (is_chroma) { + w = inlink->w >> mcdeint->pix_fmt_desc->log2_chroma_w; + h = inlink->h >> mcdeint->pix_fmt_desc->log2_chroma_h; + } else { + w = inlink->w; + h = inlink->h; + } int fils = frame_dec->linesize[i]; int srcs = inpic ->linesize[i]; int dsts = outpic ->linesize[i]; @@ -307,5 +330,6 @@ const FFFilter ff_vf_mcdeint = { .uninit = uninit, FILTER_INPUTS(mcdeint_inputs), FILTER_OUTPUTS(ff_video_default_filterpad), - FILTER_SINGLE_PIXFMT(AV_PIX_FMT_YUV420P), + FILTER_QUERY_FUNC(query_formats), }; + -- 2.43.0 -Ethan _______________________________________________ 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".