aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
Commit message (Collapse)AuthorAge
* options: handle choice -> flag fallback automaticallyGravatar wm42015-02-27
| | | | | | | | | | | | | | | In the past it happened quite often that flag options (yes/no) were changed to choice options (yes/no/some more). The problem with this was that while flag options don't need a parameter, this wasn't the case with choice options. A hack was introduced to compensate for this: setting M_OPT_OPTIONAL_PARAM on the option, and an empty string ("") was added as choice, so that the choice could be used like a flag. So, for example, "--mute" would set the choice "". Fix this by 1. not requiring a parameter if there's a "yes" choice, and 2. redirect an empty parameter to "yes". The effect is that a choice option with the choices ["yes", "no"] is pretty much equivalent to a flag option.
* vo_opengl: implement antiringing for tensor scalersGravatar Niklas Haas2015-02-27
| | | | | | | | | | | | 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.
* vo_opengl: test FBOs only if they're going to be usedGravatar wm42015-02-26
| | | | | | | | | | Change test_fbo() so that it checks the FBO lazily, and restructure check_gl_features() to invoke it only if we know that a FBO will be needed for a certain enabled feature. This can avoid strange error messages when using --vo=opengl and the FBO format does not work. It's also less confusing when reading the verbose log (users might think that the FBO is actually used, etc.).
* vo_xv: don't attempt to clear window before mappedGravatar wm42015-02-26
| | | | | | | | This can happen with the "no-colorkey" suboption. Then the code in xv_draw_colorkey() can be run before vo_x11_config_vo_window(), when vo_gc is not allocated yet. Fixes #1629.
* vo_opengl: greatly increase smoothmotion performanceGravatar Niklas Haas2015-02-24
| | | | | | | | | | | | | | | | | | | | Instead of rendering and upscaling each video frame on every vsync, this version of the algorithm only draws them once and caches the result, so the only operation that has to run on every vsync is a cheap linear interpolation, plus CMS/dithering. On my machine, this is a huge speedup for 24 Hz content (on a 60 Hz monitor), up to 120% faster. (The speedup is not quite 250% because of the overhead that the larger FBOs and CMS provides) In terms of the implementation, this commit basically swaps interpolation and upscaling - upscaling is moved to inter_program, and interpolation is moved to the final_program. Furthermore, the main bulk of the frame rendering logic (upscaling etc.) was moved to a separete function, which is called from gl_video_interpolate_frame only if it's actually necessarily, and skipped otherwise.
* vo_opengl: another GLES2 issueGravatar wm42015-02-24
| | | | | | | | | | GLES2 randomly does not support the transpose parameter in matrix uniform calls. So we have to do this manually. Sure it was worth to mutilate the standard just so all these shitty SoC vendors can safe 3 lines of code. (Obviously trying to handle all of GLES2 to GL 4.x in a single codebase was a mistake.)
* vo_opengl: extend ifdef against shader arraysGravatar wm42015-02-24
| | | | | | | GLES2 shaders do not have line continuation characters. Abuse the HAVE_ARRAYS define to exclude code which uses arrays, and which also happens to cover all code that defines multi-line macros. (So yes, this is a hack.)
* video: remove redundant codec parametersGravatar wm42015-02-24
| | | | | | | Remove coded_width and coded_height. This was originally added in commit fd7dde40, when BITMAPINFOHEADER was killed. The separate fields became redundant in commit e68f4be1. Remove them (nothing passed to the decoders actually changes with _this_ commit).
* filter_kernels: rename bilinear_slow to triangleGravatar Niklas Haas2015-02-24
| | | | | | | | This is essentially what it is, and it's a useful for windowing or downscaling. For upscaling we already have bilinear, no need to cause extra confusion between biliner and bilinear_slow. Also made it a bit more well-behaved.
* filter_kernels: add robidoux and robidouxsharpGravatar Niklas Haas2015-02-24
| | | | | | | | These are EWA-based versions of the keys B/C splines, of which mitchell is already a member. They are slightly softer and slightly sharper than mitchell, respectively. Very easy to define in terms of things we already have.
* filter_kernels: redefine redundant filtersGravatar Niklas Haas2015-02-24
| | | | | | mitchell, hermite and catmull_rom are all B/C splines and can share the code which was already written for mitchell. This just redefines them in terms of that.
* filter_kernels: add ewa_lanczossharp aliasGravatar Niklas Haas2015-02-24
| | | | | This is essentially a preconfigured version of ewa_lanczos, with the "best" parameters for general purpose usage.
* vo_opengl: support polar filters of any radiusGravatar Niklas Haas2015-02-24
| | | | | We can now truly pass a radius of 3.2383154841662362 or another real zero of the jinc function to get a better result.
* vo_opengl: explicitly check potential candidates for polar filtersGravatar Niklas Haas2015-02-24
| | | | | | | This adds a small check for candidates that could potentially be inside the radius, but aren't necessarily. This speeds up performance by a negligible amount on my hardware, but it's mainly a prerequisite for a further change (using a larger true radius).
* filter_kernels: add blur parameter to jincGravatar Niklas Haas2015-02-23
| | | | | 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.
* filter_kernels: gaussian: redefine the parameterGravatar Niklas Haas2015-02-23
| | | | | | | | | Previously, this was based on some arbitrary range 1-100, cut off for no particular reason, and also defined in such a way that higher values = *less* smoothness. Since it wasn't multiplied by e in the code, the default had to be 10*e = 28.8539... Now, it's sane: 1.0 = default, higher = blurrier.
* filter_kernels: remove second parameter from kaiserGravatar Niklas Haas2015-02-23
| | | | | | | | This filter isn't supposed to have a second parameter in the first place, all literature only uses a single parameter alpha in both places. The second parameter doesn't even do anything other than adding a constant factor, which is normalized by the LUT calculation either way.
* filter_kernels: rename ginseng to ewa_ginsengGravatar Niklas Haas2015-02-23
| | | | | | 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.
* filter_kernels: add ewa_hanningGravatar Niklas Haas2015-02-23
| | | | | This is suggested in a thesis by Andreas Gustafsson, and seems to produce very a bit less ringing than lanczos at high radius.
* filter_kernels: minor code cleanup of jinc stuffGravatar Niklas Haas2015-02-23
| | | | | | No point in duplicating this check all over the place. No point in really having it in the first place, to be perfectly honest, j1 should not be THAT badly behaved.
* vf: fix indentation level of verbose outputGravatar wm42015-02-23
| | | | | Just so that it has the same indentation as the extremely similar audio filter output.
* vo_opengl: slightly improve ewa_lanczos windowingGravatar Niklas Haas2015-02-23
| | | | | | | | | | | The original filter window was design for a radius based on the true zero, but we always cut it off at our selection of radius either way (by necessity, due to the square matrix we sample from). This window is tweaked from the original (true radius) to our actual cut-off radius, and hence improves the result in a few edge cases. The main win is the reduction of code complexity, since we no longer need to know what the true radius actually is.
* video: un-discourage "vaapi-copy" hwdec modeGravatar wm42015-02-20
| | | | | Maybe I don't know what I'm doing. I'm fairly certain though that Intel does not know what they're doing.
* x11egl: minor cleanupGravatar wm42015-02-20
| | | | Not like it matters, and is probably still not entirely correct.
* vo_opengl: minor robustness improvement in function loaderGravatar wm42015-02-20
| | | | | | Check the scanf() return value, and don't continue if it doesn't find both numbers (can happen with GLES 1.0). Also, some implementations can return NULL from glGetString() if something is "broken".
* vo_opengl: add ginseng upscalerGravatar Niklas Haas2015-02-20
| | | | | | | | | 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.
* vo_opengl: fix smoothmotion coefficient calculation, for real this timeGravatar Niklas Haas2015-02-20
| | | | | | I've reworked pretty much all the logic to correspond to what the theory actually describes. With this commit, playback is wonderfully smooth on my machine.
* input: add MOUSE_ENTER keybinding.Gravatar torque2015-02-18
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: glsl: remove trailing \Gravatar wm42015-02-16
| | | | | This should be no problem... but it _might_ help with #1536, so it's worth a try.
* vf_vapoursynth: replace a hack with a newer VS API functionGravatar wm42015-02-16
| | | | | The new function does exactly what we need. Replaces the old hack, which created the vscore by running an empty script.
* vd_lavc: uninit the hwdec backend after closing the decoderGravatar wm42015-02-14
| | | | | | | | | | | | | | | | | A recent behavior change in libavcodec's h264 decoder keeps at least 1 surface even after avcodec_flush_buffers() has been called. We used to flush the decoder in order to make sure all surfaces are free'd, so that the hw decoder can be safely uninitialized. This doesn't work anymore. Fix it by closing the AVCodecContext before the hw decoder is uninitialized. This is actually simpler and more robust. It seems to be well-supported too. Fixes invalid read accesses with vaapi-copy and dxva2-copy. These destroyed the hwdec API fully on uninit, and could not deal with surfaces surviving the decoder. Probably fixes #1587.
* x11: fix uninitialized variable readsGravatar wm42015-02-14
| | | | This line of code ended up in the wrong block in commit cd6dfcbe.
* x11: add XK_Cancel to the list of special keysGravatar Martin Herkt2015-02-14
| | | | | Some IR receivers emit this key by default for remote control buttons. Make it mappable.
* vf_vapoursynth: add display refresh rate propertyGravatar Julian2015-02-13
| | | | | This value is not necessarily trustworthy (it might change) and can be 0.
* x11: return a framerate even if no window is mappedGravatar wm42015-02-13
| | | | | Falls back to the first display in the list returned by xrandr. Not entirely correct, but makes some people happy (see #1575).
* x11: make all XF86 special keys mappableGravatar wm42015-02-13
| | | | | | | | Makes all keys documented in XF86keysym.h mappable. This requires the user to deal with numeric keycodes; no names are queried or exported. This is an easy way to avoid adding all the hundreds of XF86 keys to our X11 lookup table and mpv's keycode/name list.
* vo_opengl: fix smoothmotion coefficient calculationGravatar Stefano Pigozzi2015-02-13
| | | | | Using prev_pts as the start of the scale was plain wrong. Change it to prev_vsync.
* vf_lavfi: drop useless option from wrapper filtersGravatar wm42015-02-12
| | | | | | | Filters which merely wrap libavfilter (for user-compatibility) like vf_gradfun had a "lavfi-enable" suboption, which could disable libavfilter usage. Since none of these filters has an internal implementation anymore, this was completely useless.
* video/filters: simplify libavfilter bridgeGravatar wm42015-02-11
| | | | | | | | | | Remove the confusing crap that allowed a filter using the libavfilter bridge to be compiled without libavfilter. Instead, compile the wrappers only if libavfilter is enabled at compile time. The only filter which still requires it is vf_stereo3d (unfortunately). Special-case this one. (The whole filter and how it interacts with lavfi is pure braindeath anyway.)
* vf_noise: remove internal implementationGravatar wm42015-02-11
| | | | | It requires libavfilter now, just like many other filters. Not sure if it even makes sense to keep this wrapper.
* vo: minor simplificationGravatar wm42015-02-07
| | | | Whatever.
* vo_vdpau: minor simplificationGravatar wm42015-02-07
| | | | No change in behavior.
* Revert "vo_opengl: disable alpha by default"Gravatar wm42015-02-06
| | | | | | | | | | This reverts commit a33b46194c3525cb585cc78b449ec275dbfd7f83. 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.
* video: work around libswscale for PNG pixel formatsGravatar wm42015-02-06
| | | | | | | | The intention is that we can test vo_opengl with high bit depth PNGs better. This throws libswscale completely out of the loop, which before was needed in order to convert from big endian to little endian. Also apply a minimal cleanup to fmt-conversion.c (unrelated).
* vo_opengl: add support for linear scaling without CMSGravatar Niklas Haas2015-02-06
| | | | | | | | | | 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.
* vo_opengl: get rid of unused field approx_gammaGravatar Niklas Haas2015-02-06
| | | | This was left over from 61f5a80.
* vo_vdpau: remove unneeded codeGravatar wm42015-02-04
| | | | This is already done in the common vo.c code.
* vo_opengl: redraw when pausing while showing an interpolated frameGravatar wm42015-02-04
| | | | | If smoothmotion is enabled, and the screen shows an interpolated frame the moment you pause, redraw a non-interpolated frame.
* cocoa: improve refresh rate fallback codeGravatar Stefano Pigozzi2015-02-03
| | | | | | | | Apparently CoreGraphics reports the actual refresh rate. DisplayLink can also query the nominal refresh rate of the display so we use that as fallback instead of the fugly 60fps hardcode added in aeb1fca0d. Props to people on https://github.com/glfw/glfw/issues/137
* cocoa: automatically fetch display-fps from the monitorGravatar Stefano Pigozzi2015-02-03
| | | | | | | | | | | | 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.