Commit da992563a8 for ffmpeg
commit da992563a837b7af4ce99060b953522cc548095f
Author: AJ Granowski <AJGranowski@users.noreply.github.com>
Date: Fri Oct 2 14:17:29 2026 -0500
avcodec/dnxhddec: De-duplicate chroma/luma selection
Consolidate luma/chroma scale and weight-matrix selection after determining the component index.
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 7ba01351d9..86c72fcbe3 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -379,23 +379,20 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
if (!ctx->is_444) {
if (n & 2) {
- component = 1 + (n & 1);
- scale = row->chroma_scale;
- weight_matrix = ctx->cid_table->chroma_weight;
+ component = 1 + (n & 1);
} else {
- component = 0;
- scale = row->luma_scale;
- weight_matrix = ctx->cid_table->luma_weight;
+ component = 0;
}
} else {
component = (n >> 1) % 3;
- if (component) {
- scale = row->chroma_scale;
- weight_matrix = ctx->cid_table->chroma_weight;
- } else {
- scale = row->luma_scale;
- weight_matrix = ctx->cid_table->luma_weight;
- }
+ }
+
+ if (component) {
+ scale = row->chroma_scale;
+ weight_matrix = ctx->cid_table->chroma_weight;
+ } else {
+ scale = row->luma_scale;
+ weight_matrix = ctx->cid_table->luma_weight;
}
UPDATE_CACHE(bs, &row->gb);