]> git.sesse.net Git - fjl/commitdiff
Do some manual strength reduction.
authorsgunderson@bigfoot.com <>
Sun, 31 May 2009 19:18:50 +0000 (21:18 +0200)
committersgunderson@bigfoot.com <>
Sun, 31 May 2009 19:18:50 +0000 (21:18 +0200)
driver.c

index b12b226c336dcc29ea9993f521fbd8f393ec8f79..04e236912ca45d56bc4f1a34f16b3c04185112d9 100644 (file)
--- 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);
                                        }
                                }
                        }