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 D46C04C464 for ; Sun, 28 Jul 2024 10:27:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 748A168D956; Sun, 28 Jul 2024 13:25:55 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D529268D86B for ; Sun, 28 Jul 2024 13:25:41 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1722162339; bh=yppZfnugsvt7iEOfjCswHpcBKZjAhIqCKb7ycZbG5hA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E8XRQIOjOAKZIJeGeYu4/VgJv6NUNBmMclsaBv/49nc4PP4+9yBrZ4nCgGVg89cWV EAu/K2bvgtBK/5u247NVnzY0rk4fqyO3Uo6n30rLi/lOytvn+DZgoM8ecrRPbkI3L2 dHkmw1VvUV3ndJvOV9BXO0ds7gvnEM/rz1XuscnQ= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 5942E44607; Sun, 28 Jul 2024 12:25:39 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 Jul 2024 12:25:24 +0200 Message-ID: <20240728102527.17991-19-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240728102527.17991-1-ffmpeg@haasn.xyz> References: <20240728102527.17991-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 19/22] avcodec/dovi_rpuenc: slightly improve profile autodetection 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 In the absence of an RPU header, we can consult the colorspace tags to make a more informed guess about whether we're looking at profile 5 or profile 8. --- libavcodec/dovi_rpuenc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c index c73805037c..8113ec44bf 100644 --- a/libavcodec/dovi_rpuenc.c +++ b/libavcodec/dovi_rpuenc.c @@ -79,7 +79,20 @@ int ff_dovi_configure_ext(DOVIContext *s, AVCodecParameters *codecpar, switch (codecpar->codec_id) { case AV_CODEC_ID_AV1: dv_profile = 10; break; case AV_CODEC_ID_H264: dv_profile = 9; break; - case AV_CODEC_ID_HEVC: dv_profile = hdr ? ff_dovi_guess_profile_hevc(hdr) : 8; break; + case AV_CODEC_ID_HEVC: + if (hdr) { + dv_profile = ff_dovi_guess_profile_hevc(hdr); + break; + } + + /* This is likely to be proprietary IPTPQc2 */ + if (codecpar->color_space == AVCOL_SPC_IPT_C2 || + (codecpar->color_space == AVCOL_SPC_UNSPECIFIED && + codecpar->color_trc == AVCOL_TRC_UNSPECIFIED)) + dv_profile = 5; + else + dv_profile = 8; + break; default: /* No other encoder should be calling this! */ av_assert0(0); -- 2.45.2 _______________________________________________ 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".