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); }