Closed pjanx closed 9 months ago
diff --git a/quantsmooth.h b/quantsmooth.h
index 8411b6a..541bd0c 100644
--- a/quantsmooth.h
+++ b/quantsmooth.h
@@ -46,10 +46,16 @@ struct jpeg_decomp_master {
void (*finish_output_pass) (j_decompress_ptr);
boolean is_dummy_pass;
#ifdef LIBJPEG_TURBO_VERSION
+#if LIBJPEG_TURBO_VERSION_NUMBER >= 2001090
+ boolean lossless;
+#endif
JDIMENSION first_iMCU_col, last_iMCU_col;
JDIMENSION first_MCU_col[MAX_COMPONENTS];
JDIMENSION last_MCU_col[MAX_COMPONENTS];
boolean jinit_upsampler_no_alloc;
+#if LIBJPEG_TURBO_VERSION_NUMBER >= 2000090
+ JDIMENSION last_good_iMCU_row;
+#endif
#endif
};
#endif
The trailing field is there since 42825b68d570fb07fe820ac62ad91017e61e9a25, the boolean is part of the lossless libjpeg megamerge.
JPEGQS_UPSAMPLE_UV decides to change 4:2:0 to 4:4:4, apparently the libjpeg-turbo API has changed.
The trailing field is there since 42825b68d570fb07fe820ac62ad91017e61e9a25 (2.0.4).
How is this hash related to the version?
I checked the source archives, the last_good_iMCU_row field appeared in libjpeg-turbo-2.0.90, but it is not yet in libjpeg-turbo-2.0.6.
It seems I got lost in the merge octopus, the 2.0.4 tag just appeared before the hash in linear git log. You're right in that it doesn't appear in the 2.0 series at all.
I committed the fix.
You have a minor typo there, 2000090 (2.0.90) instead of 2001090 (2.1.90).
There is no typo, the last field appeared in version 2.0.90, you can check it in this source archive.
Reproducable on Arch Linux, observed roughly since libjpeg-turbo 2.1.90 (pre-3.0):
Sample input (YCbCr 4:2:0) and output (converted to PNG):
It is the JPEGQS_UPSAMPLE_UV flag that decides whether output becomes garbage. YCbCr 4:4:4 is fine.