comparison mm7_2.cpp @ 1145:30d02f00ae29

sub_451007_scale_image_bicubic cleanup - merged field_0.field_C 32 and 16 cases
author Grumpy7
date Sun, 02 Jun 2013 01:32:18 +0200
parents f544cd6f7168
children b4ade2580ae3
comparison
equal deleted inserted replaced
1144:f544cd6f7168 1145:30d02f00ae29
2173 float v18; // ST38_4@12 2173 float v18; // ST38_4@12
2174 unsigned int v19; // esi@12 2174 unsigned int v19; // esi@12
2175 int v21; // eax@18 2175 int v21; // eax@18
2176 unsigned int v22; // ecx@25 2176 unsigned int v22; // ecx@25
2177 unsigned int v23; // eax@29 2177 unsigned int v23; // eax@29
2178 int v50; // ecx@88
2179 float v53; // ST34_4@90
2180 float v54; // ST30_4@90
2181 unsigned int v55; // esi@90
2182 int v57; // eax@96
2183 unsigned int v58; // ecx@103
2184 unsigned int v59; // eax@107
2185 int v112; // ecx@216 2178 int v112; // ecx@216
2186 float v115; // ST34_4@218 2179 float v115; // ST34_4@218
2187 float v116; // ST30_4@218 2180 float v116; // ST30_4@218
2188 unsigned int v117; // esi@218 2181 unsigned int v117; // esi@218
2189 signed int v118; // eax@220 2182 signed int v118; // eax@220
2190 int v119; // eax@221 2183 int v119; // eax@221
2191 int v120; // eax@223 2184 int v120; // eax@223
2192 unsigned int v121; // ecx@231 2185 unsigned int v121; // ecx@231
2193 char v122; // al@235 2186 char v122; // al@235
2194 unsigned int v124; // [sp+Ch] [bp-7Ch]@12 2187 unsigned int v124; // [sp+Ch] [bp-7Ch]@12
2195 unsigned int v127; // [sp+Ch] [bp-7Ch]@90
2196 unsigned int v132; // [sp+Ch] [bp-7Ch]@218 2188 unsigned int v132; // [sp+Ch] [bp-7Ch]@218
2197 unsigned int v133; // [sp+14h] [bp-74h]@12 2189 unsigned int v133; // [sp+14h] [bp-74h]@12
2198 unsigned int v136; // [sp+14h] [bp-74h]@90
2199 unsigned int v141; // [sp+14h] [bp-74h]@218 2190 unsigned int v141; // [sp+14h] [bp-74h]@218
2200 unsigned int v142; // [sp+1Ch] [bp-6Ch]@12 2191 unsigned int v142; // [sp+1Ch] [bp-6Ch]@12
2201 unsigned int v145; // [sp+1Ch] [bp-6Ch]@90
2202 unsigned int v150; // [sp+1Ch] [bp-6Ch]@218 2192 unsigned int v150; // [sp+1Ch] [bp-6Ch]@218
2203 unsigned int v151; // [sp+24h] [bp-64h]@12 2193 unsigned int v151; // [sp+24h] [bp-64h]@12
2204 unsigned int v154; // [sp+24h] [bp-64h]@90
2205 unsigned int v159; // [sp+24h] [bp-64h]@218 2194 unsigned int v159; // [sp+24h] [bp-64h]@218
2206 int v160; // [sp+3Ch] [bp-4Ch]@13 2195 int v160; // [sp+3Ch] [bp-4Ch]@13
2207 int v161; // [sp+40h] [bp-48h]@15 2196 int v161; // [sp+40h] [bp-48h]@15
2208 int v164; // [sp+44h] [bp-44h]@93
2209 int v169; // [sp+44h] [bp-44h]@219 2197 int v169; // [sp+44h] [bp-44h]@219
2210 int v172; // [sp+48h] [bp-40h]@91
2211 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13 2198 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13
2212 int *v176; // [sp+50h] [bp-38h]@15 2199 int *v176; // [sp+50h] [bp-38h]@15
2213 int *v179; // [sp+50h] [bp-38h]@93
2214 char *v184; // [sp+50h] [bp-38h]@219 2200 char *v184; // [sp+50h] [bp-38h]@219
2215 unsigned __int16 *v187; // [sp+54h] [bp-34h]@91
2216 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7 2201 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7
2217 unsigned __int16 *v196; // [sp+5Ch] [bp-2Ch]@85
2218 unsigned __int16 *v201; // [sp+5Ch] [bp-2Ch]@213 2202 unsigned __int16 *v201; // [sp+5Ch] [bp-2Ch]@213
2219 signed int v231; // [sp+78h] [bp-10h]@7 2203 signed int v231; // [sp+78h] [bp-10h]@7
2220 signed int v234; // [sp+78h] [bp-10h]@85
2221 signed int v239; // [sp+78h] [bp-10h]@213 2204 signed int v239; // [sp+78h] [bp-10h]@213
2222 __int64 v240; // [sp+7Ch] [bp-Ch]@12 2205 __int64 v240; // [sp+7Ch] [bp-Ch]@12
2223 __int64 v243; // [sp+7Ch] [bp-Ch]@90
2224 unsigned int v248; // [sp+7Ch] [bp-Ch]@218 2206 unsigned int v248; // [sp+7Ch] [bp-Ch]@218
2225 unsigned int v251; // [sp+80h] [bp-8h]@218 2207 unsigned int v251; // [sp+80h] [bp-8h]@218
2226 unsigned int v252; // [sp+84h] [bp-4h]@12 2208 unsigned int v252; // [sp+84h] [bp-4h]@12
2227 unsigned int v255; // [sp+84h] [bp-4h]@90
2228 unsigned int v260; // [sp+84h] [bp-4h]@218 2209 unsigned int v260; // [sp+84h] [bp-4h]@218
2229 float a6s; // [sp+A0h] [bp+18h]@12 2210 float a6s; // [sp+A0h] [bp+18h]@12
2230 float a6t; // [sp+A0h] [bp+18h]@12 2211 float a6t; // [sp+A0h] [bp+18h]@12
2231 unsigned int a6b; // [sp+A0h] [bp+18h]@12 2212 unsigned int a6b; // [sp+A0h] [bp+18h]@12
2232 float a6y; // [sp+A0h] [bp+18h]@90
2233 float a6z; // [sp+A0h] [bp+18h]@90
2234 unsigned int a6h; // [sp+A0h] [bp+18h]@90
2235 float a6bi; // [sp+A0h] [bp+18h]@218 2213 float a6bi; // [sp+A0h] [bp+18h]@218
2236 float a6bj; // [sp+A0h] [bp+18h]@218 2214 float a6bj; // [sp+A0h] [bp+18h]@218
2237 unsigned int a6r; // [sp+A0h] [bp+18h]@218 2215 unsigned int a6r; // [sp+A0h] [bp+18h]@218
2238 int dstdiffmult; 2216 int dstdiffmult;
2239 2217
2240 int field0value = this->field_0.field_C; 2218 int field0value = 32;
2241 int field20value = this->field_20.field_C; 2219 int field20value = this->field_20.field_C;
2242 switch(field20value) 2220 switch(field20value)
2243 { 2221 {
2244 case 8: dstdiffmult = dstPitch - dstWidth; 2222 case 8: dstdiffmult = dstPitch - dstWidth;
2245 break; 2223 break;
2249 break; 2227 break;
2250 default: 2228 default:
2251 return field20value; 2229 return field20value;
2252 } 2230 }
2253 2231
2254
2255
2256 result = this->field_0.field_C; 2232 result = this->field_0.field_C;
2257 if ( result == 32 ) 2233 if ( result == 32 || result == 16)
2258 { 2234 {
2259 result = (int)pDst; 2235 result = (int)pDst;
2260 v193 = pDst; 2236 v193 = pDst;
2261 v231 = 0; 2237 v231 = 0;
2262 if ( dstHeight <= 0 ) 2238 if ( dstHeight <= 0 )
2316 ++v14; 2292 ++v14;
2317 if ( v14 >= dstWidth ) 2293 if ( v14 >= dstWidth )
2318 goto LABEL_30; 2294 goto LABEL_30;
2319 } 2295 }
2320 v160 = v124 - v133; 2296 v160 = v124 - v133;
2321 v175 = &pSrc[2 * (v151 + srcPitch * v133)]; 2297 if(field0value == 32)
2298 v175 = &pSrc[2 * (v151 + srcPitch * v133)];
2299 else
2300 v175 = &pSrc[v151 + srcPitch * v133];
2301
2322 while ( v151 >= v142 ) 2302 while ( v151 >= v142 )
2323 { 2303 {
2324 LABEL_24: 2304 LABEL_24:
2325 v175 += 2 * srcPitch; 2305 if(field0value == 32)
2306 v175 += 2 * srcPitch;
2307 else
2308 v175 += srcPitch;
2326 --v160; 2309 --v160;
2327 if ( !v160 ) 2310 if ( !v160 )
2328 goto LABEL_25; 2311 goto LABEL_25;
2329 } 2312 }
2330 v176 = (int *)v175; 2313 v176 = (int *)v175;
2331 v161 = v142 - v151; 2314 v161 = v142 - v151;
2332 while ( 1 ) 2315 while ( 1 )
2333 { 2316 {
2334 v21 = _450FB1(*v176); 2317 if(field0value == 32)
2318 v21 = _450FB1(*v176);
2319 else
2320 v21 = _450FB1(*(_WORD *)v176);
2335 break; 2321 break;
2336 LABEL_23: 2322 LABEL_23:
2337 ++v176; 2323 if(field0value == 32)
2324 ++v176;
2325 else
2326 v176 = (int *)((char *)v176 + 2);
2338 --v161; 2327 --v161;
2339 if ( !v161 ) 2328 if ( !v161 )
2340 goto LABEL_24; 2329 goto LABEL_24;
2341 } 2330 }
2342 LODWORD(v240) = ((unsigned int)v21 >> 24) + v240; 2331 LODWORD(v240) = ((unsigned int)v21 >> 24) + v240;
2343 a6b += BYTE2(v21); 2332 a6b += BYTE2(v21);
2344 v252 += BYTE1(v21); 2333 v252 += BYTE1(v21);
2345 HIDWORD(v240) += (unsigned __int8)v21; 2334 HIDWORD(v240) += (unsigned __int8)v21;
2346 goto LABEL_23; 2335 goto LABEL_23;
2347 }
2348
2349 else if ( result == 16 )
2350 {
2351 result = (int)pDst;
2352 v196 = pDst;
2353 v234 = 0;
2354 if ( dstHeight <= 0 )
2355 return result;
2356 while ( 1 )
2357 {
2358 v50 = 0;
2359 if ( dstWidth > 0 )
2360 break;
2361 LABEL_108:
2362 v196 = (unsigned __int16 *)((char *)v196 + dstdiffmult);
2363 ++v234;
2364 result = v234;
2365 if ( v234 >= dstHeight )
2366 return result;
2367 }
2368 while ( 1 )
2369 {
2370 a6y = (double)v50 / (double)dstWidth * (double)srcWidth;
2371 v127 = bankersRounding(a6y);
2372 a6z = (double)(v50 + 1) / (double)dstWidth * (double)srcWidth;
2373 v136 = bankersRounding(a6z);
2374 v53 = (double)v234 / (double)dstHeight * (double)srcHeight;
2375 v145 = bankersRounding(v53);
2376 v54 = (double)(v234 + 1) / (double)dstHeight * (double)srcHeight;
2377 v154 = bankersRounding(v54);
2378 v55 = (v154 - v145) * (v136 - v127);
2379 v255 = 0;
2380 a6h = 0;
2381 v243 = 0i64;
2382 if ( v145 < v154 )
2383 break;
2384 LABEL_103:
2385 v58 = (unsigned int)v243 / ((v154 - v145) * (v136 - v127));
2386 if ( v55 )
2387 {
2388 a6h /= v55;
2389 v255 /= v55;
2390 HIDWORD(v243) /= v55;
2391 }
2392 if ( v58 != 255 )
2393 v58 &= 0x7FFFFFFFu;
2394 v59 = _450F55(HIDWORD(v243) | ((v255 | ((a6h | (v58 << 8)) << 8)) << 8));
2395 *(_DWORD *)v196 = v59;
2396 switch(field20value)
2397 {
2398 case 8: v196 = (unsigned __int16 *)((char *)v196 + 1);
2399 break;
2400 case 16: ++v196;
2401 break;
2402 case 32: v196 += 2;
2403 break;
2404 default:
2405 assert(false);
2406 return result;
2407 }
2408 ++v50;
2409 if ( v50 >= dstWidth )
2410 goto LABEL_108;
2411 }
2412 v172 = v154 - v145;
2413 v187 = &pSrc[v127 + srcPitch * v145];
2414 while ( v127 >= v136 )
2415 {
2416 LABEL_102:
2417 v187 += srcPitch;
2418 --v172;
2419 if ( !v172 )
2420 goto LABEL_103;
2421 }
2422 v179 = (int *)v187;
2423 v164 = v136 - v127;
2424 while ( 1 )
2425 {
2426 v57 = _450FB1(*(_WORD *)v179);
2427 break;
2428 LABEL_101:
2429 v179 = (int *)((char *)v179 + 2);
2430 --v164;
2431 if ( !v164 )
2432 goto LABEL_102;
2433 }
2434 LODWORD(v243) = ((unsigned int)v57 >> 24) + v243;
2435 a6h += BYTE2(v57);
2436 v255 += BYTE1(v57);
2437 HIDWORD(v243) += (unsigned __int8)v57;
2438 goto LABEL_101;
2439 } 2336 }
2440 2337
2441 else if ( result == 8 ) 2338 else if ( result == 8 )
2442 { 2339 {
2443 result = (int)pDst; 2340 result = (int)pDst;