summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* buid: readd -Wparentheseswm42015-03-024-4/+4
| | | | | | | | | This warning wasn't overly helpful in the past, and warned against perfectly fine code. But at least with recent gcc versions, this is the warning that complains about assignments in if expressions (why???), so we want to enable it. Also change all the code this warning complains about for no reason.
* vo_direct3d: support NV12 with shaderswm42015-03-024-196/+359
| | | | | | | | | | | | | Semi-important, because --hwdec=dxva2 outputs NV12, and we really don't want people to end up with the "old" StretchRect method. Unfortunately, I couldn't actually get it to work. It seems most D3D drivers (including the wine D3D implementation) reject D3DFMT_A8L8, and I could not find any other 2-channel 8 bit Direct3D 9 format. It seems newer D3D APIs have DXGI_FORMAT_R8G8_UNORM, but there's no way to get it in D3D9. Still pushing this; maybe it actually works on some drivers.
* vf_scale: libswscale is being stupidwm42015-03-012-3/+10
| | | | | | | | | | | | This time (there are a lot of times), libswscale randomly ignores brightness/saturation/contrast settings. Looking at MPlayer code, it appears the return value of sws_setColorspaceDetails() signals if changing these settings is supported at all. (Nevermind that supporting this feature has almost 0 value, and obviously eats maintenance time.)
* Revert "Revert recent vo_opengl related commits"Niklas Haas2015-02-288-23/+69
| | | | | | | | | | | | | | | | | | | | | | | | Omitted a simple, but devastasting check. Fixed the relevant commits now. This reverts commit 8d24e9d9b8ad1b5d82139980eca148dc0f4a1eab. diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 9c8a643..f1ea03e 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1034,9 +1034,9 @@ static void compile_shaders(struct gl_video *p) shader_def_opt(&header_conv, "USE_CONV_GAMMA", use_conv_gamma); shader_def_opt(&header_conv, "USE_CONST_LUMA", use_const_luma); shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_BT1886", - gamma_fun == MP_CSP_TRC_BT_1886); + use_linear_light && gamma_fun == MP_CSP_TRC_BT_1886); shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_SRGB", - gamma_fun == MP_CSP_TRC_SRGB); + use_linear_light && gamma_fun == MP_CSP_TRC_SRGB); shader_def_opt(&header_conv, "USE_SIGMOID", use_sigmoid); if (p->opts.alpha_mode > 0 && p->has_alpha && p->plane_count > 3) shader_def(&header_conv, "USE_ALPHA_PLANE", "3");
* Revert recent vo_opengl related commitswm42015-02-288-67/+21
| | | | | | | | | | | | | | | Breaks vo_opengl by default. I'm hot able to fix this myself, because I have no clue about the overcomplicated color management logic. Also, whilethis is apparently caused by commit fbacd5, the following commits all depend on it, so revert them too. This reverts the following commits: e141caa97dade07f4d7e0d6c208bcd3493e712ed 653b0dd5295453d9661f673b4ebd02c5ceacf645 729c8b3f641e633474be612e66388c131a1b5c92 fbacd5de31de964f7cd562304ab1c9b4a0d76015 Fixes #1636.
* video: fix typowm42015-02-281-1/+1
| | | | Pointed out in #1636.
* cocoa: remove the setNextKeyView hackStefano Pigozzi2015-02-281-4/+0
| | | | | | Just use makeFirstResponder on the mpv events view from client code if you need the built in keyboard events (this is easier for dealing with view nesting).
* vd_lavc: respect lavc's color_trc fieldNiklas Haas2015-02-282-0/+3
| | | | | We now actually use the TRC tagging information lavc provides us with, instead of always manually guessing.
* screenshots: check for AVFrame csp supportNiklas Haas2015-02-281-0/+2
| | | | Apparently, libav stable is old enough to not have these fields.
* screenshots: add support for csp taggingNiklas Haas2015-02-282-0/+7
| | | | | | This relies on upstream support in lavc, and will hence basically not work at all. The intent is to get support for writing this information into ffmpeg's PNG encoders etc.
* csputils: add missing gamma supportNiklas Haas2015-02-285-21/+55
| | | | | | | | | | | We have MP_CSP_TRC defined, but it wasn't being used by practically anything. This commit adds missing conversion logic, adds it to mp_image, and moves the auto-guessing logic to where it should be, in mp_image_params_guess_csp (and out of vo_opengl). Note that this also fixes a minor bug: csp_prim was not being copied between mp_image structs if the format was not YUV in both cases, but this is wrong - the primaries are always relevant.
* csputils: add support for BT.470-MNiklas Haas2015-02-282-1/+13
| | | | | For some kind of legacy TV system, who knows? But ffmpeg supports it, and it's cheap for us to add.
* vo_opengl: delete 16 bit test texturewm42015-02-271-0/+1
| | | | | Essentially a leak, but not that bad since it's small and allocated only once.
* vo_opengl: fix some commentswm42015-02-271-3/+3
|
* options: handle choice -> flag fallback automaticallywm42015-02-271-2/+2
| | | | | | | | | | | | | | | 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 scalersNiklas Haas2015-02-272-7/+15
| | | | | | | | | | | | 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 usedwm42015-02-261-30/+28
| | | | | | | | | | 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 mappedwm42015-02-261-0/+2
| | | | | | | | 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 performanceNiklas Haas2015-02-242-74/+105
| | | | | | | | | | | | | | | | | | | | 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 issuewm42015-02-241-1/+9
| | | | | | | | | | 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 arrayswm42015-02-241-1/+2
| | | | | | | 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 parameterswm42015-02-241-5/+0
| | | | | | | 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 triangleNiklas Haas2015-02-241-3/+5
| | | | | | | | 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 robidouxsharpNiklas Haas2015-02-241-0/+2
| | | | | | | | 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 filtersNiklas Haas2015-02-241-20/+6
| | | | | | 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 aliasNiklas Haas2015-02-241-0/+4
| | | | | This is essentially a preconfigured version of ewa_lanczos, with the "best" parameters for general purpose usage.
* vo_opengl: support polar filters of any radiusNiklas Haas2015-02-241-6/+7
| | | | | 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 filtersNiklas Haas2015-02-242-2/+11
| | | | | | | 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 jincNiklas Haas2015-02-231-4/+4
| | | | | 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 parameterNiklas Haas2015-02-231-6/+2
| | | | | | | | | 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 kaiserNiklas Haas2015-02-231-3/+2
| | | | | | | | 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_ginsengNiklas Haas2015-02-231-2/+2
| | | | | | 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_hanningNiklas Haas2015-02-231-0/+10
| | | | | 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 stuffNiklas Haas2015-02-231-5/+1
| | | | | | 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 outputwm42015-02-231-2/+2
| | | | | Just so that it has the same indentation as the extremely similar audio filter output.
* vo_opengl: slightly improve ewa_lanczos windowingNiklas Haas2015-02-231-33/+4
| | | | | | | | | | | 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 modewm42015-02-201-5/+0
| | | | | 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 cleanupwm42015-02-201-4/+6
| | | | Not like it matters, and is probably still not entirely correct.
* vo_opengl: minor robustness improvement in function loaderwm42015-02-201-2/+5
| | | | | | 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 upscalerNiklas Haas2015-02-201-0/+11
| | | | | | | | | 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 timeNiklas Haas2015-02-201-24/+31
| | | | | | 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.torque2015-02-184-2/+11
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: glsl: remove trailing \wm42015-02-161-2/+2
| | | | | 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 functionwm42015-02-161-1/+1
| | | | | 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 decoderwm42015-02-141-6/+3
| | | | | | | | | | | | | | | | | 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 readswm42015-02-141-1/+1
| | | | This line of code ended up in the wrong block in commit cd6dfcbe.
* x11: add XK_Cancel to the list of special keysMartin Herkt2015-02-141-0/+1
| | | | | Some IR receivers emit this key by default for remote control buttons. Make it mappable.
* vf_vapoursynth: add display refresh rate propertyJulian2015-02-132-0/+2
| | | | | This value is not necessarily trustworthy (it might change) and can be 0.
* x11: return a framerate even if no window is mappedwm42015-02-131-8/+11
| | | | | 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 mappablewm42015-02-131-0/+7
| | | | | | | | 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 calculationStefano Pigozzi2015-02-133-7/+5
| | | | | Using prev_pts as the start of the scale was plain wrong. Change it to prev_vsync.
* vf_lavfi: drop useless option from wrapper filterswm42015-02-121-4/+1
| | | | | | | 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 bridgewm42015-02-1111-55/+45
| | | | | | | | | | 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 implementationwm42015-02-111-239/+8
| | | | | It requires libavfilter now, just like many other filters. Not sure if it even makes sense to keep this wrapper.
* vo: minor simplificationwm42015-02-071-13/+8
| | | | Whatever.
* vo_vdpau: minor simplificationwm42015-02-071-4/+1
| | | | No change in behavior.
* Revert "vo_opengl: disable alpha by default"wm42015-02-061-2/+2
| | | | | | | | | | 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 formatswm42015-02-064-5/+45
| | | | | | | | 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 CMSNiklas Haas2015-02-063-18/+31
| | | | | | | | | | 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_gammaNiklas Haas2015-02-061-1/+0
| | | | This was left over from 61f5a80.
* vo_vdpau: remove unneeded codewm42015-02-041-4/+0
| | | | This is already done in the common vo.c code.
* vo_opengl: redraw when pausing while showing an interpolated framewm42015-02-043-1/+18
| | | | | 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 codeStefano Pigozzi2015-02-031-9/+14
| | | | | | | | 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 monitorStefano Pigozzi2015-02-031-0/+26
| | | | | |