1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

swscale: use emms_c().

This commit is contained in:
Ronald S. Bultje
2011-05-24 13:04:46 -04:00
parent e973557211
commit c4fd283a46
2 changed files with 3 additions and 5 deletions

View File

@@ -193,8 +193,7 @@ static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSi
const int64_t fone= 1LL<<54; const int64_t fone= 1LL<<54;
int ret= -1; int ret= -1;
if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) emms_c(); //FIXME this should not be required but it IS (even for non-MMX versions)
__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
// NOTE: the +1 is for the MMX scaler which reads over the end // NOTE: the +1 is for the MMX scaler which reads over the end
FF_ALLOC_OR_GOTO(NULL, *filterPos, (dstW+1)*sizeof(int16_t), fail); FF_ALLOC_OR_GOTO(NULL, *filterPos, (dstW+1)*sizeof(int16_t), fail);
@@ -757,8 +756,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
cpu_flags = av_get_cpu_flags(); cpu_flags = av_get_cpu_flags();
flags = c->flags; flags = c->flags;
if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) emms_c();
__asm__ volatile("emms\n\t"::: "memory");
if (!rgb15to16) sws_rgb2rgb_init(); if (!rgb15to16) sws_rgb2rgb_init();
unscaled = (srcW == dstW && srcH == dstH); unscaled = (srcW == dstW && srcH == dstH);

View File

@@ -2494,7 +2494,7 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[],
fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255); fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255);
if (COMPILE_TEMPLATE_MMX2) __asm__ volatile("sfence":::"memory"); if (COMPILE_TEMPLATE_MMX2) __asm__ volatile("sfence":::"memory");
__asm__ volatile("emms" :::"memory"); emms_c();
/* store changed local vars back in the context */ /* store changed local vars back in the context */
c->dstY= dstY; c->dstY= dstY;