PR #24824 opened by AJ Granowski (AJGranowski)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24824
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24824.patch

# Summary of changes

avcodec/dnxhddec: Increase alpha channel `avpriv_request_sample` verbosity
The alpha channel of VC-3 bitstreams are encoded either as DCT-encoded or 
RLE-encoded alpha blocks. This change differentiates those two when requesting 
a sample.

This is an incremental change towards adding DCT block alpha decoding for the 
DNxHD codec. Following PRs will work from the VC-3 standard 
https://pub.smpte.org/doc/st2019-1/20160518-pub/ 8.1.2

Related tickets: https://trac.ffmpeg.org/ticket/3707


>From c9e00480730a0868005c0baa4d1d0f09b6d4a398 Mon Sep 17 00:00:00 2001
From: AJ Granowski <[email protected]>
Date: Wed, 30 Sep 2026 15:54:58 -0500
Subject: [PATCH] avcodec/dnxhddec: Increase alpha channel
 `avpriv_request_sample` verbosity The alpha channel of VC-3 bitstreams are
 encoded either as DCT-encoded or RLE-encoded alpha blocks. This change
 differentiates those two when requesting a sample.

This is an incremental change towards adding DCT block alpha decoding for the 
DNxHD codec. Following PRs will work from the VC-3 standard 
https://pub.smpte.org/doc/st2019-1/20160518-pub/ 8.1.2

Related tickets: https://trac.ffmpeg.org/ticket/3707
---
 libavcodec/dnxhddec.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 7ec61f9ebd..7ba01351d9 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -208,8 +208,13 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
     ctx->mbaff = (buf[0x6] >> 5) & 1;
     ctx->alpha = buf[0x7] & 1;
     ctx->lla   = (buf[0x7] >> 1) & 1;
-    if (ctx->alpha)
-        avpriv_request_sample(ctx->avctx, "alpha");
+    if (ctx->alpha) {
+        if (ctx->lla) {
+            avpriv_request_sample(ctx->avctx, "RLE block alpha decoding");
+        } else {
+            avpriv_request_sample(ctx->avctx, "DCT block alpha decoding");
+        }
+    }
 
     ctx->height = AV_RB16(buf + 0x18);
     ctx->width  = AV_RB16(buf + 0x1a);
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to