1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibGfx/JPEG: Print debug information on subsampling for each component

This commit is contained in:
Lucas CHOLLET 2024-01-04 20:14:06 -05:00 committed by Sam Atkins
parent 145672a8b4
commit 6c85f937ef

View file

@ -1197,11 +1197,6 @@ static inline bool validate_luma_and_modify_context(Component const& luma, JPEGL
context.hsample_factor = luma.hsample_factor;
context.vsample_factor = luma.vsample_factor;
if constexpr (JPEG_DEBUG) {
dbgln("Horizontal Subsampling Factor: {}", luma.hsample_factor);
dbgln("Vertical Subsampling Factor: {}", luma.vsample_factor);
}
return true;
}
return false;
@ -1273,6 +1268,8 @@ static ErrorOr<void> read_start_of_frame(JPEGStream& stream, JPEGLoadingContext&
component.hsample_factor = subsample_factors >> 4;
component.vsample_factor = subsample_factors & 0x0F;
dbgln_if(JPEG_DEBUG, "Component subsampling: {}, {}", component.hsample_factor, component.vsample_factor);
if (i == 0) {
// By convention, downsampling is applied only on chroma components. So we should
// hope to see the maximum sampling factor in the luma component.