From 9648f06186989d031131c3d79f1005740530f26c Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Tue, 12 Dec 2023 14:25:23 +0500 Subject: [PATCH] qtable generation range fix --- src/util.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util.zig b/src/util.zig index 9ed819f..e8473e9 100644 --- a/src/util.zig +++ b/src/util.zig @@ -134,9 +134,8 @@ pub fn gen_qtable(q: f16, step_start_band: usize, step_stop_band: usize) @Vector for (0..band_len) |j| { if (band_i < step_start_band) { ret[idx + j] = @floatFromInt(q_min); - } - if (band_i < band_range + step_start_band) { - ret[idx + j] = @floatFromInt(q_min + step * band_i); + } else if (band_i < band_range + step_start_band) { + ret[idx + j] = @floatFromInt(q_min + step * (band_i - step_start_band)); } else { ret[idx + j] = @floatFromInt(q_max); }