From 0ef61ab8955db9e8694243466a582bd7c4a4e16b Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Fri, 23 Jun 2023 00:17:08 -0400 Subject: [PATCH] LibGfx/JPEG: Convert some west-consts to east-consts --- .../LibGfx/ImageFormats/JPEGLoader.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp index 6ef7be07af..d192955a48 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp @@ -1562,7 +1562,7 @@ static void ycbcr_to_rgb(JPEGLoadingContext const& context, Vector& // 7 - Conversion to and from RGB for (u32 vcursor = 0; vcursor < context.mblock_meta.vcount; vcursor += context.vsample_factor) { for (u32 hcursor = 0; hcursor < context.mblock_meta.hcount; hcursor += context.hsample_factor) { - const u32 chroma_block_index = vcursor * context.mblock_meta.hpadded_count + hcursor; + u32 const chroma_block_index = vcursor * context.mblock_meta.hpadded_count + hcursor; Macroblock const& chroma = macroblocks[chroma_block_index]; // Overflows are intentional. for (u8 vfactor_i = context.vsample_factor - 1; vfactor_i < context.vsample_factor; --vfactor_i) { @@ -1573,10 +1573,10 @@ static void ycbcr_to_rgb(JPEGLoadingContext const& context, Vector& auto* cr = macroblocks[macroblock_index].cr; for (u8 i = 7; i < 8; --i) { for (u8 j = 7; j < 8; --j) { - const u8 pixel = i * 8 + j; - const u32 chroma_pxrow = (i / context.vsample_factor) + 4 * vfactor_i; - const u32 chroma_pxcol = (j / context.hsample_factor) + 4 * hfactor_i; - const u32 chroma_pixel = chroma_pxrow * 8 + chroma_pxcol; + u8 const pixel = i * 8 + j; + u32 const chroma_pxrow = (i / context.vsample_factor) + 4 * vfactor_i; + u32 const chroma_pxcol = (j / context.hsample_factor) + 4 * hfactor_i; + u32 const chroma_pixel = chroma_pxrow * 8 + chroma_pxcol; int r = y[pixel] + 1.402f * (chroma.cr[chroma_pixel] - 128); int g = y[pixel] - 0.3441f * (chroma.cb[chroma_pixel] - 128) - 0.7141f * (chroma.cr[chroma_pixel] - 128); int b = y[pixel] + 1.772f * (chroma.cb[chroma_pixel] - 128); @@ -1738,14 +1738,14 @@ static ErrorOr compose_bitmap(JPEGLoadingContext& context, Vectorset_pixel(x, y, color); } }