# HG changeset patch # User Grumpy7 # Date 1370129538 -7200 # Node ID 30d02f00ae29255122306c1b22ad2933c0a95dc4 # Parent f544cd6f7168c9c51cd3b49da16a2e415765ef5c sub_451007_scale_image_bicubic cleanup - merged field_0.field_C 32 and 16 cases diff -r f544cd6f7168 -r 30d02f00ae29 mm7_2.cpp --- a/mm7_2.cpp Sun Jun 02 00:56:07 2013 +0200 +++ b/mm7_2.cpp Sun Jun 02 01:32:18 2013 +0200 @@ -2175,13 +2175,6 @@ int v21; // eax@18 unsigned int v22; // ecx@25 unsigned int v23; // eax@29 - int v50; // ecx@88 - float v53; // ST34_4@90 - float v54; // ST30_4@90 - unsigned int v55; // esi@90 - int v57; // eax@96 - unsigned int v58; // ecx@103 - unsigned int v59; // eax@107 int v112; // ecx@216 float v115; // ST34_4@218 float v116; // ST30_4@218 @@ -2192,52 +2185,37 @@ unsigned int v121; // ecx@231 char v122; // al@235 unsigned int v124; // [sp+Ch] [bp-7Ch]@12 - unsigned int v127; // [sp+Ch] [bp-7Ch]@90 unsigned int v132; // [sp+Ch] [bp-7Ch]@218 unsigned int v133; // [sp+14h] [bp-74h]@12 - unsigned int v136; // [sp+14h] [bp-74h]@90 unsigned int v141; // [sp+14h] [bp-74h]@218 unsigned int v142; // [sp+1Ch] [bp-6Ch]@12 - unsigned int v145; // [sp+1Ch] [bp-6Ch]@90 unsigned int v150; // [sp+1Ch] [bp-6Ch]@218 unsigned int v151; // [sp+24h] [bp-64h]@12 - unsigned int v154; // [sp+24h] [bp-64h]@90 unsigned int v159; // [sp+24h] [bp-64h]@218 int v160; // [sp+3Ch] [bp-4Ch]@13 int v161; // [sp+40h] [bp-48h]@15 - int v164; // [sp+44h] [bp-44h]@93 int v169; // [sp+44h] [bp-44h]@219 - int v172; // [sp+48h] [bp-40h]@91 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13 int *v176; // [sp+50h] [bp-38h]@15 - int *v179; // [sp+50h] [bp-38h]@93 char *v184; // [sp+50h] [bp-38h]@219 - unsigned __int16 *v187; // [sp+54h] [bp-34h]@91 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7 - unsigned __int16 *v196; // [sp+5Ch] [bp-2Ch]@85 unsigned __int16 *v201; // [sp+5Ch] [bp-2Ch]@213 signed int v231; // [sp+78h] [bp-10h]@7 - signed int v234; // [sp+78h] [bp-10h]@85 signed int v239; // [sp+78h] [bp-10h]@213 __int64 v240; // [sp+7Ch] [bp-Ch]@12 - __int64 v243; // [sp+7Ch] [bp-Ch]@90 unsigned int v248; // [sp+7Ch] [bp-Ch]@218 unsigned int v251; // [sp+80h] [bp-8h]@218 unsigned int v252; // [sp+84h] [bp-4h]@12 - unsigned int v255; // [sp+84h] [bp-4h]@90 unsigned int v260; // [sp+84h] [bp-4h]@218 float a6s; // [sp+A0h] [bp+18h]@12 float a6t; // [sp+A0h] [bp+18h]@12 unsigned int a6b; // [sp+A0h] [bp+18h]@12 - float a6y; // [sp+A0h] [bp+18h]@90 - float a6z; // [sp+A0h] [bp+18h]@90 - unsigned int a6h; // [sp+A0h] [bp+18h]@90 float a6bi; // [sp+A0h] [bp+18h]@218 float a6bj; // [sp+A0h] [bp+18h]@218 unsigned int a6r; // [sp+A0h] [bp+18h]@218 int dstdiffmult; - int field0value = this->field_0.field_C; + int field0value = 32; int field20value = this->field_20.field_C; switch(field20value) { @@ -2251,10 +2229,8 @@ return field20value; } - - result = this->field_0.field_C; - if ( result == 32 ) + if ( result == 32 || result == 16) { result = (int)pDst; v193 = pDst; @@ -2318,11 +2294,18 @@ goto LABEL_30; } v160 = v124 - v133; - v175 = &pSrc[2 * (v151 + srcPitch * v133)]; + if(field0value == 32) + v175 = &pSrc[2 * (v151 + srcPitch * v133)]; + else + v175 = &pSrc[v151 + srcPitch * v133]; + while ( v151 >= v142 ) { LABEL_24: - v175 += 2 * srcPitch; + if(field0value == 32) + v175 += 2 * srcPitch; + else + v175 += srcPitch; --v160; if ( !v160 ) goto LABEL_25; @@ -2331,10 +2314,16 @@ v161 = v142 - v151; while ( 1 ) { - v21 = _450FB1(*v176); + if(field0value == 32) + v21 = _450FB1(*v176); + else + v21 = _450FB1(*(_WORD *)v176); break; LABEL_23: - ++v176; + if(field0value == 32) + ++v176; + else + v176 = (int *)((char *)v176 + 2); --v161; if ( !v161 ) goto LABEL_24; @@ -2346,98 +2335,6 @@ goto LABEL_23; } - else if ( result == 16 ) - { - result = (int)pDst; - v196 = pDst; - v234 = 0; - if ( dstHeight <= 0 ) - return result; - while ( 1 ) - { - v50 = 0; - if ( dstWidth > 0 ) - break; - LABEL_108: - v196 = (unsigned __int16 *)((char *)v196 + dstdiffmult); - ++v234; - result = v234; - if ( v234 >= dstHeight ) - return result; - } - while ( 1 ) - { - a6y = (double)v50 / (double)dstWidth * (double)srcWidth; - v127 = bankersRounding(a6y); - a6z = (double)(v50 + 1) / (double)dstWidth * (double)srcWidth; - v136 = bankersRounding(a6z); - v53 = (double)v234 / (double)dstHeight * (double)srcHeight; - v145 = bankersRounding(v53); - v54 = (double)(v234 + 1) / (double)dstHeight * (double)srcHeight; - v154 = bankersRounding(v54); - v55 = (v154 - v145) * (v136 - v127); - v255 = 0; - a6h = 0; - v243 = 0i64; - if ( v145 < v154 ) - break; - LABEL_103: - v58 = (unsigned int)v243 / ((v154 - v145) * (v136 - v127)); - if ( v55 ) - { - a6h /= v55; - v255 /= v55; - HIDWORD(v243) /= v55; - } - if ( v58 != 255 ) - v58 &= 0x7FFFFFFFu; - v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8)); - *(_DWORD *)v196 = v59; - switch(field20value) - { - case 8: v196 = (unsigned __int16 *)((char *)v196 + 1); - break; - case 16: ++v196; - break; - case 32: v196 += 2; - break; - default: - assert(false); - return result; - } - ++v50; - if ( v50 >= dstWidth ) - goto LABEL_108; - } - v172 = v154 - v145; - v187 = &pSrc[v127 + srcPitch * v145]; - while ( v127 >= v136 ) - { - LABEL_102: - v187 += srcPitch; - --v172; - if ( !v172 ) - goto LABEL_103; - } - v179 = (int *)v187; - v164 = v136 - v127; - while ( 1 ) - { - v57 = _450FB1(*(_WORD *)v179); - break; -LABEL_101: - v179 = (int *)((char *)v179 + 2); - --v164; - if ( !v164 ) - goto LABEL_102; - } - LODWORD(v243) = ((unsigned int)v57 >> 24) + v243; - a6h += BYTE2(v57); - v255 += BYTE1(v57); - HIDWORD(v243) += (unsigned __int8)v57; - goto LABEL_101; - } - else if ( result == 8 ) { result = (int)pDst;