Mercurial > mm7
changeset 1147:9ba9fd8e6d68
sub_451007_scale_image_bicubic cleanup - some more code shuffling
author | Grumpy7 |
---|---|
date | Sun, 02 Jun 2013 03:59:13 +0200 |
parents | b4ade2580ae3 |
children | ee6bccef32e8 |
files | mm7_2.cpp |
diffstat | 1 files changed, 26 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/mm7_2.cpp Sun Jun 02 03:10:20 2013 +0200 +++ b/mm7_2.cpp Sun Jun 02 03:59:13 2013 +0200 @@ -2224,9 +2224,7 @@ default: return field20value; } - - assert(srcWidth >= dstWidth); - + result = this->field_0.field_C; if ( result == 32 || result == 16) { @@ -2250,6 +2248,7 @@ heightRatio = bankersRounding(v17); v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight; heightRatioPlusOne = bankersRounding(v18); + v251 = 0; v19 = (heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio); v252 = 0; a6b = 0; @@ -2262,48 +2261,38 @@ else v175 = &pSrc[widthRatio + srcPitch * heightRatio]; - while ( widthRatio >= widthRatioPlusOne ) - { -LABEL_24: + do + { + int ratioDiff = widthRatioPlusOne - widthRatio; + for(int i = 0; i < ratioDiff; i++) + { + if(field0value == 32) + v21 = _450FB1((int)v175[i]); + else + v21 = _450FB1((_WORD)v175[i]); + v240 += ((unsigned int)v21 >> 24); + a6b += BYTE2(v21); + v252 += BYTE1(v21); + v251 += (unsigned __int8)v21; + } if(field0value == 32) v175 += 2 * srcPitch; else v175 += srcPitch; --v160; - if ( !v160 ) - goto LABEL_25; - } - v176 = (int *)v175; - v161 = widthRatioPlusOne - widthRatio; - while ( 1 ) - { - if(field0value == 32) - v21 = _450FB1(*v176); - else - v21 = _450FB1(*(_WORD *)v176); - LODWORD(v240) = ((unsigned int)v21 >> 24) + v240; - a6b += BYTE2(v21); - v252 += BYTE1(v21); - HIDWORD(v240) += (unsigned __int8)v21; - if(field0value == 32) - ++v176; - else - v176 = (int *)((char *)v176 + 2); - --v161; - if ( !v161 ) - goto LABEL_24; - } + } + while ( v160 ); LABEL_25: v22 = (unsigned int)v240 / ((heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio)); if ( v19 ) { a6b /= v19; v252 /= v19; - HIDWORD(v240) /= v19; + v251 /= v19; } if ( v22 != 255 ) v22 &= 0x7FFFFFFFu; - v23 = _450F55(HIDWORD(v240) | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8)); + v23 = _450F55(v251 | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8)); *(_DWORD *)v193 = v23; switch(field20value) { @@ -2359,24 +2348,22 @@ if ( heightRatio >= heightRatioPlusOne ) goto LABEL_231; v169 = heightRatioPlusOne - heightRatio; - v184 = (char *)pSrc + srcPitch * heightRatio; + v184 = (char *)pSrc + widthRatio + srcPitch * heightRatio; do { - v118 = widthRatio; - while ( v118 < widthRatioPlusOne ) - { - v119 = (unsigned __int8)v184[v118]; - v120 = _450FB1(v119); + int ratioDiff = widthRatioPlusOne - widthRatio; + for(int i = 0; i < ratioDiff; i++) + { + v120 = _450FB1((unsigned __int8)v184[i]); v248 += (unsigned int)v120 >> 24; a6r += BYTE2(v120); v260 += BYTE1(v120); v251 += (unsigned __int8)v120; - ++v118; } v184 += srcPitch; --v169; } - while ( v169 ); + while ( v169 );; LABEL_231: v121 = v248 / ((heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio)); if ( v117 )