From: sgunderson@bigfoot.com <> Date: Sun, 31 May 2009 19:18:50 +0000 (+0200) Subject: Do some manual strength reduction. X-Git-Url: https://git.sesse.net/?p=fjl;a=commitdiff_plain;h=9d977ffbb1bc9cfe41d5e074de51bb9d7bed96d7;ds=inline Do some manual strength reduction. --- diff --git a/driver.c b/driver.c index b12b226..04e2369 100644 --- a/driver.c +++ b/driver.c @@ -194,13 +194,11 @@ void read_scan(struct byte_source* source, struct jpeg_image* image, huffman_tab uint8_t pixdata[DCTSIZE2]; idct_choice(coeff, image->idct_data[image->qtable[cn]], pixdata); - for (unsigned y = 0; y < DCTSIZE; ++y) { - unsigned real_x = (mcu_x * image->hsample[cn] + local_xb) * DCTSIZE; - unsigned real_y = (mcu_y * image->vsample[cn] + local_yb) * DCTSIZE + y; - - memcpy(image->pixel_data[cn] + real_y * stride + real_x, - pixdata + y * DCTSIZE, - DCTSIZE); + unsigned real_x = (mcu_x * image->hsample[cn] + local_xb) * DCTSIZE; + unsigned real_y = (mcu_y * image->vsample[cn] + local_yb) * DCTSIZE; + uint8_t* dest_pixdata = image->pixel_data[cn] + real_y * stride + real_x; + for (unsigned y = 0; y < DCTSIZE; ++y, dest_pixdata += stride) { + memcpy(dest_pixdata, pixdata + y * DCTSIZE, DCTSIZE); } } }