From 0c7f87b136cf0c339ac334c45b72923ef903891c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 25 Jan 2026 23:23:36 +0100 Subject: [PATCH] avcodec/hevc/dsp_template: Optimize impossible branches away Saves 1856B of .text here. Signed-off-by: Andreas Rheinhardt --- libavcodec/hevc/dsp_template.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/hevc/dsp_template.c b/libavcodec/hevc/dsp_template.c index 573cf9ee1e..f703f6d071 100644 --- a/libavcodec/hevc/dsp_template.c +++ b/libavcodec/hevc/dsp_template.c @@ -132,7 +132,7 @@ static void FUNC(dequant)(int16_t *coeffs, int16_t log2_size) int x, y; int size = 1 << log2_size; - if (shift > 0) { + if (BIT_DEPTH <= 9 || shift > 0) { int offset = 1 << (shift - 1); for (y = 0; y < size; y++) { for (x = 0; x < size; x++) { @@ -140,7 +140,7 @@ static void FUNC(dequant)(int16_t *coeffs, int16_t log2_size) coeffs++; } } - } else if (shift < 0) { + } else if (BIT_DEPTH > 10 && shift < 0) { for (y = 0; y < size; y++) { for (x = 0; x < size; x++) { *coeffs = *(uint16_t*)coeffs << -shift;