mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
vf_scale: don't pass CPU flags anymore
libav detects them automatically. Also fix a bunch of other VFs, which use the get_sws_cpuflags() function defined by vf_scale.c.
This commit is contained in:
parent
43da1e78c4
commit
35291b8ad9
@ -200,7 +200,7 @@ static int config(struct vf_instance *vf,
|
|||||||
vf->priv->ctx =
|
vf->priv->ctx =
|
||||||
sws_getContext(width, height / 2, PIX_FMT_YUV422P,
|
sws_getContext(width, height / 2, PIX_FMT_YUV422P,
|
||||||
width, height / 2, PIX_FMT_YUYV422,
|
width, height / 2, PIX_FMT_YUYV422,
|
||||||
SWS_POINT | SWS_PRINT_INFO | get_sws_cpuflags(),
|
SWS_POINT | SWS_PRINT_INFO,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
/* FIXME - also support UYVY output? */
|
/* FIXME - also support UYVY output? */
|
||||||
|
@ -75,7 +75,7 @@ static int allocStuff(FilterParam *f, int width, int height){
|
|||||||
swsF.lumH= swsF.lumV= vec;
|
swsF.lumH= swsF.lumV= vec;
|
||||||
swsF.chrH= swsF.chrV= NULL;
|
swsF.chrH= swsF.chrV= NULL;
|
||||||
f->preFilterContext= sws_getContext(
|
f->preFilterContext= sws_getContext(
|
||||||
width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, get_sws_cpuflags()|SWS_POINT, &swsF, NULL, NULL);
|
width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_POINT, &swsF, NULL, NULL);
|
||||||
|
|
||||||
sws_freeVec(vec);
|
sws_freeVec(vec);
|
||||||
vec = sws_getGaussianVec(f->strength, 5.0);
|
vec = sws_getGaussianVec(f->strength, 5.0);
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "mp_msg.h"
|
#include "mp_msg.h"
|
||||||
#include "cpudetect.h"
|
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
|
||||||
#include "img_format.h"
|
#include "img_format.h"
|
||||||
@ -316,13 +315,13 @@ static int config(struct vf_instance *vf,
|
|||||||
sfmt,
|
sfmt,
|
||||||
vf->priv->w, vf->priv->h >> vf->priv->interlaced,
|
vf->priv->w, vf->priv->h >> vf->priv->interlaced,
|
||||||
dfmt,
|
dfmt,
|
||||||
int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
|
int_sws_flags, srcFilter, dstFilter, vf->priv->param);
|
||||||
if(vf->priv->interlaced){
|
if(vf->priv->interlaced){
|
||||||
vf->priv->ctx2=sws_getContext(width, height >> 1,
|
vf->priv->ctx2=sws_getContext(width, height >> 1,
|
||||||
sfmt,
|
sfmt,
|
||||||
vf->priv->w, vf->priv->h >> 1,
|
vf->priv->w, vf->priv->h >> 1,
|
||||||
dfmt,
|
dfmt,
|
||||||
int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
|
int_sws_flags, srcFilter, dstFilter, vf->priv->param);
|
||||||
}
|
}
|
||||||
if(!vf->priv->ctx){
|
if(!vf->priv->ctx){
|
||||||
// error...
|
// error...
|
||||||
@ -658,21 +657,11 @@ int sws_chr_hshift= 0;
|
|||||||
float sws_chr_sharpen= 0.0;
|
float sws_chr_sharpen= 0.0;
|
||||||
float sws_lum_sharpen= 0.0;
|
float sws_lum_sharpen= 0.0;
|
||||||
|
|
||||||
int get_sws_cpuflags(void){
|
|
||||||
return
|
|
||||||
(gCpuCaps.hasMMX ? SWS_CPU_CAPS_MMX : 0)
|
|
||||||
| (gCpuCaps.hasMMX2 ? SWS_CPU_CAPS_MMX2 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam)
|
void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam)
|
||||||
{
|
{
|
||||||
static int firstTime=1;
|
static int firstTime=1;
|
||||||
*flags=0;
|
*flags=0;
|
||||||
|
|
||||||
#if ARCH_X86
|
|
||||||
if(gCpuCaps.hasMMX)
|
|
||||||
__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
|
|
||||||
#endif
|
|
||||||
if(firstTime)
|
if(firstTime)
|
||||||
{
|
{
|
||||||
firstTime=0;
|
firstTime=0;
|
||||||
@ -719,7 +708,7 @@ static struct SwsContext *sws_getContextFromCmdLine2(int srcW, int srcH, int src
|
|||||||
if (srcFormat == IMGFMT_RGB8 || srcFormat == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
|
if (srcFormat == IMGFMT_RGB8 || srcFormat == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
|
||||||
sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
|
sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
|
||||||
|
|
||||||
return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags | extraflags | get_sws_cpuflags(), srcFilterParam, dstFilterParam, NULL);
|
return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags | extraflags, srcFilterParam, dstFilterParam, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat)
|
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat)
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#ifndef MPLAYER_VF_SCALE_H
|
#ifndef MPLAYER_VF_SCALE_H
|
||||||
#define MPLAYER_VF_SCALE_H
|
#define MPLAYER_VF_SCALE_H
|
||||||
|
|
||||||
int get_sws_cpuflags(void);
|
|
||||||
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
|
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
|
||||||
struct SwsContext *sws_getContextFromCmdLine_hq(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
|
struct SwsContext *sws_getContextFromCmdLine_hq(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ static int allocStuff(FilterParam *f, int width, int height){
|
|||||||
swsF.lumH= swsF.lumV= vec;
|
swsF.lumH= swsF.lumV= vec;
|
||||||
swsF.chrH= swsF.chrV= NULL;
|
swsF.chrH= swsF.chrV= NULL;
|
||||||
f->filterContext= sws_getContext(
|
f->filterContext= sws_getContext(
|
||||||
width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_BICUBIC | get_sws_cpuflags(), &swsF, NULL, NULL);
|
width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_BICUBIC, &swsF, NULL, NULL);
|
||||||
|
|
||||||
sws_freeVec(vec);
|
sws_freeVec(vec);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user