changeset 6542:7af3fcd76d2d

support dropping some chroma src lines for a bit extra speed
author michael
date Mon, 24 Jun 2002 01:05:41 +0000
parents 6507469651f4
children 70a9c9f695a2
files libmpcodecs/vf_scale.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_scale.c	Mon Jun 24 00:56:27 2002 +0000
+++ b/libmpcodecs/vf_scale.c	Mon Jun 24 01:05:41 2002 +0000
@@ -15,6 +15,7 @@
 
 struct vf_priv_s {
     int w,h;
+    int v_chr_drop;
     unsigned int fmt;
     SwsContext *ctx;
 };
@@ -58,6 +59,8 @@
 	unsigned int flags, unsigned int outfmt){
     unsigned int best=find_best_out(vf);
     int vo_flags;
+    int int_sws_flags=0;
+    SwsFilter *srcFilter, *dstFilter;
     
     if(!best){
 	mp_msg(MSGT_VFILTER,MSGL_WARN,"SwScale: no supported outfmt found :(\n");
@@ -107,10 +110,13 @@
     if(vf->priv->ctx) freeSwsContext(vf->priv->ctx);
     
     // new swscaler:
-    vf->priv->ctx=getSwsContextFromCmdLine(width,height,
+    swsGetFlagsAndFilterFromCmdLine(&int_sws_flags, &srcFilter, &dstFilter);
+    int_sws_flags|= vf->priv->v_chr_drop << SWS_SRC_V_CHR_DROP_SHIFT;
+    vf->priv->ctx=getSwsContext(width,height,
 	    (outfmt==IMGFMT_I420 || outfmt==IMGFMT_IYUV)?IMGFMT_YV12:outfmt,
 		  vf->priv->w,vf->priv->h,
-	    (best==IMGFMT_I420 || best==IMGFMT_IYUV)?IMGFMT_YV12:best);
+	    (best==IMGFMT_I420 || best==IMGFMT_IYUV)?IMGFMT_YV12:best,
+	    int_sws_flags, srcFilter, dstFilter);
     if(!vf->priv->ctx){
 	// error...
 	mp_msg(MSGT_VFILTER,MSGL_WARN,"Couldn't init SwScaler for this setup\n");
@@ -188,9 +194,11 @@
     vf->priv->ctx=NULL;
     vf->priv->w=
     vf->priv->h=-1;
-    if(args) sscanf(args, "%d:%d",
+    vf->priv->v_chr_drop=0;
+    if(args) sscanf(args, "%d:%d:%d",
     &vf->priv->w,
-    &vf->priv->h);
+    &vf->priv->h,
+    &vf->priv->v_chr_drop);
     mp_msg(MSGT_VFILTER,MSGL_V,"SwScale params: %d x %d (-1=no scaling)\n",
     vf->priv->w,
     vf->priv->h);