You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_exponent() used to require that its callers apply formula (E-5)
to its result for files using scalar-derived quantization. compute_M_b()
did that correctly, but copy_and_dequantize_if_needed() didn't.
Make get_exponent() do all the necessary computations instead, so that
callers can't get it wrong.
Improves rendering of the image in 0001530.pdf a lot.
auto copy_and_dequantize_if_needed = [&](JPEG2000::Span2D<float> output, ReadonlySpan<float> input, QuantizationDefault const& quantization_parameters, JPEG2000::SubBand sub_band_type, int component_index, int r) {
2064
+
auto copy_and_dequantize_if_needed = [&](JPEG2000::Span2D<float> output, ReadonlySpan<float> input, QuantizationDefault const& quantization_parameters, JPEG2000::SubBand sub_band_type, int component_index, int r, int N_L) {
2069
2065
int w = output.size.width();
2070
2066
int h = output.size.height();
2071
2067
VERIFY(w * h == static_cast<int>(input.size()));
@@ -2096,7 +2092,7 @@ static ErrorOr<void> decode_bitplanes_to_coefficients(JPEG2000LoadingContext& co
2096
2092
}
2097
2093
2098
2094
// (E-3)
2099
-
auto exponent = get_exponent(quantization_parameters, sub_band_type, r);
2095
+
auto exponent = get_exponent(quantization_parameters, sub_band_type, r, N_L);
0 commit comments