# HG changeset patch # User Grumpy7 # Date 1370127367 -7200 # Node ID f544cd6f7168c9c51cd3b49da16a2e415765ef5c # Parent ed6a9efc6c90990c7b03fffd39954803a38bf735 sub_451007_scale_image_bicubic cleanup - preparations for further condition body extractions diff -r ed6a9efc6c90 -r f544cd6f7168 mm7_2.cpp --- a/mm7_2.cpp Sun Jun 02 00:43:36 2013 +0600 +++ b/mm7_2.cpp Sun Jun 02 00:56:07 2013 +0200 @@ -2191,18 +2191,18 @@ int v120; // eax@223 unsigned int v121; // ecx@231 char v122; // al@235 - double v124; // [sp+Ch] [bp-7Ch]@12 + unsigned int v124; // [sp+Ch] [bp-7Ch]@12 unsigned int v127; // [sp+Ch] [bp-7Ch]@90 - double v132; // [sp+Ch] [bp-7Ch]@218 - double v133; // [sp+14h] [bp-74h]@12 + unsigned int v132; // [sp+Ch] [bp-7Ch]@218 + unsigned int v133; // [sp+14h] [bp-74h]@12 unsigned int v136; // [sp+14h] [bp-74h]@90 - double v141; // [sp+14h] [bp-74h]@218 - double v142; // [sp+1Ch] [bp-6Ch]@12 + unsigned int v141; // [sp+14h] [bp-74h]@218 + unsigned int v142; // [sp+1Ch] [bp-6Ch]@12 unsigned int v145; // [sp+1Ch] [bp-6Ch]@90 - double v150; // [sp+1Ch] [bp-6Ch]@218 - double v151; // [sp+24h] [bp-64h]@12 + unsigned int v150; // [sp+1Ch] [bp-6Ch]@218 + unsigned int v151; // [sp+24h] [bp-64h]@12 unsigned int v154; // [sp+24h] [bp-64h]@90 - double v159; // [sp+24h] [bp-64h]@218 + 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 @@ -2237,8 +2237,9 @@ unsigned int a6r; // [sp+A0h] [bp+18h]@218 int dstdiffmult; - int probablyBitDepth = this->field_20.field_C; - switch(probablyBitDepth) + int field0value = this->field_0.field_C; + int field20value = this->field_20.field_C; + switch(field20value) { case 8: dstdiffmult = dstPitch - dstWidth; break; @@ -2247,7 +2248,7 @@ case 32: dstdiffmult = 4 * (dstPitch - dstWidth); break; default: - return probablyBitDepth; + return field20value; } @@ -2275,21 +2276,21 @@ while ( 1 ) { a6s = (double)v14 / (double)dstWidth * (double)srcWidth; - v151 = bankersRounding(a6s);//a6s + 6.7553994e15; + v151 = bankersRounding(a6s); a6t = (double)(v14 + 1) / (double)dstWidth * (double)srcWidth; - v142 = bankersRounding(a6t);//a6t + 6.7553994e15; + v142 = bankersRounding(a6t); v17 = (double)v231 / (double)dstHeight * (double)srcHeight; - v133 = bankersRounding(v17);//v17 + 6.7553994e15; + v133 = bankersRounding(v17); v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight; - v124 = bankersRounding(v18);//v18 + 6.7553994e15; - v19 = (LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151)); + v124 = bankersRounding(v18); + v19 = (v124 - v133) * (v142 - v151); v252 = 0; a6b = 0; v240 = 0i64; - if ( SLODWORD(v133) < SLODWORD(v124) ) + if ( v133 < v124 ) break; LABEL_25: - v22 = (unsigned int)v240 / ((LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151))); + v22 = (unsigned int)v240 / ((v124 - v133) * (v142 - v151)); if ( v19 ) { a6b /= v19; @@ -2300,7 +2301,7 @@ v22 &= 0x7FFFFFFFu; v23 = _450F55(HIDWORD(v240) | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8)); *(_DWORD *)v193 = v23; - switch(probablyBitDepth) + switch(field20value) { case 8: v193 = (unsigned __int16 *)((char *)v193 + 1); break; @@ -2316,9 +2317,9 @@ if ( v14 >= dstWidth ) goto LABEL_30; } - v160 = LODWORD(v124) - LODWORD(v133); - v175 = &pSrc[2 * (LODWORD(v151) + srcPitch * LODWORD(v133))]; - while ( SLODWORD(v151) >= SLODWORD(v142) ) + v160 = v124 - v133; + v175 = &pSrc[2 * (v151 + srcPitch * v133)]; + while ( v151 >= v142 ) { LABEL_24: v175 += 2 * srcPitch; @@ -2327,7 +2328,7 @@ goto LABEL_25; } v176 = (int *)v175; - v161 = LODWORD(v142) - LODWORD(v151); + v161 = v142 - v151; while ( 1 ) { v21 = _450FB1(*v176); @@ -2367,13 +2368,13 @@ while ( 1 ) { a6y = (double)v50 / (double)dstWidth * (double)srcWidth; - v127 = ceilf(a6y - 0.5f);//a6y + 6.7553994e15; + v127 = bankersRounding(a6y); a6z = (double)(v50 + 1) / (double)dstWidth * (double)srcWidth; - v136 = ceilf(a6z - 0.5f);//a6z + 6.7553994e15; + v136 = bankersRounding(a6z); v53 = (double)v234 / (double)dstHeight * (double)srcHeight; - v145 = ceilf(v53 - 0.5f);//v53 + 6.7553994e15; + v145 = bankersRounding(v53); v54 = (double)(v234 + 1) / (double)dstHeight * (double)srcHeight; - v154 = ceilf(v54 - 0.5f);//v54 + 6.7553994e15; + v154 = bankersRounding(v54); v55 = (v154 - v145) * (v136 - v127); v255 = 0; a6h = 0; @@ -2392,7 +2393,7 @@ v58 &= 0x7FFFFFFFu; v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8)); *(_DWORD *)v196 = v59; - switch(probablyBitDepth) + switch(field20value) { case 8: v196 = (unsigned __int16 *)((char *)v196 + 1); break; @@ -2419,12 +2420,12 @@ goto LABEL_103; } v179 = (int *)v187; - v164 = LODWORD(v136) - LODWORD(v127); + v164 = v136 - v127; while ( 1 ) { v57 = _450FB1(*(_WORD *)v179); break; - LABEL_101: +LABEL_101: v179 = (int *)((char *)v179 + 2); --v164; if ( !v164 ) @@ -2452,26 +2453,26 @@ do { a6bi = (double)v112 / (double)dstWidth * (double)srcWidth; - v132 = a6bi + 6.7553994e15; + v132 = bankersRounding(a6bi); a6bj = (double)(v112 + 1) / (double)dstWidth * (double)srcWidth; - v141 = a6bj + 6.7553994e15; + v141 = bankersRounding(a6bj); v115 = (double)v239 / (double)dstHeight * (double)srcHeight; - v150 = v115 + 6.7553994e15; + v150 = bankersRounding(v115); v116 = (double)(v239 + 1) / (double)dstHeight * (double)srcHeight; - v159 = v116 + 6.7553994e15; + v159 = bankersRounding(v116); v251 = 0; - v117 = (LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132)); + v117 = (v159 - v150) * (v141 - v132); v260 = 0; a6r = 0; v248 = 0; - if ( SLODWORD(v150) >= SLODWORD(v159) ) + if ( v150 >= v159 ) goto LABEL_231; - v169 = LODWORD(v159) - LODWORD(v150); - v184 = (char *)pSrc + srcPitch * LODWORD(v150); + v169 = v159 - v150; + v184 = (char *)pSrc + srcPitch * v150; do { - v118 = LODWORD(v132); - while ( v118 < SLODWORD(v141) ) + v118 = v132; + while ( v118 < v141 ) { v119 = (unsigned __int8)v184[v118]; v120 = _450FB1(v119); @@ -2486,7 +2487,7 @@ } while ( v169 ); LABEL_231: - v121 = v248 / ((LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132))); + v121 = v248 / ((v159 - v150) * (v141 - v132)); if ( v117 ) { a6r /= v117; @@ -2497,7 +2498,7 @@ v121 &= 0x7FFFFFFFu; v122 = _450F55(v251 | ((v260 | ((a6r | (v121 << 8)) << 8)) << 8)); *v201 = v122; - switch(probablyBitDepth) + switch(field20value) { case 8: v201 = (unsigned __int16 *)((char *)v201 + 1); break;