Commit Graph

238 Commits

Author SHA1 Message Date
wm4 cf210c4ffc vo_opengl: change default FBO format
Reduces (but likely does not remove) the danger of rounding intermediate
values down to 8 bit. This is important for cscale, or any other
processing that might store raw YUV values in framebuffers.

Fixes #1918.
2015-05-05 14:41:33 +02:00
Niklas Haas 1153f13bee vo_opengl: gl_lcms: replace icc-cache by icc-cache-dir
This now stores caches for multiple ICC profiles, potentially all the
user has ever used. The big use case for this is for users with multiple
monitors. The old logic would mandate recomputing the LUT and discarding
the cache whenever dragging mpv from one screen to another.

This also avoids having to save and check the ICC profile itself, since
the file name already uniquely determines it.
2015-05-01 21:52:08 +02:00
Marcin Kurczewski 9cabef3974 vo_drm: add missing documentation 2015-04-16 21:43:01 +02:00
wm4 d704d61c61 vo_opengl: change dwmflush option values
Use a choice instead of an integer. This is incompatible, but I'm not
adding any compatibility since this option was added recently.
2015-04-14 14:29:05 +02:00
wm4 2b679020f7 vo_opengl: unify blend-subtitles-res and blend-subtitles 2015-04-11 19:22:10 +02:00
Niklas Haas 6f46bafbd0
vo_opengl: add blend-subtitles-res
This can be used to draw the subtitles at the video's native res, which
can make them look more natural and increases performance.
2015-04-10 22:22:55 +02:00
Avi Halachmi (:avih) 843bc822a8 opengl: win32 - add option 'dwmflush' to sync in DWM
This could help in cases where the DWM (Windows desktop compositor) adds another
layer of bufferring and therefore the SwapBuffers timing could get messed up.

Signed-off-by: wm4 <wm4@nowhere>
2015-04-09 20:36:35 +02:00
Niklas Haas 51bb5e8194 vo_opengl: make csp options consistent with vf_format 2015-04-04 15:47:23 +02:00
Niklas Haas bfbe1342f7
csputils: add some missing colorspaces
With target-prim and target-trc it makes sense to include some common
colorspaces that aren't strictly speaking used for video.
2015-04-04 15:47:14 +02:00
Niklas Haas 8876572e2c
vo_opengl: make jinc presets resizable
No real reason this is disabled with the new configuration API.
2015-04-04 15:36:26 +02:00
Niklas Haas 34caa8b01c vo_opengl: add scale-wparam option
This lets us tune the window parameter
2015-04-04 15:36:14 +02:00
Niklas Haas 068ff812e4 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.
2015-04-04 15:36:14 +02:00
Niklas Haas 586dc5574f vo_opengl: separate kernel and window
This makes the core much more elegant, reusable, reconfigurable and also
allows us to more easily add aliases for specific configurations.

Furthermore, this lets us apply a generic blur factor / window function
to arbitrary filters, so we can finally "mix and match" in order to
fine-tune windowing functions.

A few notes are in order:

1. The current system for configuring scalers is ugly and rapidly
   getting unwieldy. I modified the man page to make it a bit more
   bearable, but long-term we have to do something about it; especially
   since..

2. There's currently no way to affect the blur factor or parameters of
   the window functions themselves. For example, I can't actually
   fine-tune the kaiser window's param1, since there's simply no way to
   do so in the current API - even though filter_kernels.c supports it
   just fine!

3. This removes some lesser used filters (especially those which are
   purely window functions to begin with). If anybody asks, you can get
   eg. the old behavior of scale=hanning by using
   scale=box:scale-window=hanning:scale-radius=1 (and yes, the result is
   just as terrible as that sounds - which is why nobody should have
   been using them in the first place).

4. This changes the semantics of the "triangle" scaler slightly - it now
   has an arbitrary radius. This can possibly produce weird results for
   people who were previously using scale-down=triangle, especially if
   in combination with scale-radius (for the usual upscaling). The
   correct fix for this is to use scale-down=bilinear_slow instead,
   which is an alias for triangle at radius 1.

In regards to the last point, in future I want to make it so that
filters have a filter-specific "preferred radius" (for the ones that
are arbitrarily tunable), once the configuration system for filters has
been redesigned (in particular in a way that will let us separate scale
and scale-down cleanly). That way, "triangle" can simply have the
preferred radius of 1 by default, while still being tunable. (Rather
than the default radius being hard-coded to 3 always)
2015-04-04 15:36:13 +02:00
wm4 3d17b12d9c vo_opengl: remove chroma-location suboption
Terribly obscure, and vf_format can do this for all VOs.
2015-04-03 00:12:32 +02:00
wm4 8fff125422 RPI support
This requires FFmpeg git master for accelerated hardware decoding.
Keep in mind that FFmpeg must be compiled with --enable-mmal. Libav
will also work.

Most things work. Screenshots don't work with accelerated/opaque
decoding (except using full window screenshot mode). Subtitles are
very slow - even simple but huge overlays can cause frame drops.

This always uses fullscreen mode. It uses dispmanx and mmal directly,
and there are no window managers or anything on this level.

vo_opengl also kind of works, but is pretty useless and slow. It can't
use opaque hardware decoding (copy back can be used by forcing the
option --vd=lavc:h264_mmal). Keep in mind that the dispmanx backend
is preferred over the X11 ones in case you're trying on X11; but X11
is even more useless on RPI.

This doesn't correctly reject extended h264 profiles and thus doesn't
fallback to software decoding. The hw supports only up to the high
profile, and will e.g. return garbage for Hi10P video.

This sets a precedent of enabling hw decoding by default, but only
if RPI support is compiled (which most hopefully it will be disabled
on desktop Linux platforms). While it's more or less required to use
hw decoding on the weak RPI, it causes more problems than it solves
on real platforms (Linux has the Intel GPU problem, OSX still has
some cases with broken decoding.) So I can live with this compromise
of having different defaults depending on the platform.

Raspberry Pi 2 is required. This wasn't tested on the original RPI,
though at least decoding itself seems to work (but full playback was
not tested).
2015-03-29 16:09:56 +02:00
Niklas Haas cfaa6e9155
manpage: update warning on blend-subtitles 2015-03-27 12:31:10 +01:00
wm4 091e38cbf7 manpage: vo_opengl: blend-subtitles is broken 2015-03-27 10:25:28 +01:00
wm4 8b82ebd3e6 manpage: fix typo 2015-03-26 00:14:03 +01:00
Niklas Haas 8c43e12b20 vo_opengl: draw subtitles directly onto the video
This has a number of user-visible changes:

1. A new flag blend-subtitles (default on for opengl-hq) to control this
   behavior.

2. The OSD itself will not be color managed or affected by
   gamma controls. To get subtitle CMS/gamma, blend-subtitles must be
   used.

3. When enabled, this will make subtitles be cleanly interpolated by
   :interpolation, and also dithered etc. (just like the normal output).

Signed-off-by: wm4 <wm4@nowhere>
2015-03-26 00:04:03 +01:00
Niklas Haas a67494e86b vo_opengl: set cscale=spline36 as default for opengl-hq
Bilinear scaling is not a suitable default for something named "hq"; the
whole reason this was done in the past was because cscale used to be
obscenely slow. This is no longer the case, with cscale being nearly
free.
2015-03-25 22:40:19 +01:00
wm4 9c21082835 manpage: remove "experimental" notice from dxva2 code
It's relatively stable now.

Also fix a typo in an unrelated place (better not waste commits on
typos).
2015-03-19 23:48:32 +01:00
Martin Herkt 41f9b9376b man/vo: fix typo 2015-03-15 21:18:29 +01:00
Niklas Haas 31a5f08f13 vo_opengl: add oversample support for tscale
This is interesting mainly because it's essentially equivalent to the
old smoothmotion algorithm. As such, it is now the default for tscale.
2015-03-15 18:01:39 +01:00
Niklas Haas ac1e31957d vo_opengl: add oversample scaler
This is like nearest neighbour, but the edges between pixels are
linearly interpolating if needed, as if they had been (naively)
oversampled.
2015-03-15 18:01:39 +01:00
Niklas Haas 44a78a2be2 vo_opengl: refactor smoothmotion -> interpolation
This replaces the old smoothmotion code by a more flexible tscale
option, which essentially allows any scaler to be used for interpolating
frames. (The actual "smoothmotion" scaler which behaves identical to the
old code does not currently exist, but it will be re-added in a later commit)

The only odd thing is that larger filters require a larger queue size
offset, which is currently set dynamically as it introduces some issues
when pausing or framestepping. Filters with a lower radius are not
affected as much, so this is identical to the old smoothmotion if the
smoothmotion interpolator is used.
2015-03-15 18:01:39 +01:00
Niklas Haas ea680d2677
manpage: update cscale
Had some outdated information.
2015-03-13 01:59:10 +01:00
Niklas Haas 3974a5ca5e vo_opengl: refactor shader generation (part 2)
This adds stuff related to gamma, linear light, sigmoid, BT.2020-CL,
etc, as well as color management. Also adds a new gamma function (gamma22).

This adds new parameters to configure the CMS settings, in particular
letting us target simple colorspaces without requiring usage of a 3DLUT.

This adds smoothmotion. Mostly working, but it's still sensitive to
timing issues. It's based on an actual queue now, but the queue size
is kept small to avoid larger amounts of latency.

Also makes “upscale before blending” the default strategy.
This is justified because the "render after blending" thing doesn't seme
to work consistently any way (introduces stutter due to the way vsync
timing works, or something), so this behavior is a bit closer to master
and makes pausing/unpausing less weird/jumpy.

This adds the remaining scalers, including bicubic_fast, sharpen3,
sharpen5, polar filters and antiringing. Apparently, sharpen3/5 also
consult scale-param1, which was undocumented in master.

This also implements cropping and chroma transformation, plus
rotation/flipping. These are inherently part of the same logic, although
it's a bit rough around the edges in some case, mainly due to the fallback
code paths (for bilinear scaling without indirection).
2015-03-12 23:20:21 +01:00
Niklas Haas 6983430c35
manpage: document swapinterval default 2015-03-09 00:19:50 +01:00
Stefano Pigozzi c028d782c1 vo_opengl: add gamma-auto option
This automatically sets the gamma option depending on lighting conditions
measured from the computer's ambient light sensor.

sRGB – arguably the “sibling” to BT.709 for still images – has a reference
viewing environment defined in its specification (IEC 61966-2-1:1999, see
http://www.color.org/chardata/rgb/srgb.xalter). According to this data, the
assumed ambient illuminance is 64 lux. This is the illuminance where the gamma
that results from ICC color management is correct.

On the other hand, BT.1886 formalizes that the gamma level for dim environments
to be 2.40, and Apple resources (WWDC12: 2012 Session 523: Best practices for
color management) define the BT.1886 dim at 16 lux.

So the logic we apply is:

  * >= 64lux -> 1.961 gamma
  * =< 16lux -> 2.400 gamma
  * 16lux < x < 64lux -> logaritmic rescale of lux to gamma. The human
    perception of illuminance roughly follows a logaritmic scale of lux [1].

[1]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd319008%28v=vs.85%29.aspx
2015-03-04 10:06:08 +01:00
Niklas Haas 0da6a7346a
vo_opengl: implement antiringing for tensor scalers
This is based on pretty much the same (somewhat naive) logic right now.
I'm not convinced that the extra logic that eg. madVR includes is worth
enough to warrant heavily confusing the logic for it.

This shouldn't slow down the logic at all in any sane shader compiler,
and indeed it doesn't on any shader compiler that I tested.

Note that this currently doesn't affect cscale at all, due to the weird
implementation details of that.
2015-02-27 04:35:15 +01:00
Niklas Haas 9fa73b6f64 manpage: update documentation for smoothmotion
Hopefully, this will really clear up how the thing is supposed to work
(and that it's not SVP, nor MVTools).

I also removed instances of the word "interpolation", since that's a
term that's easily misleading.

Finally, I expanded on smoothmotion-threshold since the purpose/meaning
was a bit confusing.
2015-02-24 21:52:11 +01:00
Niklas Haas d27563cb14
filter_kernels: add ewa_lanczossharp alias
This is essentially a preconfigured version of ewa_lanczos, with the
"best" parameters for general purpose usage.
2015-02-24 00:52:17 +01:00
Niklas Haas 36011c7f6d
filter_kernels: add blur parameter to jinc
This affects all filters that use it, eg. ewa_lanczos. Setting it to
something like 0.95 can be done to make the filter a bit less blurry.
2015-02-23 19:06:18 +01:00
Niklas Haas 8161d621bb
manpage: document scale-param1 properly
Right now, nothing in the man page says what it actually affects, other
than for mitchell. I added a list to make it clear.
2015-02-23 18:55:31 +01:00
Niklas Haas 92d33d06df
manpage: update for new EWA filters
The man page was still referring to ewa_lanczos exclusively in a few
places, even though new EWA filters have been introduced in the
meantime.
2015-02-23 17:49:43 +01:00
Niklas Haas 99dfd3368d
filter_kernels: rename ginseng to ewa_ginseng
This is done mainly for consistency, since all of the EWA filters share
similar properties and it's important to distinguish them for
documentation purposes.
2015-02-23 17:42:49 +01:00
Niklas Haas 885c2fff70 vo_opengl: add ginseng upscaler
This is a variation of ewa_lanczos that is sinc-windowed instead of
jinc-windowed. Results are pretty similar, but the logic is simpler.
This could potentially replace the ugly ewa_lanczos code.

It's hard to tell, but from comparing stills I think this one has
slightly less ringing than regular ewa_lanczos.
2015-02-20 16:21:46 +01:00
wm4 62b0f64c24 Revert "vo_opengl: disable alpha by default"
This reverts commit a33b46194c.

It turns out FFmpeg really considers this a bug, and fixed it by making
the decoder output the correct pixel format.

Fixes #1565. Reverts the fix #1528, though it should work fine with
a recent git master FFmpeg.
2015-02-06 23:23:27 +01:00
Niklas Haas 4fed18e81e
vo_opengl: add support for linear scaling without CMS
This introduces a new option linear-scaling, which is now implied by
srgb, icc-profile and sigmoid-upscaling.

Notably, this means (sigmoidized) linear upscaling is now enabled by
default in opengl-hq mode. The impact should be negligible, and there
has been no observation of negative side effects of sigmoidized scaling,
so it feels safe to do so.
2015-02-06 03:37:21 +01:00
Stefano Pigozzi aeb1fca0d4 cocoa: automatically fetch display-fps from the monitor
Comment explains why I have been so doubtful at adding this. The Apple docs
say CGDisplayModeGetRefreshRate is supposed to work only for CRTs, but it
doesn't, and actually works for LCD TVs connected over HDMI and external
displays (at least that's what I'm told, I don't have the hardware to test).
Maybe Apple docs are incorrect.

Since AFAIK Apple doesn't want to give us a better API – maybe in the fear we
might be able to actually write some useful software instead of "apps" –
I decided not to care as well and commit this.
2015-02-03 22:07:37 +01:00
wm4 a33b46194c vo_opengl: disable alpha by default
This reverts the default behavior introduced in commit 93feffad. Way too
often libavcodec will return RGB data that has an alpha channel as per
pixel format, but actually contains garbage.

On the other hand, this will actually render garbage color values in
e.g. PNG files (for pixels with alpha==0, the color value should be
essentially ignored, which is what the old alpha blend mode did).

This "fixes" #1528, which is probably a decoder bug (or far less likely,
a broken file).
2015-02-03 21:00:21 +01:00
wm4 98828886d4 vo_opengl: change initialization of gamma option
Make the lazy gamma initialization less weird, and make the default
value of the "gamma" sub-option 1.0. This means --vo=opengl:help will
list the actual default value.

Also change the lower bound to 0.1 - avoids a division by zero (I don't
know how shaders handle NaN, but it's probably not a good idea to give
them this value).
2015-02-03 17:19:34 +01:00
Niklas Haas 9d62482cdc
vo_opengl: change upper bound of :gamma to 2.0
This allows a spread of 1.0 in either direction, which is already close
to absurd. Anything higher than that is pretty pointless.
2015-02-03 12:29:19 +01:00
Niklas Haas a51045bddd
manpage: add recommended values to :gamma suboption
These were derived from dividing our assumed video gamut (1.961) by some
typical screen values (2.2 for dimly lit and 2.4 for pitch black):

1.961/2.4 = 0.8170833333333334 ~= 0.8
1.961/2.2 = 0.8913636363636364 ~= 0.9
2015-02-03 08:48:54 +01:00
Stefano Pigozzi 0a38d69ac0 man: expand on the smoothmotion documentation
Hopefully this will clear up how the thing is supposed to work (and that it's
not SVP, nor MVTools).
2015-01-28 14:19:32 +01:00
wm4 06b1a2f145 manpage: fix smoothmotion-threshold value range 2015-01-26 07:05:59 +01:00
wm4 df3e6b549c vo_opengl, x11: implement icc-profile-auto
This queries the _ICC_PROFILE property on the root window. It also tries
to reload the ICC when it changes, or if the mpv window changes the
monitor. (If multiple monitors are covered, mpv will randomly select one
of them.)

The official spec is a dead link on freedesktop.org, so don't blame me
for any bugs.

Note that this assumes that Xinerama screen numbers match the way mpv
enumerates the xrandr monitors. Although there is some chance that this
matches, it most likely doesn't, and we actually have to do complicated
things to map the screen numbers. If it turns out that this is required,
I will fix it as soon as someone with a suitable setup for testing the
fix reports it.
2015-01-26 02:18:47 +01:00
wm4 dc1793048f vo_opengl: make "mitchell" the hq default filter for downscaling
Seems like several people agree that it's a good filter for downscaling.

Setting this option by default may also prevent people from accidentally
using an unsuitable filter for downscaling by setting "scale" and
without being aware of the impliciations (maybe). On the other hand,
this change is not strictly backwards compatible for the same reasons.

Also, allow disabling this option with scale-down="" (before this, not
setting it was the only way to do this - not possible anymore if it's
set by default). This is what the change in handle_scaler_opt() does.
2015-01-26 02:03:44 +01:00
wm4 a0a40eb287 vo: fix disabling/enabling smoothmotion at runtime
vo.c queried the VO at initialization whether it wants to be updated on
every display frame, or every video frame. If the smoothmotion option
was changed at runtime, the rendering mode in vo.c wasn't updated.

Just let vo_opengl set the mode directly. Abuse the existing
vo_set_flip_queue_offset() function for this.

Also add a comment suggesting the use of --display-fps to the manpage,
which doesn't have anything to do with the rest of this commit, but is
important to make smoothmotion run well.
2015-01-23 20:56:25 +01:00
wm4 17e1e9f486 manpage: minor changes
Mostly related to vo_opengl.

Fix the opengl lscale option in the qml example too.
2015-01-23 17:41:50 +01:00
Stefano Pigozzi c29ab5a46b vo_opengl: add smoothmotion frame blending
SmoothMotion is a way to time and blend frames made popular by MadVR. It's
intended behaviour is to remove stuttering caused by mismatches between the
display refresh rate and the video fps, while preserving the video's original
artistic qualities (no soap opera effect). It's supposed to make 24fps video
playback on 60hz monitors as close as possible to a 24hz monitor.

Instead of drawing a frame once once it's pts has passed the vsync time, we
redraw at the display refresh rate, and if we detect the vsync is between two
frames we interpolated them (depending on their position relative to the vsync).
We actually interpolate as few frames as possible to avoid a blur effect as
much as possible. For example, if we were to play back a 1fps video on a 60hz
monitor, we would blend at most on 1 vsync for each frame (while the other 59
vsyncs would be rendered as is).

Frame interpolation is always done before scaling and in linear light when
possible (an ICC profile is used, or :srgb is used).
2015-01-23 09:14:41 +01:00
wm4 e872852bcb manpage: vo_opengl: describe how to get lanczos2/lanczos3
These aliases were removed in commit 1ec77214. Add a notice to the
manpage how to get these back. Apparently, "lanczos2" and "lanczos3"
were the only interesting aliases possibly used by someone, so the
description is limited to these two.
2015-01-22 20:06:27 +01:00
Niklas Haas 27261bea31
vo_opengl: remove scale-sep and indirect options
These are now auto-detected sanely; and enabled whenever it would be a
performance or quality gain (which is pretty much everything except
bilinear/bilinear scaling).

Perhaps notably, with the absence of scale_sep, there's no more way to
use convolution filters on hardware without FBOs, but I don't think
there's hardware in existence that doesn't have FBOs but is still fast
enough to run the fallback (slow) 2D convolution filters, so I don't
think it's a net loss.
2015-01-22 19:40:06 +01:00
Niklas Haas 8eb9ddd868 vo_opengl: rename all scale options to make more sense
This emphasizes the fact that scale is used for *all* image upscaling,
with cscale only serving a minor role for subsampled material.
2015-01-22 19:40:04 +01:00
Niklas Haas f24c2e0f56 vo_opengl: always prefer indirect scaling
This is better even for non-separable. The only exception is when using
bilinear for both lscale and cscale. I've fixed the
documentation/comments to make more sense.
2015-01-22 19:40:04 +01:00
Niklas Haas 2d182fdea0
vo_opengl: implement naive anti-ringing
This is not quite the same thing as madVR's antiringing algorithm, but
it essentially does something similar.

Porting madVR's approach to elliptic coordinates will take some amount
of thought.
2015-01-22 19:39:58 +01:00
Niklas Haas edc100eee0
vo_opengl: make the default radius 3.0 and simplify scaler documentation
This also fixes the maximum range to 16.0, which was previously set to
32.0 and incorrectly documented as 8.0. 16 taps should be more than
anybody will ever need, but it's the highest radius that's supported by
all affected filters.
2015-01-21 23:08:41 +01:00
wm4 e7171892e7 manpage: vo_opengl: change scaler descriptions and recommendations
Based on suggestions by lachs0r.
2015-01-21 22:22:42 +01:00
wm4 724f722d7f vo_opengl_old: remove this VO
At this point, there is probably no hardware left that doesn't do
OpenGL 2.1, and at the same time is fast enough to handle video.
2015-01-20 21:15:04 +01:00
wm4 061d9b1afe README: extend dependecy list, link Windows compilation docs
Also, fix vo.rst, don't want to waste a separate commit on this.
2015-01-20 15:23:21 +01:00
wm4 6f5e5e6a9e vo_opengl: remove cscale-down suboption
For an explanation see the additions to the manpage.
2015-01-20 14:33:53 +01:00
Niklas Haas 61f5a80f10
vo_opengl: get rid of approx-gamma and make it the default as per BT.1886
After finding out more about how video mastering is done in the real
world it dawned upon me why the "hack" we figured out in #534 looks so
much better.

Since mastering studios have historically been using only CRTs, the
practice adopted for backwards compatibility was to simulate CRT
responses even on modern digital monitors, a practice so ubiquitous that
the ITU-R formalized it in R-Rec BT.1886 to be precisely gamma 2.40.

As such, we finally have enough proof to get rid of the option
altogether and just always do that.

The value 1.961 is a rounded version of my experimentally obtained
approximation of the BT.709 curve, which resulted in a value of around
1.9610336. This is the closest average match to the source brightness
while preserving the nonlinear response of the BT.1886 ideal monitor.

For playback in dark environments, it's expected that the gamma shift
should be reproduced by a user controlled setting, up to a maximum of
1.224 (2.4/1.961) for a pitch black environment.

More information:
https://developer.apple.com/library/mac/technotes/tn2257/_index.html
2015-01-16 02:17:19 +01:00
Niklas Haas 26baf5b9da
vo_opengl: add ewa_lanczos upscaler (aka jinc)
This is the polar (elliptic weighted average) version of lanczos.
This introduces a general new form of polar filters.
2015-01-15 21:20:27 +01:00
Niklas Haas 286340d7d0 video: Add sigmoidal upscaling to avoid ringing artifacts
This avoids issues when upscaling directly in linear light, and is the
recommended way to upscale images according to imagemagick.

The default slope of 6.5 offers a reasonable compromise between
ringing artifacts eliminated and ringing artifacts introduced by
sigmoid-upscaling. Same goes for the default center of 0.75.
2015-01-09 03:18:21 +01:00
xylosper 5b4d587ede vo_opengl_cb: introduce frame queue
The previous implementation of opengl-cb kept only latest flipped frame.
This can cause massive frame drops because rendering is done asynchronously
and only the latest frame can be rendered.

This commit introduces frame queue and releated options to opengl-cb.

frame-queue-size: the maximum size of frame queue (1-100, default: 1)
frame-drop-mode: behavior when frame queue is full (pop, clear, default: pop)

The frame queue holds delayed frames and drops frames if the frame queue is
overflowed with next method:

'pop' mode: drops all the oldest frames overflown.
'clear' mode: drops all frames in queue and clear it.

With default options(frame-queue-size=1:frame-drop-mode=pop),
opengl-cb behaves in the same way as previous implementation effectively.

For frame-queue-size > 1, opengl-cb tries to calls update() without waiting
next flip_page() in order to consume queued frames.

Signed-off-by: wm4 <wm4@nowhere>
2015-01-08 18:50:25 +01:00
wm4 df595b06e6 vo_opengl_cb: support changing options at runtime
Like vo_opengl, but way messier, because the already messy config
handling meets threading.
2015-01-05 15:25:58 +01:00
wm4 7873301be8 vo_opengl_old: remove ancient ATI-specific YUV conversions
While there's no actual need to get rid of these, I want to make sure
nobody actually needs this stuff, and removing it is the best way to
get to know this. We still can revert this commit if it turns out there
is a significant need for this stuff.

The final goal is removing vo_opengl_old entirely. Add a warning, which
basically announces this intention.
2015-01-02 00:59:27 +01:00
wm4 4681e7f49f vo_opengl: switch default FBO format to rgba, use GL_RGBA
I'm hoping this is generally more compatible, and it works with GLES.

This probably has not much of an effect on desktop GL. It also switches
only the default format for --vo=opengl, not --vo=opengl-hq.

"-hq" already uses GL_RGBA16, though since it's a sized format, the
story is a bit different, and it won't work on GLES either.
2014-12-17 21:35:05 +01:00
wm4 1c2cbeabc2 vo_opengl: remove quadbuffer/anaglyph stereo 3D rendering
Obscure feature, and I've never heard of anyone using it.

The anaglyph effects can be reproduced with vf_stereo3d. The only thing
that can't be reproduced with it is "quadbuffer", which requires special
and expensive hardware.
2014-12-15 04:40:26 +01:00
wm4 273565c525 vo_opengl_cb: simplify reconfigure, render transparent if unconfigured
I think that's expected; mpv shouldn't draw anything while no video is
active. This doesn't blend transparently, though.

Also document the vo_opengl_cb thing.
2014-12-09 21:55:27 +01:00
wm4 0125fb6714 vo_opengl: make background color configurable
This mainly affects the black bars that are drawn if the window and
video aspect ratios mismatch.
2014-12-09 21:55:27 +01:00
wm4 9e10f8ccbb vo_opengl: enable fancy-downscaling by default for opengl-hq 2014-11-29 00:04:01 +01:00
wm4 4ce7a2ede9 vo_opengl: disable fancy-downscaling for anamorphic video
Includes some arbitrary minor refactoring.
2014-11-29 00:04:00 +01:00
wm4 b8ac594af0 vo_direct3d: fix texture-memory sub-option, extend it
This sub-option was turned into a flag when the sub-option parser was
changed to the generic one (probably accidentally). Turn it into a
proper choice-option.

Also, adjust what the options do. Though none of this probably makes
much sense; the default should work, and if it doesn't, the GPU/driver
is probably beyond help.
2014-11-18 16:30:32 +01:00
wm4 d484cb3f32 vo_opengl: allow setting different filters for downscaling 2014-11-14 15:22:37 +01:00
Stefano Pigozzi a1d3afb395 vo_corevideo: remove this VO
This was kept in the codebase because it is slightly faster than --vo=opengl
on really old Intel cards (from the GMA era). Time to kill it, and let it rest.

Fixes #1061
2014-09-06 14:10:22 +02:00
Martin Herkt 27a065182c man: fix a whole bunch of typos 2014-09-01 04:27:13 +02:00
Bin Jin 08b5dccd12 vo_opengl: add parameter to gaussian filter
Add a new parameter 'p' to gaussian filter. The new formula used
 a different base taken from fmtconv plugin, so that the
 new parameter is exactly same as the one used in Avisynth and
 Vapoursynth.

 The new default value is 2 / log(2) * 10, with the default value it
 conforms to the original kernel taken from vector-agg.
2014-08-26 22:19:32 +02:00
Bin Jin b3e788d3f4 vo_opengl: add radius options for filters
Add two new options, make it possible for user to set the radius
for some of the filters with no fixed radius.

Also add three new filters with the new radius parameter supported.
2014-08-26 22:19:30 +02:00
Bin Jin f14722a40f vo_opengl: add cparam1 and cparam2 options
Although cscale is rarely used, it's possible that params of cscale
are accidentally set to lparam1 and lparam2, which might cause
unexpected results.
2014-08-26 22:19:27 +02:00
wm4 39b8b0a41f manpage: fix opengl-hq defaults
The FBO format was changed some time ago.

CC: @mpv-player/stable
2014-08-18 02:05:06 +02:00
wm4 72ee9bb56c vo_opengl: optional support for using GLX_SGI_video_sync
I'm not sure about the merit, though it does print nice numbers if debug
output is enabled.

Basically, this tries to achieve similar results as the glFinish()
business, but again it entirely depends on the drivers whether this
does anything meaningful, or whether it's actively harmful.
2014-08-15 23:36:13 +02:00
wm4 4a297554bc vo_opengl: if glfinish is used, also call it after swappping
It seems that at least on nvidia systems with composting disabled, we
can get it to block deterministically on the actual vsync event, which
should improve framedropping.
2014-08-15 23:36:02 +02:00
wm4 3c7675ae9a manpage: eliminate the word "movie"
It's evil and sounds outdated. Use the words "media" and "video"
instead.

Closes #935.
2014-07-26 23:19:47 +02:00
Niklas Haas fbd35caef8 video: Refactor rendering intent for DCP XYZ and :srgb
Notably, we now conform to SMPTE 428-1-2006 when decoding XYZ12 input,
and we can support rendering intents other than colorimetric when
converting between BT.709 and BT.2020, like with :srgb or :icc-profile.
2014-06-22 19:02:06 +02:00
Niklas Haas 70f50ddc5e video: Add support for non-BT.709 primaries
This add support for reading primary information from lavc, categorized
into BT.601-525, BT.601-625, BT.709 and BT.2020; and passes it on to the
vo. In vo_opengl, we always generate the 3dlut against the wider BT.2020
and transform our source into this colorspace in the shader.
2014-06-22 19:00:38 +02:00
Niklas Haas 86d3d11a68 video: Add BT.2020-NCL colorspace and transfer function
Source: http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-I!!PDF-E.pdf
2014-06-22 19:00:38 +02:00
wm4 f5e1756475 DOCS: remove en/ sub-directory
This additional sub-directory doesn't serve any purpose anymore. Get rid
of it.
2014-06-20 23:01:12 +02:00