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 5A20946568 for ; Mon, 18 Mar 2024 16:58:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A96C168D38A; Mon, 18 Mar 2024 18:57:14 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0FAE568D33C for ; Mon, 18 Mar 2024 18:57:03 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1710781018; bh=TEjM9gfe0ZRROjeHJPqm9AiLZynOPGwotGCGZk7giCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q8vWtnHW+YPTv+IhndKF5K7zuJIBz76DGZetShfMoZmdizcYPJqL15SC2rKN88YJJ fWSI+AMlEMaaoUuNuLY05XnCCxTOC41cMTDRBQVzW0J83DkAZjFYLh4zEIkIf9DScJ +ozJJgcrxRDzoPFDNXN3PIpm1rMoSpYFeNHTO/ig= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 599DA4357A; Mon, 18 Mar 2024 17:56:58 +0100 (CET) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Mar 2024 17:54:14 +0100 Message-ID: <20240318165651.75520-7-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240318165651.75520-1-ffmpeg@haasn.xyz> References: <20240318165651.75520-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 06/13] avcodec/av1dec: signal new AVFilmGrainParams members 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: From: Niklas Haas Not directly signalled by AV1, but we should still set this accordingly so that users will know what the original intended video characteristics and chroma resolution were. --- libavcodec/av1dec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index e6346b51dbe..56e4af278be 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1072,9 +1072,11 @@ static int export_film_grain(AVCodecContext *avctx, AVFrame *frame) { AV1DecContext *s = avctx->priv_data; const AV1RawFilmGrainParams *film_grain = &s->cur_frame.film_grain; + const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(frame->format); AVFilmGrainParams *fgp; AVFilmGrainAOMParams *aom; + av_assert0(pixdesc); if (!film_grain->apply_grain) return 0; @@ -1084,6 +1086,14 @@ static int export_film_grain(AVCodecContext *avctx, AVFrame *frame) fgp->type = AV_FILM_GRAIN_PARAMS_AV1; fgp->seed = film_grain->grain_seed; + fgp->width = frame->width; + fgp->height = frame->height; + fgp->color_range = frame->color_range; + fgp->color_primaries = frame->color_primaries; + fgp->color_trc = frame->color_trc; + fgp->color_space = frame->colorspace; + fgp->subsampling_x = pixdesc->log2_chroma_w; + fgp->subsampling_y = pixdesc->log2_chroma_h; aom = &fgp->codec.aom; aom->chroma_scaling_from_luma = film_grain->chroma_scaling_from_luma; -- 2.44.0 _______________________________________________ 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".