comparison postproc/swscale_template.c @ 11000:6e35326c742f

many small typo and grammar fixes Based on Bernard Leak's mail <bernard 4t brenda-arkle.demon.co.uk>
author gabucino
date Sat, 04 Oct 2003 17:29:08 +0000
parents 9deb7e948fa6
children c552fe6acbaa
comparison
equal deleted inserted replaced
10999:6d85ca7c3165 11000:6e35326c742f
948 { 948 {
949 int yalpha1=yalpha^4095; 949 int yalpha1=yalpha^4095;
950 int uvalpha1=uvalpha^4095; 950 int uvalpha1=uvalpha^4095;
951 int i; 951 int i;
952 952
953 #if 0 //isnt used 953 #if 0 //isn't used
954 if(flags&SWS_FULL_CHR_H_INT) 954 if(flags&SWS_FULL_CHR_H_INT)
955 { 955 {
956 switch(dstFormat) 956 switch(dstFormat)
957 { 957 {
958 #ifdef HAVE_MMX 958 #ifdef HAVE_MMX
1167 { 1167 {
1168 #endif // if 0 1168 #endif // if 0
1169 #ifdef HAVE_MMX 1169 #ifdef HAVE_MMX
1170 switch(c->dstFormat) 1170 switch(c->dstFormat)
1171 { 1171 {
1172 //Note 8280 == DSTW_OFFSET but the preprocessor cant handle that there :( 1172 //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
1173 case IMGFMT_BGR32: 1173 case IMGFMT_BGR32:
1174 asm volatile( 1174 asm volatile(
1175 "movl %%esp, "ESP_OFFSET"(%5) \n\t" 1175 "movl %%esp, "ESP_OFFSET"(%5) \n\t"
1176 "movl %4, %%esp \n\t" 1176 "movl %4, %%esp \n\t"
1177 YSCALEYUV2RGB(%%eax, %5) 1177 YSCALEYUV2RGB(%%eax, %5)
2209 RENAME(rgb24ToY)(formatConvBuffer, src, srcW); 2209 RENAME(rgb24ToY)(formatConvBuffer, src, srcW);
2210 src= formatConvBuffer; 2210 src= formatConvBuffer;
2211 } 2211 }
2212 2212
2213 #ifdef HAVE_MMX 2213 #ifdef HAVE_MMX
2214 // use the new MMX scaler if th mmx2 cant be used (its faster than the x86asm one) 2214 // use the new MMX scaler if the mmx2 can't be used (its faster than the x86asm one)
2215 if(!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed)) 2215 if(!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed))
2216 #else 2216 #else
2217 if(!(flags&SWS_FAST_BILINEAR)) 2217 if(!(flags&SWS_FAST_BILINEAR))
2218 #endif 2218 #endif
2219 { 2219 {
2301 2301
2302 :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc>>16), "m" (xInc&0xFFFF) 2302 :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc>>16), "m" (xInc&0xFFFF)
2303 : "%eax", "%ebx", "%ecx", "%edi", "%esi" 2303 : "%eax", "%ebx", "%ecx", "%edi", "%esi"
2304 ); 2304 );
2305 #ifdef HAVE_MMX2 2305 #ifdef HAVE_MMX2
2306 } //if MMX2 cant be used 2306 } //if MMX2 can't be used
2307 #endif 2307 #endif
2308 #else 2308 #else
2309 int i; 2309 int i;
2310 unsigned int xpos=0; 2310 unsigned int xpos=0;
2311 for(i=0;i<dstWidth;i++) 2311 for(i=0;i<dstWidth;i++)
2377 { 2377 {
2378 return; 2378 return;
2379 } 2379 }
2380 2380
2381 #ifdef HAVE_MMX 2381 #ifdef HAVE_MMX
2382 // use the new MMX scaler if th mmx2 cant be used (its faster than the x86asm one) 2382 // use the new MMX scaler if the mmx2 can't be used (its faster than the x86asm one)
2383 if(!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed)) 2383 if(!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed))
2384 #else 2384 #else
2385 if(!(flags&SWS_FAST_BILINEAR)) 2385 if(!(flags&SWS_FAST_BILINEAR))
2386 #endif 2386 #endif
2387 { 2387 {
2480 :: "m" (src1), "m" (dst), "m" (dstWidth), "m" (xInc>>16), "m" (xInc&0xFFFF), 2480 :: "m" (src1), "m" (dst), "m" (dstWidth), "m" (xInc>>16), "m" (xInc&0xFFFF),
2481 "r" (src2) 2481 "r" (src2)
2482 : "%eax", "%ebx", "%ecx", "%edi", "%esi" 2482 : "%eax", "%ebx", "%ecx", "%edi", "%esi"
2483 ); 2483 );
2484 #ifdef HAVE_MMX2 2484 #ifdef HAVE_MMX2
2485 } //if MMX2 cant be used 2485 } //if MMX2 can't be used
2486 #endif 2486 #endif
2487 #else 2487 #else
2488 int i; 2488 int i;
2489 unsigned int xpos=0; 2489 unsigned int xpos=0;
2490 for(i=0;i<dstWidth;i++) 2490 for(i=0;i<dstWidth;i++)
2696 lastInChrBuf++; 2696 lastInChrBuf++;
2697 } 2697 }
2698 //wrap buf index around to stay inside the ring buffer 2698 //wrap buf index around to stay inside the ring buffer
2699 if(lumBufIndex >= vLumBufSize ) lumBufIndex-= vLumBufSize; 2699 if(lumBufIndex >= vLumBufSize ) lumBufIndex-= vLumBufSize;
2700 if(chrBufIndex >= vChrBufSize ) chrBufIndex-= vChrBufSize; 2700 if(chrBufIndex >= vChrBufSize ) chrBufIndex-= vChrBufSize;
2701 break; //we cant output a dstY line so lets try with the next slice 2701 break; //we can't output a dstY line so let's try with the next slice
2702 } 2702 }
2703 2703
2704 #ifdef HAVE_MMX 2704 #ifdef HAVE_MMX
2705 b5Dither= dither8[dstY&1]; 2705 b5Dither= dither8[dstY&1];
2706 g6Dither= dither4[dstY&1]; 2706 g6Dither= dither4[dstY&1];
2770 vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize, 2770 vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
2771 dest, dstW, dstY); 2771 dest, dstW, dstY);
2772 } 2772 }
2773 } 2773 }
2774 } 2774 }
2775 else // hmm looks like we cant use MMX here without overwriting this arrays tail 2775 else // hmm looks like we can't use MMX here without overwriting this array's tail
2776 { 2776 {
2777 int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize; 2777 int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
2778 int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize; 2778 int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
2779 if(isPlanarYUV(dstFormat) || isGray(dstFormat)) //YV12 2779 if(isPlanarYUV(dstFormat) || isGray(dstFormat)) //YV12
2780 { 2780 {