diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-03-26 01:55:32 +0100 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2015-04-04 15:36:14 +0200 |
commit | 068ff812e4f958a83098e9ed27b2b96ffcab1eb2 (patch) | |
tree | af06b926adf3981b35055f378b18546681506dad /video/out/filter_kernels.h | |
parent | 586dc5574f519a336fda0e8c1d3c94e0c1df38b2 (diff) | |
download | mpv-068ff812e4f958a83098e9ed27b2b96ffcab1eb2.tar.bz2 mpv-068ff812e4f958a83098e9ed27b2b96ffcab1eb2.tar.xz |
vo_opengl: refactor scaler configuration
This merges all of the scaler-related options into a single
configuration struct, and also cleans up the way they're passed through
the code. (For example, the scaler index is no longer threaded through
pass_sample, just the scaler configuration itself, and there's no longer
duplication of the params etc.)
In addition, this commit makes scale-down more principled, and turns it
into a scaler in its own right - so there's no longer an ugly separation
between scale and scale-down in the code.
Finally, the radius stuff has been made more proper - filters always
have a radius now (there's no more radius -1), and get a new .resizable
attribute instead for when it's tunable.
User-visible changes:
1. scale-down has been renamed dscale and now has its own set of config
options (dscale-param1, dscale-radius) etc., instead of reusing
scale-param1 (which was arguably a bug).
2. The default radius is no longer fixed at 3, but instead uses that
filter's preferred radius by default. (Scalers with a default radius
other than 3 include sinc, gaussian, box and triangle)
3. scale-radius etc. now goes down to 0.5, rather than 1.0. 0.5 is the
smallest radius that theoretically makes sense, and indeed it's used
by at least one filter (nearest).
Apart from that, it should just be internal changes only.
Note that this sets up for the refactor discussed in #1720, which would
be to merge scaler and window configurations (include parameters etc.)
into a single, simplified string. In the code, this would now basically
just mean getting rid of all the OPT_FLOATRANGE etc. lines related to
scalers and replacing them by a single function that parses a string and
updates the struct scaler_config as appropriate.
Diffstat (limited to 'video/out/filter_kernels.h')
-rw-r--r-- | video/out/filter_kernels.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/filter_kernels.h b/video/out/filter_kernels.h index 99776d2f07..8d97cf6786 100644 --- a/video/out/filter_kernels.h +++ b/video/out/filter_kernels.h @@ -23,8 +23,9 @@ struct filter_window { const char *name; - double radius; // A negative value will use user specified radius instead. + double radius; // Preferred radius, should only be changed if resizable double (*weight)(struct filter_window *k, double x); + bool resizable; // Filter supports any given radius double params[2]; // User-defined custom filter parameters. Not used by // all filters double blur; // Blur coefficient (sharpens or widens the filter) |