This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 7411e526a3381914be7448141ae131a426a03a4a
Author:     Lynne <[email protected]>
AuthorDate: Thu Sep 24 09:58:35 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Thu Sep 24 11:05:31 2026 +0900

    apv_encode_vulkan: signal the colour description
    
    The frame header always left it absent, so every stream decoded as
    unspecified with limited range. Take it from each frame, and only mark
    it present when it differs from the inferred defaults.
---
 libavcodec/apv_encode_vulkan.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/libavcodec/apv_encode_vulkan.c b/libavcodec/apv_encode_vulkan.c
index 8c703b3324..8c604241d4 100644
--- a/libavcodec/apv_encode_vulkan.c
+++ b/libavcodec/apv_encode_vulkan.c
@@ -74,6 +74,12 @@ typedef struct VulkanEncodeAPVFrameData {
     FFVkBuffer *bytestream_ref;
     FFVkBuffer *compacted_ref;
     FFVkBuffer *sizes_ref;
+
+    /* Copied from the source */
+    enum AVColorPrimaries color_primaries;
+    enum AVColorTransferCharacteristic color_trc;
+    enum AVColorSpace colorspace;
+    enum AVColorRange color_range;
 } VulkanEncodeAPVFrameData;
 
 typedef struct VulkanEncodeAPVContext {
@@ -366,6 +372,11 @@ static int submit_frame(AVCodecContext *avctx, 
FFVkExecContext *exec,
     FFVkBuffer *compacted_buf;
     FFVkBuffer *sizes_buf;
 
+    fd->color_primaries = frame->color_primaries;
+    fd->color_trc       = frame->color_trc;
+    fd->colorspace      = frame->colorspace;
+    fd->color_range     = frame->color_range;
+
     /* Start recording */
     err = ff_vk_exec_start(&ev->s, exec);
     if (err < 0)
@@ -589,12 +600,14 @@ static int build_packet(AVCodecContext *avctx, 
FFVkExecContext *exec,
     fh->frame_info.bit_depth_minus8 = ev->bit_depth - 8;
     fh->frame_info.capture_time_distance = 0;
 
-    fh->color_description_present_flag = 0;
-    /* Inferred values when the flag is 0, per the spec. */
-    fh->color_primaries          = 2;
-    fh->transfer_characteristics = 2;
-    fh->matrix_coefficients      = 2;
-    fh->full_range_flag          = 0;
+    fh->color_primaries          = fd->color_primaries;
+    fh->transfer_characteristics = fd->color_trc;
+    fh->matrix_coefficients      = fd->colorspace;
+    fh->full_range_flag          = fd->color_range == AVCOL_RANGE_JPEG;
+    fh->color_description_present_flag = fh->color_primaries          != 
AVCOL_PRI_UNSPECIFIED ||
+                                         fh->transfer_characteristics != 
AVCOL_TRC_UNSPECIFIED ||
+                                         fh->matrix_coefficients      != 
AVCOL_SPC_UNSPECIFIED ||
+                                         fh->full_range_flag;
 
     /* compute_pf_table() builds the encoder's pf scale from the same matrix;
      * the two must stay in sync. use_q_matrix is only signalled when the

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to