if(firstTime) { flags= SWS_PRINT_INFO; firstTime=0; }  switch(dstbpp) { case 8 : dstFormat= IMGFMT_Y8;		break; case 12: dstFormat= IMGFMT_YV12;	break; case 15: dstFormat= IMGFMT_BGR15;	break; case 16: dstFormat= IMGFMT_BGR16;	break; case 24: dstFormat= IMGFMT_BGR24;	break; case 32: dstFormat= IMGFMT_BGR32;	break; default: return; }  switch(sws_flags) { case 0: flags|= SWS_FAST_BILINEAR; break; case 1: flags|= SWS_BILINEAR; break; case 2: flags|= SWS_BICUBIC; break; case 3: flags|= SWS_X; break; default:flags|= SWS_BILINEAR; break; }  if(!context) context=getSwsContext(srcW, srcH, IMGFMT_YV12, dstW, dstH, dstFormat, flags, NULL, NULL);   swScale(context, src, srcStride, srcSliceY, srcSliceH, dst, dstStride3);
void SwScale_YV12slice(unsigned char* srcptr[],int stride[], int srcSliceY ,			     int srcSliceH, uint8_t* dstptr[], int dststride, int dstbpp,			     int srcW, int srcH, int dstW, int dstH){#ifdef RUNTIME_CPUDETECT#ifdef CAN_COMPILE_X86_ASM	// ordered per speed fasterst first	if(gCpuCaps.hasMMX2)		SwScale_YV12slice_MMX2(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);	else if(gCpuCaps.has3DNow)		SwScale_YV12slice_3DNow(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);	else if(gCpuCaps.hasMMX)		SwScale_YV12slice_MMX(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);	else		SwScale_YV12slice_C(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);#else		SwScale_YV12slice_C(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);#endif#else //RUNTIME_CPUDETECT#ifdef HAVE_MMX2		SwScale_YV12slice_MMX2(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);#elif defined (HAVE_3DNOW)		SwScale_YV12slice_3DNow(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);#elif defined (HAVE_MMX)		SwScale_YV12slice_MMX(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);#else		SwScale_YV12slice_C(srcptr, stride, srcSliceY, srcSliceH, dstptr, dststride, dstbpp, srcW, srcH, dstW, dstH);#endif#endif //!RUNTIME_CPUDETECT}