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 92B254918B for ; Tue, 6 Feb 2024 00:24:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0498268D13C; Tue, 6 Feb 2024 02:24:27 +0200 (EET) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8529E68C8CC for ; Tue, 6 Feb 2024 02:24:20 +0200 (EET) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 2445C10601FE for ; Tue, 6 Feb 2024 00:24:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1707179059; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=NXRVtO8vpDX6ZRYckS6w+0jtsdqThrDGjxFpzY1oIqg=; b=TseD9GxtnT9+Nb8Rb5dBXWRAUBrggy+AaK070J17JRl7xhZnRREO1EGCPTB2lzZ/ oW4+9rBIHaUhD/GXLxNnzJtF/J9tnDLBYkTOSfpn3RK/wfjudJctrEowSU94ZlqpbiW 0r1DAz1iuprmec1no8YiGLzWwfx8AdTcTBgjkpGDtZVYcs3Y8/DI+zncg48650pQIhr CQBMQOTgHLmMsytLiIuQcjrATsz1IsnhtErZQ6Q4qdbnBMuoaJmI0T1/3aia7X7T61G M9ZtiCa2rrACbRdVP8DqZOt4rnlVoH7yXRyWCArpXq6fqT6XBU2OLkEeeEA2rFl3oW2 YRkJpJNYNA== Date: Tue, 6 Feb 2024 01:24:19 +0100 (CET) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: References: MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias 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-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: Feb 4, 2024, 17:06 by sw@jkqxz.net: > On 02/02/2024 02:57, Lynne wrote: > >> Needed for AV1. >> >> From 81be215060a718fdc3d043847e8155ba56fcb431 Mon Sep 17 00:00:00 2001 >> From: Lynne >> Date: Fri, 2 Feb 2024 03:54:06 +0100 >> Subject: [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias >> >> Needed for AV1. >> --- >> libavcodec/cbs_av1.h | 1 + >> libavcodec/cbs_av1_syntax_template.c | 10 ++++++++++ >> 2 files changed, 11 insertions(+) >> >> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h >> index a5402f069d..cbb43ac810 100644 >> --- a/libavcodec/cbs_av1.h >> +++ b/libavcodec/cbs_av1.h >> @@ -198,6 +198,7 @@ typedef struct AV1RawFrameHeader { >> uint8_t refresh_frame_flags; >> uint8_t allow_intrabc; >> uint8_t ref_order_hint[AV1_NUM_REF_FRAMES]; >> + uint8_t ref_frame_sign_bias[AV1_NUM_REF_FRAMES]; >> > > This isn't a syntax element so it shouldn't go in the syntax structure. Put it in the context structure with other derived fields (the pointer is already available as priv where you want it). > >> uint8_t frame_refs_short_signaling; >> uint8_t last_frame_idx; >> uint8_t golden_frame_idx; >> diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c >> index 3be1f2d30f..00e9a6d030 100644 >> --- a/libavcodec/cbs_av1_syntax_template.c >> +++ b/libavcodec/cbs_av1_syntax_template.c >> @@ -1572,6 +1572,16 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, >> } >> >> if (!frame_is_intra) { >> + for (i = 0; i < AV1_REFS_PER_FRAME; i++) { >> + if (seq->enable_order_hint) { >> + int idx = current->ref_frame_idx[i]; >> + int hint = current->ref_order_hint[idx]; >> + current->ref_frame_sign_bias[i] = cbs_av1_get_relative_dist(seq, hint, >> + priv->order_hint) > 0; >> + } else { >> + infer(ref_frame_sign_bias[i], 0); >> + } >> + } >> // Derive reference frame sign biases. >> } >> >> -- >> 2.43.0.381.gb435a96ce8 >> > > Please exactly follow the layout of the specification as far as possible, since that makes it much easier to assess whether it is correct. It looks like the indexing is wrong? (Note that LAST_FRAME == 1.) > It is the layout of the specifications. I just skip filling in the reorder hints since they're not really needed (it's just a lookup after all). _______________________________________________ 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".