]> granicus.if.org Git - libjpeg-turbo/commit
Work around an issue in Visual C++ 2010 and 2013 that was causing the 256-bit bitmap...
authorDRC <dcommander@users.sourceforge.net>
Sun, 20 Apr 2014 07:22:21 +0000 (07:22 +0000)
committerDRC <dcommander@users.sourceforge.net>
Sun, 20 Apr 2014 07:22:21 +0000 (07:22 +0000)
commitac9a92ebbdae96c89723ecec377a4e6a4edf879a
treeef24e7f4504748cbd8b4493eae8a04c5dcdb2d6c
parent06fa20d407314e08a89faafa6f85cc23a757eba3
parentbeb0b33764267797d6f56fd1ec628ac0d322b956
Work around an issue in Visual C++ 2010 and 2013 that was causing the 256-bit bitmap test in the regression tests to fail.  More specifically, when optimization is enabled in these versions of Visual C++, the optimizer seems to get confused by the following code block:

       delta = cur0 * 2;
       cur0 += delta;          /* form error * 3 */
       errorptr[0] = (FSERROR) (bpreverr0 + cur0);
       cur0 += delta;          /* form error * 5 */
       bpreverr0 = belowerr0 + cur0;
       cur0 += delta;          /* form error * 7 */

Each time cur0 is incremented by delta, the compiled code doubles the value of delta (WTF?!)  Thus, by the time the end of the block is reached, cur0 is equal to 15 times its former self, not 7 times its former self as it should be.  At any rate, it was a lot simpler to just refactor the code so that it uses multiplication.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1253 632fc199-4ca6-4c93-a231-07263d6284db
ChangeLog.txt
jquant2.c