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 v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and order_hints
@ 2024-03-13 16:36 Lynne
       [not found] ` <Nssf4Ma--7-9@lynne.ee-Nssf8W7----9>
  0 siblings, 1 reply; 11+ messages in thread
From: Lynne @ 2024-03-13 16:36 UTC (permalink / raw)
  To: Ffmpeg Devel

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

Unchanged from v2


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

From 426701f4fb00123f2fc46efda188ca7d2413b187 Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Fri, 2 Feb 2024 03:54:06 +0100
Subject: [PATCH v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and
 order_hints

Needed for Vulkan AV1.
---
 libavcodec/cbs_av1.h                 |  2 ++
 libavcodec/cbs_av1_syntax_template.c | 11 +++++++++++
 2 files changed, 13 insertions(+)

diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
index a5402f069d..0ed49e03ca 100644
--- a/libavcodec/cbs_av1.h
+++ b/libavcodec/cbs_av1.h
@@ -465,6 +465,8 @@ typedef struct CodedBitstreamAV1Context {
     int tile_num;
 
     AV1ReferenceFrameState ref[AV1_NUM_REF_FRAMES];
+    uint8_t ref_frame_sign_bias[AV1_TOTAL_REFS_PER_FRAME];
+    uint8_t order_hints[AV1_TOTAL_REFS_PER_FRAME];
 
     // AVOptions
     int operating_point;
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 3be1f2d30f..20eed7ff9e 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1572,6 +1572,17 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
     }
 
     if (!frame_is_intra) {
+        for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
+            uint8_t ref_frame = AV1_REF_FRAME_LAST + i;
+            if (seq->enable_order_hint) {
+                uint8_t hint = current->ref_order_hint[current->ref_frame_idx[i]];
+                uint8_t sign_bias = cbs_av1_get_relative_dist(seq, hint, priv->order_hint) > 0;
+                priv->order_hints[ref_frame] = hint;
+                priv->ref_frame_sign_bias[ref_frame] = sign_bias;
+            } else {
+                priv->ref_frame_sign_bias[ref_frame] = 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] 11+ messages in thread
* [FFmpeg-devel] [PATCH v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and order_hints
@ 2024-02-10 22:38 Lynne
       [not found] ` <NqK9xfm--3-9@lynne.ee-NqKA0jr--J-9>
  0 siblings, 1 reply; 11+ messages in thread
From: Lynne @ 2024-02-10 22:38 UTC (permalink / raw)
  To: Ffmpeg Devel

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

Needed for Vulkan AV1.


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

From 841ede35a2fdb76ef31a5018a98a16384837d50a Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Fri, 2 Feb 2024 03:54:06 +0100
Subject: [PATCH v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and
 order_hints

Needed for Vulkan AV1.
---
 libavcodec/cbs_av1.h                 |  2 ++
 libavcodec/cbs_av1_syntax_template.c | 11 +++++++++++
 2 files changed, 13 insertions(+)

diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
index a5402f069d..0ed49e03ca 100644
--- a/libavcodec/cbs_av1.h
+++ b/libavcodec/cbs_av1.h
@@ -465,6 +465,8 @@ typedef struct CodedBitstreamAV1Context {
     int tile_num;
 
     AV1ReferenceFrameState ref[AV1_NUM_REF_FRAMES];
+    uint8_t ref_frame_sign_bias[AV1_TOTAL_REFS_PER_FRAME];
+    uint8_t order_hints[AV1_TOTAL_REFS_PER_FRAME];
 
     // AVOptions
     int operating_point;
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 3be1f2d30f..20eed7ff9e 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1572,6 +1572,17 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
     }
 
     if (!frame_is_intra) {
+        for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
+            uint8_t ref_frame = AV1_REF_FRAME_LAST + i;
+            if (seq->enable_order_hint) {
+                uint8_t hint = current->ref_order_hint[current->ref_frame_idx[i]];
+                uint8_t sign_bias = cbs_av1_get_relative_dist(seq, hint, priv->order_hint) > 0;
+                priv->order_hints[ref_frame] = hint;
+                priv->ref_frame_sign_bias[ref_frame] = sign_bias;
+            } else {
+                priv->ref_frame_sign_bias[ref_frame] = 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] 11+ messages in thread

end of thread, other threads:[~2024-03-25  7:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13 16:36 [FFmpeg-devel] [PATCH v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and order_hints Lynne
     [not found] ` <Nssf4Ma--7-9@lynne.ee-Nssf8W7----9>
2024-03-13 16:38   ` [FFmpeg-devel] [PATCH v3 2/2] lavc/vulkan_av1: port to the new stable API Lynne
2024-03-17 15:36     ` Mark Thompson
2024-03-17 17:30       ` Lynne
2024-03-18  5:33       ` Lynne
2024-03-19 23:33         ` Mark Thompson
2024-03-25  7:57           ` Lynne
2024-03-18  6:03       ` Dave Airlie
  -- strict thread matches above, loose matches on Subject: below --
2024-02-10 22:38 [FFmpeg-devel] [PATCH v3 1/2] lavc/cbs_av1: fill in ref_frame_sign_bias and order_hints Lynne
     [not found] ` <NqK9xfm--3-9@lynne.ee-NqKA0jr--J-9>
2024-02-10 22:39   ` [FFmpeg-devel] [PATCH v3 2/2] lavc/vulkan_av1: port to the new stable API Lynne
2024-02-11 11:58     ` Mark Thompson
2024-02-11 15:13       ` 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