summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_scale.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-15 15:03:40 +0100
committerwm4 <wm4@nowhere>2012-11-16 21:21:14 +0100
commit53ee9aa6aedbd809ea98eb66078b13008d6f26ed (patch)
tree337eb5accfe21be17b247944835b9b85acfc487d /video/filter/vf_scale.c
parent52fe0a4fe2bec8a3b4e7a8b5b6fa667504bced12 (diff)
downloadmpv-53ee9aa6aedbd809ea98eb66078b13008d6f26ed.tar.bz2
mpv-53ee9aa6aedbd809ea98eb66078b13008d6f26ed.tar.xz
options, vo_x11: remove -zoom option, make it default
The -zoom option enabled scaling with vo_x11. Remove the -zoom option, and make its behavior default. Since vo_x11 has to use libswscale for colorspace conversion anyway, which doesn't do actual extra scaling when vo_x11 is run in windowed mode, there should be no speed difference with this change. The code removed from vf_scale attempted to scale the video to d_width/ d_height, which matters for anamorphic video and the --xy option only. vo_x11 can handle these natively. The only case for which the removed vf_scale code could matter is encoding with vo_lavc, but since that didn't set VOFLAG_SWSCALE, nothing actually changes.
Diffstat (limited to 'video/filter/vf_scale.c')
-rw-r--r--video/filter/vf_scale.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c
index f5a348559f..2ff9d82e8b 100644
--- a/video/filter/vf_scale.c
+++ b/video/filter/vf_scale.c
@@ -35,7 +35,6 @@
#include "video/sws_utils.h"
#include "video/csputils.h"
-// VOFLAG_SWSCALE
#include "video/out/vo.h"
#include "core/m_option.h"
@@ -191,7 +190,6 @@ static int config(struct vf_instance *vf,
unsigned int flags, unsigned int outfmt){
struct MPOpts *opts = vf->opts;
unsigned int best=find_best_out(vf, outfmt);
- int vo_flags;
int int_sws_flags=0;
int round_w=0, round_h=0;
int i;
@@ -208,33 +206,11 @@ static int config(struct vf_instance *vf,
if (outfmt == IMGFMT_RGB8 || outfmt == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
dfmt = imgfmt2pixfmt(best);
- vo_flags=vf->next->query_format(vf->next,best);
+ vf->next->query_format(vf->next,best);
vf->priv->w = vf->priv->cfg_w;
vf->priv->h = vf->priv->cfg_h;
- // scaling to dwidth*d_height, if all these TRUE:
- // - option -zoom
- // - no other sw/hw up/down scaling avail.
- // - we're after postproc
- // - user didn't set w:h
- if(!(vo_flags&VFCAP_POSTPROC) && (flags&VOFLAG_SWSCALE) &&
- vf->priv->w<0 && vf->priv->h<0){ // -zoom
- int x=(vo_flags&VFCAP_SWSCALE) ? 0 : 1;
- if(d_width<width || d_height<height){
- // downscale!
- if(vo_flags&VFCAP_HWSCALE_DOWN) x=0;
- } else {
- // upscale:
- if(vo_flags&VFCAP_HWSCALE_UP) x=0;
- }
- if(x){
- // user wants sw scaling! (-zoom)
- vf->priv->w=d_width;
- vf->priv->h=d_height;
- }
- }
-
if (vf->priv->w <= -8) {
vf->priv->w += 8;
round_w = 1;
@@ -615,8 +591,6 @@ static int query_format(struct vf_instance *vf, unsigned int fmt){
flags=vf_next_query_format(vf,best);
if(!(flags&(VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW))) return 0; // huh?
if(fmt!=best) flags&=~VFCAP_CSP_SUPPORTED_BY_HW;
- // do not allow scaling, if we are before the PP fliter!
- if(!(flags&VFCAP_POSTPROC)) flags|=VFCAP_SWSCALE;
return flags;
}
return 0; // nomatching in-fmt