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 7C0FC49B1E for ; Sun, 3 Mar 2024 15:53:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BBEC068D395; Sun, 3 Mar 2024 17:53:16 +0200 (EET) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A490568D369 for ; Sun, 3 Mar 2024 17:53:09 +0200 (EET) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-564372fb762so4927078a12.0 for ; Sun, 03 Mar 2024 07:53:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709481188; x=1710085988; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=hSnHTkze0Z9cxqF69ExD7C2kPfEpNX+kF0iTZijfsGI=; b=K0MMVa/EqA6kzY1MfsGS7VguUQf35fSKtPphuwPgA/Xs+fmcPhsmIzCXhAMZe1U+gK gD13EtVRvNGYgbatQegf324jPEhP23x5jz472HWjoWD+z/vXNHlj3mC6ss0rCTxwwpj9 cBlgzJYS1AI9RzhOgM0dtGcUOEIo9vB/iYciExJPYOdopWt740nBIK+EqzlCbiNDqbqo Xj+1PeE6a6IeqwYciq8xvkhDYWR0Z/+Bi8zeET0hlV52MjhM/DLmJry2+aYp9Yw64z9f d3CfVhK2TmMeCZNeS/CyJerS8Mlr0goMldkUjAGKk83DVzxw9C7gVPikWz8DIw7PLucv CmPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709481188; x=1710085988; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hSnHTkze0Z9cxqF69ExD7C2kPfEpNX+kF0iTZijfsGI=; b=SLO2RAWZk3YcsHLPz+up031SkfkGyRT+oXVzL3dFho7GEv3OimCEqaTp/sFRwMmY6L Tp209niuP7T4YelLwEO9axMGtWrGSZ0xAIg0vm2rnC6mjcVBiLZ6X3SouGbYhxQA4BOJ q5XvXx0iLPFAW9WXZgtXZxn4lUae754YuQN6OLCYNRpUirpLqXGvzwr79ZuY06fIGChy 98P+yi5DqL7Qh2ubXUg0M27sorvYbQEPeaqYNlw139KEuv3mgVb1pXUHp1YHpJInOWTn vTDHILIlJ2DpxFEf1GAMpXOJVi0njEJ2Wn5fO7IPa+3fdIgMNeFlG05W/6AOpnfCvxdw njuw== X-Gm-Message-State: AOJu0YxBzO71gulBE9cIEEyHSqiEgMcA7dCMty2b4fxAXrACPjLQkSOp uMpiZj2jzIX3ALWoiK0v7IzkgwmwsMgO4908LB/H1X6Zh7JT29QN/IGY/kVr X-Google-Smtp-Source: AGHT+IFwjXoyLuIKFAzSaQD9q8V9JyG4GdgylRtRWVj2vwz9QPRNZN+hFhAd8gy7HEdFeIrPMPlJfw== X-Received: by 2002:a17:906:d8c:b0:a43:afff:ca13 with SMTP id m12-20020a1709060d8c00b00a43afffca13mr4802734eji.57.1709481187774; Sun, 03 Mar 2024 07:53:07 -0800 (PST) Received: from mariano ([188.210.239.74]) by smtp.gmail.com with ESMTPSA id w11-20020a17090652cb00b00a44879da0f3sm2783723ejn.143.2024.03.03.07.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 07:53:07 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id B9ADFBFCDC; Sun, 3 Mar 2024 16:53:04 +0100 (CET) Date: Sun, 3 Mar 2024 16:53:04 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Niklas Haas References: <20240227134313.46097-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240227134313.46097-1-ffmpeg@haasn.xyz> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_showinfo: add AVFilmGrainAOMParams support 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: Niklas Haas 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: On date Tuesday 2024-02-27 14:43:12 +0100, Niklas Haas wrote: > From: Niklas Haas > > For my own testing purposes. You can drop "my own". > --- > libavfilter/vf_showinfo.c | 42 +++++++++++++++++++++++++++++++++++++-- > 1 file changed, 40 insertions(+), 2 deletions(-) > > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c > index 309de28df91..830170363bc 100644 > --- a/libavfilter/vf_showinfo.c > +++ b/libavfilter/vf_showinfo.c > @@ -462,8 +462,46 @@ static void dump_sei_film_grain_params_metadata(AVFilterContext *ctx, const AVFr > > switch (fgp->type) { > case AV_FILM_GRAIN_PARAMS_NONE: > - case AV_FILM_GRAIN_PARAMS_AV1: > - return; > + break; > + case AV_FILM_GRAIN_PARAMS_AV1: { > + const AVFilmGrainAOMParams *aom = &fgp->codec.aom; > + const int num_ar_coeffs_y = 2 * aom->ar_coeff_lag * (aom->ar_coeff_lag + 1); > + const int num_ar_coeffs_uv = num_ar_coeffs_y + !!aom->num_y_points; > + av_log(ctx, AV_LOG_INFO, "y_points={ "); > + for (int i = 0; i < aom->num_y_points; i++) > + av_log(ctx, AV_LOG_INFO, "{%d, %d} ", aom->y_points[i][0], aom->y_points[i][1]); nit++: other instances make use of () to delimit vector values > + av_log(ctx, AV_LOG_INFO, "}; chroma_scaling_from_luma=%d; ", aom->chroma_scaling_from_luma); > + for (int uv = 0; uv < 2; uv++) { > + av_log(ctx, AV_LOG_INFO, "uv_points[%d]={ ", uv); > + for (int i = 0; i < aom->num_uv_points[uv]; i++) > + av_log(ctx, AV_LOG_INFO, "{%d %d} ", aom->uv_points[uv][i][0], aom->uv_points[uv][i][1]); > + av_log(ctx, AV_LOG_INFO, "}; "); > + } > + av_log(ctx, AV_LOG_INFO, "scaling_shift=%d; ", aom->scaling_shift); > + av_log(ctx, AV_LOG_INFO, "ar_coeff_lag=%d; ", aom->ar_coeff_lag); nit: using "," seems more consistent with other instances, here and below > + if (num_ar_coeffs_y) { > + av_log(ctx, AV_LOG_INFO, "ar_coeffs_y={ "); > + for (int i = 0; i < num_ar_coeffs_y; i++) > + av_log(ctx, AV_LOG_INFO, "%d ", aom->ar_coeffs_y[i]); > + av_log(ctx, AV_LOG_INFO, "}; "); > + } > + for (int uv = 0; num_ar_coeffs_uv && uv < 2; uv++) { > + av_log(ctx, AV_LOG_INFO, "ar_coeffs_uv[%d]={ ", uv); > + for (int i = 0; i < num_ar_coeffs_uv; i++) > + av_log(ctx, AV_LOG_INFO, "%d ", aom->ar_coeffs_uv[uv][i]); > + av_log(ctx, AV_LOG_INFO, "}; "); > + } > + av_log(ctx, AV_LOG_INFO, "ar_coeff_shift=%d; ", aom->ar_coeff_shift); > + av_log(ctx, AV_LOG_INFO, "grain_scale_shift=%d; ", aom->grain_scale_shift); > + for (int uv = 0; uv < 2; uv++) { > + av_log(ctx, AV_LOG_INFO, "uv_mult[%d] = %d; ", uv, aom->uv_mult[uv]); > + av_log(ctx, AV_LOG_INFO, "uv_mult_luma[%d] = %d; ", uv, aom->uv_mult_luma[uv]); > + av_log(ctx, AV_LOG_INFO, "uv_offset[%d] = %d; ", uv, aom->uv_offset[uv]); > + } > + av_log(ctx, AV_LOG_INFO, "overlap_flag=%d; ", aom->overlap_flag); > + av_log(ctx, AV_LOG_INFO, "limit_output_range=%d; ", aom->limit_output_range); > + break; > + } > case AV_FILM_GRAIN_PARAMS_H274: { > const AVFilmGrainH274Params *h274 = &fgp->codec.h274; > const char *color_range_str = av_color_range_name(h274->color_range); > -- LGTM otherwise (and no need to send another patch). Unrelated note: probably we should define a serialization method at the library level, then we might employ the same code to display the information here and in ffprobe (this was the work proposed by Nicolas). _______________________________________________ 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".