summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-21 22:57:07 +0100
committerwm4 <wm4@nowhere>2013-02-23 00:07:11 +0100
commitbfaebd26eefc9ae72cfe78377728a445f6ff3c26 (patch)
treede85be42c4ba577c2dd5d6d575a394362a2e9d43
parent09fa666bfc0b533f9b2dc59f738c5cbe5c2b72a8 (diff)
downloadmpv-bfaebd26eefc9ae72cfe78377728a445f6ff3c26.tar.bz2
mpv-bfaebd26eefc9ae72cfe78377728a445f6ff3c26.tar.xz
vf_scale: remove video dimension presets ("presize" suboption)
This wasn't really useful, and the option preset mechanism is awfully complex.
-rw-r--r--DOCS/man/en/vf.rst12
-rw-r--r--video/filter/vf_scale.c41
2 files changed, 1 insertions, 52 deletions
diff --git a/DOCS/man/en/vf.rst b/DOCS/man/en/vf.rst
index e993f8ec59..b522b77b4d 100644
--- a/DOCS/man/en/vf.rst
+++ b/DOCS/man/en/vf.rst
@@ -97,7 +97,7 @@ rotate[=<0-7>]
:2: Rotate by 90 degrees counterclockwise.
:3: Rotate by 90 degrees counterclockwise and flip.
-scale[=w:h[:interlaced[:chr_drop[:par[:par2[:presize[:noup[:arnd]]]]]]]]
+scale[=w:h[:interlaced[:chr_drop[:par[:par2[:noup[:arnd]]]]]]]
Scales the image with the software scaler (slow) and performs a YUV<->RGB
colorspace conversion (see also ``--sws``).
@@ -142,16 +142,6 @@ scale[=w:h[:interlaced[:chr_drop[:par[:par2[:presize[:noup[:arnd]]]]]]]]
--sws=9 (lanczos): filter length (1-10)
- <presize>
- Scale to preset sizes.
-
- :qntsc: 352x240 (NTSC quarter screen)
- :qpal: 352x288 (PAL quarter screen)
- :ntsc: 720x480 (standard NTSC)
- :pal: 720x576 (standard PAL)
- :sntsc: 640x480 (square pixel NTSC)
- :spal: 768x576 (square pixel PAL)
-
<noup>
Disallow upscaling past the original dimensions.
diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c
index 6999df6344..08008eb829 100644
--- a/video/filter/vf_scale.c
+++ b/video/filter/vf_scale.c
@@ -520,44 +520,6 @@ static int vf_open(vf_instance_t *vf, char *args){
return 1;
}
-/// An example of presets usage
-static const struct size_preset {
- char* name;
- int w, h;
-} vf_size_presets_defs[] = {
- // TODO add more 'standard' resolutions
- { "qntsc", 352, 240 },
- { "qpal", 352, 288 },
- { "ntsc", 720, 480 },
- { "pal", 720, 576 },
- { "sntsc", 640, 480 },
- { "spal", 768, 576 },
- { NULL, 0, 0}
-};
-
-#define ST_OFF(f) M_ST_OFF(struct size_preset,f)
-static const m_option_t vf_size_preset_fields[] = {
- {"w", ST_OFF(w), CONF_TYPE_INT, M_OPT_MIN,1 ,0, NULL},
- {"h", ST_OFF(h), CONF_TYPE_INT, M_OPT_MIN,1 ,0, NULL},
- { NULL, NULL, 0, 0, 0, 0, NULL }
-};
-
-static const m_struct_t vf_size_preset = {
- "scale_size_preset",
- sizeof(struct size_preset),
- NULL,
- vf_size_preset_fields
-};
-
-static const m_struct_t vf_opts;
-static const m_obj_presets_t size_preset = {
- &vf_size_preset, // Input struct desc
- &vf_opts, // Output struct desc
- vf_size_presets_defs, // The list of presets
- ST_OFF(name) // At wich offset is the name field in the preset struct
-};
-
-/// Now the options
#undef ST_OFF
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static const m_option_t vf_opts_fields[] = {
@@ -567,9 +529,6 @@ static const m_option_t vf_opts_fields[] = {
{"chr-drop", ST_OFF(v_chr_drop), CONF_TYPE_INT, M_OPT_RANGE, 0, 3, NULL},
{"param" , ST_OFF(param[0]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL},
{"param2", ST_OFF(param[1]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL},
- // Note that here the 2 field is NULL (ie 0)
- // As we want this option to act on the option struct itself
- {"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, (void *)&size_preset},
{"noup", ST_OFF(noup), CONF_TYPE_INT, M_OPT_RANGE, 0, 2, NULL},
{"arnd", ST_OFF(accurate_rnd), CONF_TYPE_FLAG, 0, 0, 1, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }