[tcq] streamline write_high_range function
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c index e7c4e91..1446a6c 100644 --- a/av1/encoder/encodetxb.c +++ b/av1/encoder/encodetxb.c
@@ -1056,11 +1056,13 @@ int max = lf ? COEFF_BASE_RANGE + LF_NUM_BASE_LEVELS : COEFF_BASE_RANGE + NUM_BASE_LEVELS; max -= enable_tcq ? 1 : 0; - int hr = level - max - 1; - if (enable_tcq && level > max) { - hr = get_high_range(level, lf); - } if (level > max) { + int hr = 0; + if (enable_tcq) { + hr = get_high_range(level, lf); + } else { + hr = level - max - 1; + } #if CONFIG_COEFF_HR_ADAPTIVE int hr_level_avg = *hr_avg; write_adaptive_hr(w, hr, hr_level_avg);