[6.7.6]problem about GetImageOption() in ReadJPEGImage?
Posted: 2012-07-09T09:39:32-07:00
hi magick,
I encountered a zoom performance problem. well, here is my code:
I have got some timing test( in the code ), compared to IM6.2.8, the new IM (I' m using 6.7.6) is about 2 times slower. I have already disabled openmp. And finally, with the help of opfofile, I noticed that different coders/jpeg.so is the reason why the read process in the new version is slower(The zoom process is also much slower in the new version. I found the new version spent much CPU cycles in VerticalFilter, while the old version is in HorizontalFilter. The size of the test pic is 740x8427. I'm zooming it into 250x250). Going deeper, I noticed that in the function ReadJPEGImage(), the IM 6.7.6 is using GetImageOption() to get the "jpeg:size" option's value instead of image_info->size, which the old version was using. What's more, I failed to find the SetImageOption() call which would set up the SplayTree. This lead to the NULL result of the call of GetImageOption(), which results in the skip of scaling process of the image(Actually, I don't know why this is needed here. After this process, the pic's output_width and ouput_height is halfen.). I have tried to replace this C calling with the C++ version and the performance downgrade is gone. Could you tell me if I am doing this right ? Thanks.
I encountered a zoom performance problem. well, here is my code:
Code: Select all
Image image;
Blob srcBlob(some_data, some_len);
Geometry geometry(some_width, some_height);
image.read(srcBlob, geometry);
image.zoom(geometry);