From 68b9d63ecdd5780714340170c50665c26fb8cd2d Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Thu, 12 May 2022 23:27:28 -0500 Subject: [PATCH] f --- src/pixie/fileformats/jpeg.nim | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/pixie/fileformats/jpeg.nim b/src/pixie/fileformats/jpeg.nim index e181b06..c868275 100644 --- a/src/pixie/fileformats/jpeg.nim +++ b/src/pixie/fileformats/jpeg.nim @@ -283,10 +283,7 @@ proc decodeSOF0(state: var DecoderState) = component.widthStride = state.numMcuWide * component.yScale * 8 component.heightStride = state.numMcuHigh * component.xScale * 8 - - component.channel = newMask( - component.widthStride, component.heightStride - ) + component.channel = newMask(component.widthStride, component.heightStride) if state.progressive: component.widthCoeff = component.widthStride div 8 @@ -482,10 +479,11 @@ proc decodeRegularBlock( failInvalid() let - diff = if t == 0: - 0 - else: - state.getBitsAsSignedInt(t) + diff = + if t == 0: + 0 + else: + state.getBitsAsSignedInt(t) dc = state.components[component].dcPred + diff state.components[component].dcPred = dc data[0] = cast[int16](dc) @@ -787,7 +785,6 @@ proc decodeBlocks(state: var DecoderState) = ## Decodes scan data blocks that follow a SOS block. if state.scanComponents == 1: # Single component pass. - let comp = state.componentOrder[0] w = (state.components[comp].width + 7) shr 3 @@ -815,7 +812,6 @@ proc quantizationAndIDCTPass(state: var DecoderState) = let w = (state.components[comp].width + 7) shr 3 h = (state.components[comp].height + 7) shr 3 - for column in 0 ..< h: for row in 0 ..< w: var data = state.components[comp].blocks[row][column]