Index: vd_ffmpeg.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_ffmpeg.c,v retrieving revision 1.91 diff -u -r1.91 vd_ffmpeg.c --- vd_ffmpeg.c 10 May 2003 00:53:14 -0000 1.91 +++ vd_ffmpeg.c 20 May 2003 17:15:56 -0000 @@ -23,9 +23,10 @@ LIBVD_EXTERN(ffmpeg) +#include "../cpudetect.h" +#include "../postproc/swscale.h" #include "../postproc/rgb2rgb.h" - #ifdef USE_LIBAVCODEC_SO #include #else @@ -341,6 +342,13 @@ mpcodecs_draw_slice (sh,src, stride, width, height, 0, y); } +static int get_sws_cpuflags(void) +{ + return (gCpuCaps.hasMMX ? SWS_CPU_CAPS_MMX : 0) | + (gCpuCaps.hasMMX2 ? SWS_CPU_CAPS_MMX2 : 0) | + (gCpuCaps.has3DNow ? SWS_CPU_CAPS_3DNOW : 0 ); +} + static int init_vo(sh_video_t *sh){ vd_ffmpeg_ctx *ctx = sh->context; AVCodecContext *avctx = ctx->avctx; @@ -374,6 +382,8 @@ return -1; ctx->convert=(sh->codec->outfmt[sh->outfmtidx]==IMGFMT_YUY2 && ctx->best_csp!=IMGFMT_YUY2); // yuv422p->yuy2 conversion + if (ctx->convert) + sws_rgb2rgb_init(get_sws_cpuflags()); } return 0; }