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/gl_video.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/gl_video.h')
-rw-r--r-- | video/out/gl_video.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/video/out/gl_video.h b/video/out/gl_video.h index f3267d69c4..d28473d58f 100644 --- a/video/out/gl_video.h +++ b/video/out/gl_video.h @@ -28,18 +28,25 @@ struct lut3d { int size[3]; }; +struct scaler_fun { + char *name; + float params[2]; + float blur; +}; + +struct scaler_config { + struct scaler_fun kernel; + struct scaler_fun window; + float radius; + float antiring; +}; + struct gl_video_opts { - char *scalers[3]; - char *dscaler; + struct scaler_config scaler[4]; float gamma; int gamma_auto; int target_prim; int target_trc; - float scaler_params[3][2]; - float scaler_blur[3]; - float scaler_radius[3]; - float scaler_antiring[3]; - char *scaler_window[3]; int linear_scaling; int fancy_downscaling; int sigmoid_upscaling; |