Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias
@ 2024-02-02  2:57 Lynne
       [not found] ` <Npbk3Pz--3-9@lynne.ee-Npbk7RR----9>
  2024-02-04 16:06 ` [FFmpeg-devel] [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias Mark Thompson
  0 siblings, 2 replies; 4+ messages in thread
From: Lynne @ 2024-02-02  2:57 UTC (permalink / raw)
  To: Ffmpeg Devel

[-- Attachment #1: Type: text/plain, Size: 33 bytes --]

Needed for AV1.

Patch attached


[-- Attachment #2: 0001-lavc-cbs_av1-fill-in-ref_frame_sign_bias.patch --]
[-- Type: text/x-diff, Size: 1752 bytes --]

From 81be215060a718fdc3d043847e8155ba56fcb431 Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
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];
     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


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-06  0:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-02  2:57 [FFmpeg-devel] [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias Lynne
     [not found] ` <Npbk3Pz--3-9@lynne.ee-Npbk7RR----9>
2024-02-02  2:58   ` [FFmpeg-devel] [PATCH 2/2] lavc/vulkan_av1: port to the new stable API Lynne
2024-02-04 16:06 ` [FFmpeg-devel] [PATCH 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias Mark Thompson
2024-02-06  0:24   ` Lynne

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git