Skip to content

Commit a086caf

Browse files
JPEG: Don't call IDCT twice
1 parent 2e95a2c commit a086caf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

MCGalaxy/util/Imaging/JpegDecoder.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void DecodeMCUs(byte[] src, SimpleBitmap bmp) {
300300
for (int by = 0; by < comp.BlocksPerMcuY; by++)
301301
for (int bx = 0; bx < comp.BlocksPerMcuX; bx++)
302302
{
303-
DecodeBlock(comp, src, block, output);
303+
DecodeBlock(comp, src, block);
304304
IDCT(block, output);
305305

306306
int samplesX = lowestHor / comp.SamplingHor;
@@ -358,7 +358,7 @@ static byte ByteClamp(float v) {
358358
return (byte)v;
359359
}
360360

361-
void DecodeBlock(JpegComponent comp, byte[] src, int[] block, float[] output) {
361+
void DecodeBlock(JpegComponent comp, byte[] src, int[] block) {
362362
// DC value is relative to DC value from prior block
363363
var table = dc_huff_tables[comp.DCHuffTable];
364364
int dc_code = ReadHuffman(table, src);
@@ -394,8 +394,6 @@ void DecodeBlock(JpegComponent comp, byte[] src, int[] block, float[] output) {
394394
idx++;
395395
}
396396
} while (idx < 64);
397-
398-
IDCT(block, output);
399397
}
400398

401399
float[] idct_factors;

0 commit comments

Comments
 (0)