Mercurial > mm7
comparison mm7_2.cpp @ 1144:f544cd6f7168
sub_451007_scale_image_bicubic cleanup - preparations for further condition body extractions
author | Grumpy7 |
---|---|
date | Sun, 02 Jun 2013 00:56:07 +0200 |
parents | 3bc7bb4ab1a5 |
children | 30d02f00ae29 |
comparison
equal
deleted
inserted
replaced
1143:ed6a9efc6c90 | 1144:f544cd6f7168 |
---|---|
2189 signed int v118; // eax@220 | 2189 signed int v118; // eax@220 |
2190 int v119; // eax@221 | 2190 int v119; // eax@221 |
2191 int v120; // eax@223 | 2191 int v120; // eax@223 |
2192 unsigned int v121; // ecx@231 | 2192 unsigned int v121; // ecx@231 |
2193 char v122; // al@235 | 2193 char v122; // al@235 |
2194 double v124; // [sp+Ch] [bp-7Ch]@12 | 2194 unsigned int v124; // [sp+Ch] [bp-7Ch]@12 |
2195 unsigned int v127; // [sp+Ch] [bp-7Ch]@90 | 2195 unsigned int v127; // [sp+Ch] [bp-7Ch]@90 |
2196 double v132; // [sp+Ch] [bp-7Ch]@218 | 2196 unsigned int v132; // [sp+Ch] [bp-7Ch]@218 |
2197 double v133; // [sp+14h] [bp-74h]@12 | 2197 unsigned int v133; // [sp+14h] [bp-74h]@12 |
2198 unsigned int v136; // [sp+14h] [bp-74h]@90 | 2198 unsigned int v136; // [sp+14h] [bp-74h]@90 |
2199 double v141; // [sp+14h] [bp-74h]@218 | 2199 unsigned int v141; // [sp+14h] [bp-74h]@218 |
2200 double v142; // [sp+1Ch] [bp-6Ch]@12 | 2200 unsigned int v142; // [sp+1Ch] [bp-6Ch]@12 |
2201 unsigned int v145; // [sp+1Ch] [bp-6Ch]@90 | 2201 unsigned int v145; // [sp+1Ch] [bp-6Ch]@90 |
2202 double v150; // [sp+1Ch] [bp-6Ch]@218 | 2202 unsigned int v150; // [sp+1Ch] [bp-6Ch]@218 |
2203 double v151; // [sp+24h] [bp-64h]@12 | 2203 unsigned int v151; // [sp+24h] [bp-64h]@12 |
2204 unsigned int v154; // [sp+24h] [bp-64h]@90 | 2204 unsigned int v154; // [sp+24h] [bp-64h]@90 |
2205 double v159; // [sp+24h] [bp-64h]@218 | 2205 unsigned int v159; // [sp+24h] [bp-64h]@218 |
2206 int v160; // [sp+3Ch] [bp-4Ch]@13 | 2206 int v160; // [sp+3Ch] [bp-4Ch]@13 |
2207 int v161; // [sp+40h] [bp-48h]@15 | 2207 int v161; // [sp+40h] [bp-48h]@15 |
2208 int v164; // [sp+44h] [bp-44h]@93 | 2208 int v164; // [sp+44h] [bp-44h]@93 |
2209 int v169; // [sp+44h] [bp-44h]@219 | 2209 int v169; // [sp+44h] [bp-44h]@219 |
2210 int v172; // [sp+48h] [bp-40h]@91 | 2210 int v172; // [sp+48h] [bp-40h]@91 |
2235 float a6bi; // [sp+A0h] [bp+18h]@218 | 2235 float a6bi; // [sp+A0h] [bp+18h]@218 |
2236 float a6bj; // [sp+A0h] [bp+18h]@218 | 2236 float a6bj; // [sp+A0h] [bp+18h]@218 |
2237 unsigned int a6r; // [sp+A0h] [bp+18h]@218 | 2237 unsigned int a6r; // [sp+A0h] [bp+18h]@218 |
2238 int dstdiffmult; | 2238 int dstdiffmult; |
2239 | 2239 |
2240 int probablyBitDepth = this->field_20.field_C; | 2240 int field0value = this->field_0.field_C; |
2241 switch(probablyBitDepth) | 2241 int field20value = this->field_20.field_C; |
2242 switch(field20value) | |
2242 { | 2243 { |
2243 case 8: dstdiffmult = dstPitch - dstWidth; | 2244 case 8: dstdiffmult = dstPitch - dstWidth; |
2244 break; | 2245 break; |
2245 case 16: dstdiffmult = 2 * (dstPitch - dstWidth); | 2246 case 16: dstdiffmult = 2 * (dstPitch - dstWidth); |
2246 break; | 2247 break; |
2247 case 32: dstdiffmult = 4 * (dstPitch - dstWidth); | 2248 case 32: dstdiffmult = 4 * (dstPitch - dstWidth); |
2248 break; | 2249 break; |
2249 default: | 2250 default: |
2250 return probablyBitDepth; | 2251 return field20value; |
2251 } | 2252 } |
2252 | 2253 |
2253 | 2254 |
2254 | 2255 |
2255 result = this->field_0.field_C; | 2256 result = this->field_0.field_C; |
2273 return result; | 2274 return result; |
2274 } | 2275 } |
2275 while ( 1 ) | 2276 while ( 1 ) |
2276 { | 2277 { |
2277 a6s = (double)v14 / (double)dstWidth * (double)srcWidth; | 2278 a6s = (double)v14 / (double)dstWidth * (double)srcWidth; |
2278 v151 = bankersRounding(a6s);//a6s + 6.7553994e15; | 2279 v151 = bankersRounding(a6s); |
2279 a6t = (double)(v14 + 1) / (double)dstWidth * (double)srcWidth; | 2280 a6t = (double)(v14 + 1) / (double)dstWidth * (double)srcWidth; |
2280 v142 = bankersRounding(a6t);//a6t + 6.7553994e15; | 2281 v142 = bankersRounding(a6t); |
2281 v17 = (double)v231 / (double)dstHeight * (double)srcHeight; | 2282 v17 = (double)v231 / (double)dstHeight * (double)srcHeight; |
2282 v133 = bankersRounding(v17);//v17 + 6.7553994e15; | 2283 v133 = bankersRounding(v17); |
2283 v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight; | 2284 v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight; |
2284 v124 = bankersRounding(v18);//v18 + 6.7553994e15; | 2285 v124 = bankersRounding(v18); |
2285 v19 = (LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151)); | 2286 v19 = (v124 - v133) * (v142 - v151); |
2286 v252 = 0; | 2287 v252 = 0; |
2287 a6b = 0; | 2288 a6b = 0; |
2288 v240 = 0i64; | 2289 v240 = 0i64; |
2289 if ( SLODWORD(v133) < SLODWORD(v124) ) | 2290 if ( v133 < v124 ) |
2290 break; | 2291 break; |
2291 LABEL_25: | 2292 LABEL_25: |
2292 v22 = (unsigned int)v240 / ((LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151))); | 2293 v22 = (unsigned int)v240 / ((v124 - v133) * (v142 - v151)); |
2293 if ( v19 ) | 2294 if ( v19 ) |
2294 { | 2295 { |
2295 a6b /= v19; | 2296 a6b /= v19; |
2296 v252 /= v19; | 2297 v252 /= v19; |
2297 HIDWORD(v240) /= v19; | 2298 HIDWORD(v240) /= v19; |
2298 } | 2299 } |
2299 if ( v22 != 255 ) | 2300 if ( v22 != 255 ) |
2300 v22 &= 0x7FFFFFFFu; | 2301 v22 &= 0x7FFFFFFFu; |
2301 v23 = _450F55(HIDWORD(v240) | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8)); | 2302 v23 = _450F55(HIDWORD(v240) | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8)); |
2302 *(_DWORD *)v193 = v23; | 2303 *(_DWORD *)v193 = v23; |
2303 switch(probablyBitDepth) | 2304 switch(field20value) |
2304 { | 2305 { |
2305 case 8: v193 = (unsigned __int16 *)((char *)v193 + 1); | 2306 case 8: v193 = (unsigned __int16 *)((char *)v193 + 1); |
2306 break; | 2307 break; |
2307 case 16: ++v193; | 2308 case 16: ++v193; |
2308 break; | 2309 break; |
2314 } | 2315 } |
2315 ++v14; | 2316 ++v14; |
2316 if ( v14 >= dstWidth ) | 2317 if ( v14 >= dstWidth ) |
2317 goto LABEL_30; | 2318 goto LABEL_30; |
2318 } | 2319 } |
2319 v160 = LODWORD(v124) - LODWORD(v133); | 2320 v160 = v124 - v133; |
2320 v175 = &pSrc[2 * (LODWORD(v151) + srcPitch * LODWORD(v133))]; | 2321 v175 = &pSrc[2 * (v151 + srcPitch * v133)]; |
2321 while ( SLODWORD(v151) >= SLODWORD(v142) ) | 2322 while ( v151 >= v142 ) |
2322 { | 2323 { |
2323 LABEL_24: | 2324 LABEL_24: |
2324 v175 += 2 * srcPitch; | 2325 v175 += 2 * srcPitch; |
2325 --v160; | 2326 --v160; |
2326 if ( !v160 ) | 2327 if ( !v160 ) |
2327 goto LABEL_25; | 2328 goto LABEL_25; |
2328 } | 2329 } |
2329 v176 = (int *)v175; | 2330 v176 = (int *)v175; |
2330 v161 = LODWORD(v142) - LODWORD(v151); | 2331 v161 = v142 - v151; |
2331 while ( 1 ) | 2332 while ( 1 ) |
2332 { | 2333 { |
2333 v21 = _450FB1(*v176); | 2334 v21 = _450FB1(*v176); |
2334 break; | 2335 break; |
2335 LABEL_23: | 2336 LABEL_23: |
2365 return result; | 2366 return result; |
2366 } | 2367 } |
2367 while ( 1 ) | 2368 while ( 1 ) |
2368 { | 2369 { |
2369 a6y = (double)v50 / (double)dstWidth * (double)srcWidth; | 2370 a6y = (double)v50 / (double)dstWidth * (double)srcWidth; |
2370 v127 = ceilf(a6y - 0.5f);//a6y + 6.7553994e15; | 2371 v127 = bankersRounding(a6y); |
2371 a6z = (double)(v50 + 1) / (double)dstWidth * (double)srcWidth; | 2372 a6z = (double)(v50 + 1) / (double)dstWidth * (double)srcWidth; |
2372 v136 = ceilf(a6z - 0.5f);//a6z + 6.7553994e15; | 2373 v136 = bankersRounding(a6z); |
2373 v53 = (double)v234 / (double)dstHeight * (double)srcHeight; | 2374 v53 = (double)v234 / (double)dstHeight * (double)srcHeight; |
2374 v145 = ceilf(v53 - 0.5f);//v53 + 6.7553994e15; | 2375 v145 = bankersRounding(v53); |
2375 v54 = (double)(v234 + 1) / (double)dstHeight * (double)srcHeight; | 2376 v54 = (double)(v234 + 1) / (double)dstHeight * (double)srcHeight; |
2376 v154 = ceilf(v54 - 0.5f);//v54 + 6.7553994e15; | 2377 v154 = bankersRounding(v54); |
2377 v55 = (v154 - v145) * (v136 - v127); | 2378 v55 = (v154 - v145) * (v136 - v127); |
2378 v255 = 0; | 2379 v255 = 0; |
2379 a6h = 0; | 2380 a6h = 0; |
2380 v243 = 0i64; | 2381 v243 = 0i64; |
2381 if ( v145 < v154 ) | 2382 if ( v145 < v154 ) |
2390 } | 2391 } |
2391 if ( v58 != 255 ) | 2392 if ( v58 != 255 ) |
2392 v58 &= 0x7FFFFFFFu; | 2393 v58 &= 0x7FFFFFFFu; |
2393 v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8)); | 2394 v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8)); |
2394 *(_DWORD *)v196 = v59; | 2395 *(_DWORD *)v196 = v59; |
2395 switch(probablyBitDepth) | 2396 switch(field20value) |
2396 { | 2397 { |
2397 case 8: v196 = (unsigned __int16 *)((char *)v196 + 1); | 2398 case 8: v196 = (unsigned __int16 *)((char *)v196 + 1); |
2398 break; | 2399 break; |
2399 case 16: ++v196; | 2400 case 16: ++v196; |
2400 break; | 2401 break; |
2417 --v172; | 2418 --v172; |
2418 if ( !v172 ) | 2419 if ( !v172 ) |
2419 goto LABEL_103; | 2420 goto LABEL_103; |
2420 } | 2421 } |
2421 v179 = (int *)v187; | 2422 v179 = (int *)v187; |
2422 v164 = LODWORD(v136) - LODWORD(v127); | 2423 v164 = v136 - v127; |
2423 while ( 1 ) | 2424 while ( 1 ) |
2424 { | 2425 { |
2425 v57 = _450FB1(*(_WORD *)v179); | 2426 v57 = _450FB1(*(_WORD *)v179); |
2426 break; | 2427 break; |
2427 LABEL_101: | 2428 LABEL_101: |
2428 v179 = (int *)((char *)v179 + 2); | 2429 v179 = (int *)((char *)v179 + 2); |
2429 --v164; | 2430 --v164; |
2430 if ( !v164 ) | 2431 if ( !v164 ) |
2431 goto LABEL_102; | 2432 goto LABEL_102; |
2432 } | 2433 } |
2450 if ( dstWidth <= 0 ) | 2451 if ( dstWidth <= 0 ) |
2451 goto LABEL_236; | 2452 goto LABEL_236; |
2452 do | 2453 do |
2453 { | 2454 { |
2454 a6bi = (double)v112 / (double)dstWidth * (double)srcWidth; | 2455 a6bi = (double)v112 / (double)dstWidth * (double)srcWidth; |
2455 v132 = a6bi + 6.7553994e15; | 2456 v132 = bankersRounding(a6bi); |
2456 a6bj = (double)(v112 + 1) / (double)dstWidth * (double)srcWidth; | 2457 a6bj = (double)(v112 + 1) / (double)dstWidth * (double)srcWidth; |
2457 v141 = a6bj + 6.7553994e15; | 2458 v141 = bankersRounding(a6bj); |
2458 v115 = (double)v239 / (double)dstHeight * (double)srcHeight; | 2459 v115 = (double)v239 / (double)dstHeight * (double)srcHeight; |
2459 v150 = v115 + 6.7553994e15; | 2460 v150 = bankersRounding(v115); |
2460 v116 = (double)(v239 + 1) / (double)dstHeight * (double)srcHeight; | 2461 v116 = (double)(v239 + 1) / (double)dstHeight * (double)srcHeight; |
2461 v159 = v116 + 6.7553994e15; | 2462 v159 = bankersRounding(v116); |
2462 v251 = 0; | 2463 v251 = 0; |
2463 v117 = (LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132)); | 2464 v117 = (v159 - v150) * (v141 - v132); |
2464 v260 = 0; | 2465 v260 = 0; |
2465 a6r = 0; | 2466 a6r = 0; |
2466 v248 = 0; | 2467 v248 = 0; |
2467 if ( SLODWORD(v150) >= SLODWORD(v159) ) | 2468 if ( v150 >= v159 ) |
2468 goto LABEL_231; | 2469 goto LABEL_231; |
2469 v169 = LODWORD(v159) - LODWORD(v150); | 2470 v169 = v159 - v150; |
2470 v184 = (char *)pSrc + srcPitch * LODWORD(v150); | 2471 v184 = (char *)pSrc + srcPitch * v150; |
2471 do | 2472 do |
2472 { | 2473 { |
2473 v118 = LODWORD(v132); | 2474 v118 = v132; |
2474 while ( v118 < SLODWORD(v141) ) | 2475 while ( v118 < v141 ) |
2475 { | 2476 { |
2476 v119 = (unsigned __int8)v184[v118]; | 2477 v119 = (unsigned __int8)v184[v118]; |
2477 v120 = _450FB1(v119); | 2478 v120 = _450FB1(v119); |
2478 v248 += (unsigned int)v120 >> 24; | 2479 v248 += (unsigned int)v120 >> 24; |
2479 a6r += BYTE2(v120); | 2480 a6r += BYTE2(v120); |
2484 v184 += srcPitch; | 2485 v184 += srcPitch; |
2485 --v169; | 2486 --v169; |
2486 } | 2487 } |
2487 while ( v169 ); | 2488 while ( v169 ); |
2488 LABEL_231: | 2489 LABEL_231: |
2489 v121 = v248 / ((LODWORD(v159) - LODWORD(v150)) * (LODWORD(v141) - LODWORD(v132))); | 2490 v121 = v248 / ((v159 - v150) * (v141 - v132)); |
2490 if ( v117 ) | 2491 if ( v117 ) |
2491 { | 2492 { |
2492 a6r /= v117; | 2493 a6r /= v117; |
2493 v260 /= v117; | 2494 v260 /= v117; |
2494 v251 /= v117; | 2495 v251 /= v117; |
2495 } | 2496 } |
2496 if ( v121 != 255 ) | 2497 if ( v121 != 255 ) |
2497 v121 &= 0x7FFFFFFFu; | 2498 v121 &= 0x7FFFFFFFu; |
2498 v122 = _450F55(v251 | ((v260 | ((a6r | (v121 << 8)) << 8)) << 8)); | 2499 v122 = _450F55(v251 | ((v260 | ((a6r | (v121 << 8)) << 8)) << 8)); |
2499 *v201 = v122; | 2500 *v201 = v122; |
2500 switch(probablyBitDepth) | 2501 switch(field20value) |
2501 { | 2502 { |
2502 case 8: v201 = (unsigned __int16 *)((char *)v201 + 1); | 2503 case 8: v201 = (unsigned __int16 *)((char *)v201 + 1); |
2503 break; | 2504 break; |
2504 case 16: ++v201; | 2505 case 16: ++v201; |
2505 break; | 2506 break; |