aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* vo_opengl: fall back to gamma2.2 by default for HDR contentGravatar Niklas Haas2016-05-16
| | | | | | | | | | | Since HDR content is now auto-detected as such, we should probably do something smarter in the "no configuration" case, such as outputting gamma 2.2 instead. This decision will affect the majority of users of stock configurations who just play back appropriately tagged HDR files, so having a good default behavior is important. "Output the HDR content as-is" is definitely not likely to give the user a good result.
* csputils: add AVCOL_TRC_SMPTEST2084 supportGravatar Niklas Haas2016-05-16
| | | | | | | This now lets us auto-detect appropriately tagged HDR content using FFmpeg's new TRC entries (when available). Hidden behind an #if because Libav stable doesn't have it yet.
* vo_opengl: remove unnecessary castsGravatar wm42016-05-16
|
* vo_opengl: remove another unneeded allocationGravatar wm42016-05-16
|
* vo_opengl: remove possibly undefined behaviorGravatar wm42016-05-16
|
* vo_opengl: free to-be-added hook on hook array overflowGravatar wm42016-05-16
| | | | | | Seems sensible. Untested.
* vo_opengl: never clear file cacheGravatar wm42016-05-16
| | | | | | | | | Make it dynamic and never remove entries from it. For now, this is better than possibly creating dangling pointers all over the place in the gl_user_shader struct. Untested.
* vo_opengl: use proper include statementGravatar wm42016-05-16
|
* vo_opengl: remove unnecessary allocationGravatar wm42016-05-16
|
* vo_opengl: remove unused global variableGravatar wm42016-05-16
| | | | ?
* manpage: declare user-shader syntax for not stableGravatar wm42016-05-16
|
* vo_opengl: fix bicubic_fast in ES modeGravatar wm42016-05-16
| | | | | | GLES shaders disallow implicit conversion from int to float. This has been broken for quite a while.
* vo_opengl: implement more HDR tonemapping algorithmsGravatar Niklas Haas2016-05-16
| | | | | | | | | | | | | | | | | | | | | This is now a configurable option, with tunable parameters. I got inspiration for these algorithms off wikipedia. "simple" seems to work pretty well, but not well enough to make it a reasonable default. Some other notable candidates: - Local functions (e.g. based on local contrast or gradient) - Clamp with soft knee (linear up to a point) - Mapping in CIE L*Ch. Map L smoothly, clamp C and h. - Color appearance models These will have to be implemented some other time. Note that the parameter "peak_src" to pass_tone_map should, in principle, be auto-detected from the SEI information of the source file where available. This will also have to be implemented in a later commit.
* vo_opengl: avoid redundant double-gamma conversionGravatar Niklas Haas2016-05-16
| | | | | | | | | | | | Due to the way color management in mpv worked historically, the subtitle blending function was written to preserve the linearity of the input. (In the past, the 3DLUT function required linear inputs) Since the 3DLUT was refactored to accept the video color directly, the re-linearization after blending is now virtually always redundant. (Notably, it's also redundant when CMS is turned off, so this way of writing the code stopped making sense a long time ago. It is a remnant from before the pass_colormanage function was as flexible as it is now)
* vo_opengl: implement HDR (SMPTE ST2084)Gravatar Niklas Haas2016-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, this relies on the user manually entering their display brightness (since we have no way to detect this at runtime or from ICC metadata). The default value of 250 was picked by looking at ~10 reviews on tftcentral.co.uk and realizing they all come with around 250 cd/m^2 out of the box. (In addition, ITU-R Rec. BT.2022 supports this) Since there is no metadata in FFmpeg to indicate usage of this TRC, the only way to actually play HDR content currently is to set ``--vf=format=gamma=st2084``. (It could be guessed based on SEI, but this is not implemented yet) Incidentally, since SEI is ignored, it's currently assumed that all content is scaled to 10,000 cd/m^2 (and hard-clipped where out of range). I don't see this assumption changing much, though. As an unfortunate consequence of the fact that we don't know the display brightness, mixed with the fact that LittleCMS' parametric tone curves are not flexible enough to support PQ, we have to build the 3DLUT against gamma 2.2 if it's used. This might be a good thing, though, consdering the PQ source space is probably not fantastic for interpolation either way. Partially addresses #2572.
* vo_opengl: use enums for choice options internallyGravatar Niklas Haas2016-05-16
| | | | | | This is much more readable than hard-coding magic IDs all over the file, and removes the need for all the explanatory comments that were a direct result of this.
* vo_opengl: abstract hook texture access behind macroGravatar Niklas Haas2016-05-15
| | | | | | | | | | | | | | | | | | | | | | | | This macro takes care of rotation, swizzling, integer conversion and normalization automatically. I found the performance impact to be nonexistant for superxbr and debanding, although rotation *did* have an impact due to the extra matrix multiplication. (So it gets skipped where possible) All of the internal hooks have been rewritten to use this new mechanism, and the prescaler hooks have finally been separated from each other. This also means the prescale FBO kludge is no longer required. This fixes image corruption for image formats like 0bgr, and also fixes prescaling under rotation. (As well as other user hooks that have orientation-dependent access) The "raw" attributes (tex, tex_pos, pixel_size) are still un-rotated, in case something needs them, but ideally the hooks should be rewritten to use the new API as much as possible. The hooked texture has been renamed from just NAME to NAME_raw to make script authors notice the change (and also deemphasize direct texture access). This is also a step towards getting rid of the use_integer pass.
* vo_opengl: make the screen blue on shader errorsGravatar Niklas Haas2016-05-15
| | | | | This helps visually signify that somthing went wrong, and prevents confusing shader compilation errors with other types of bugs.
* vo_opengl: use RPN expressions for user hook sizesGravatar Niklas Haas2016-05-15
| | | | | | | | | This replaces the previous TRANSFORM by WIDTH, HEIGHT and OFFSET where WIDTH and HEIGHT are RPN expressions. This allows for more fine-grained control over the output size, and also makes sure that overwriting existing textures works more cleanly. (Also add some more useful bstr functions)
* vo_opengl: support external user hooksGravatar Niklas Haas2016-05-15
| | | | | | | | | | | This allows users to add their own near-arbitrary hooks to the vo_opengl processing pipeline, greatly enhancing the flexibility of user shaders. This enables, among other things, user shaders such as CrossBilateral, SuperRes, LumaSharpen and many more. To make parsing the user shaders easier, shaders are now loaded as bstrs, and the hooks are set up during video reconfig instead of on every single frame.
* vo_opengl: add optional hook pointsGravatar Niklas Haas2016-05-15
| | | | | | | | | | | | | | These are "sequence points" where the image could be rendered out to an FBO, hooked, and re-loaded if any such hook exists. This is perfect for things like the current user shaders system, as well as optional effects like unsharp masking. Note that since we have to pick *some* FBO to store the optionally hooked texture, we just store it in an array indexed by an increasing counter. Since we only ever store as many as MAX_TEXTURE_HOOKS + all internal hook points entries, this is guaranteed to be enough space. This commit also removes some of the now unused FBOs.
* vo_opengl: add hooks and rework pass_read_videoGravatar Niklas Haas2016-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hook mechanism allows arbitrary processing stages to get dispatched whenever certain named textures have been "finalized" by the code. This is mostly meant to serve as a change that opens up the internal processing in pass_read_video to user scripts, but as a side benefit all of the code dealing with offsets and plane alignment and other such confusing things has been rewritten. This hook mechanism is powerful enough to cover the needs of both debanding and prescaling (and more), so as a result they can be removed from pass_read_video entirely and implemented through hooks. Some avenues for optimization: - The prescale hook is currently somewhat distributed code-wise. It might be cleaner to split it into superxbr and NNEDI3 hooks which can each be self-contained. - It might be possible to move a large part of the hook code out to an external file (including the hook definitions for debanding and prescaling), which would be very much desired. - Currently, some stages (chroma merging, integer conversion) will *always* run even if unnecessary. I'm planning another series of refactors (deferred img_tex) to allow dropping unnecessary shader stages like these, but that's probably some ways away. In the meantime it would be doable to re-add some of the logic to skip these stages if we know we don't need them. - More hook locations could be added (?)
* vo_opengl: minor change to scaler_resizes_onlyGravatar Niklas Haas2016-05-15
| | | | | | Instead of rounding down, we round to the nearest float. This reduces the maximum possible error introduced by this rounding operation. Also clarify the comment.
* vaapi: avoid forward declaration of variableGravatar wm42016-05-15
| | | | Why is everything so horrible.
* lua: add timer:is_enabled() functionGravatar Julian2016-05-14
| | | | | Allows to query if some timer is currently running or was stopped/killed.
* vo_opengl: remove some pointless compatibilityGravatar wm42016-05-14
| | | | | | Remove non-texture_rg compatibility from LUT sampling. OpenGL without texture_rg support will always trigger dumb-mode, and dumb-mode does not use LUTs. It used not to, and that was when this made sense.
* ytdl_hook: Just check if protocol is rtmpGravatar Ricardo Constantino2016-05-14
| | | | Partial fix to #3090
* vo_opengl: partially fix 0bgr format supportGravatar wm42016-05-13
| | | | | | | | | | | | | | | | | | | Fixes broken colors with --vf=format=0bgr (but only if deband is disabled). 0bgr means the first byte is padding, while the following three bytes are bgr. From the vo_opengl perspective, it has 4 physical components with 3 logical components. copy_img_tex() simply copied 3 components from the physical representation, which means the last component (r) was sliced off. Fix this by not using p->color_swizzle for packed formats, and instead let packed formats set the per-plane swizzle in texplane.swizzle. The latter applies the swizzle as part of operation in copy_img_tex(), which essentially moves physical to logical representations. Unfortunately, debanding (and thus with opengl-hq defaults) is still broken.
* vo_opengl: drop duplicate LUMINANCE_ALPHA handlingGravatar wm42016-05-13
| | | | | | This was supposed to handle the absence of GL_ARB_texture_rg. But it's already handled elsewhere. (init_format() sets texplane.swizzle accordingly.)
* vo_opengl: minor simplificationGravatar wm42016-05-13
| | | | | | | | Make the find_plane_format function take a bit count. This also makes the function's comment true for the first time the function and its comment exist. (It was commented as taking bits, but always took bytes.)
* vo_opengl: restrict ES2 FBO formatsGravatar wm42016-05-13
| | | | | | | | | Only a few very low bit depth internal formats can be rendered to in pure ES2 (GL_RGB565 is the "best" one). Seems like the only potentially reasonable renderable formats in ES2 could be provided via GL_OES_rgb8_rgba8, or half-floats, so don't bother with this at all.
* vo_opengl: angle: log extension stringGravatar wm42016-05-13
|
* cache: simplify speed calculationsGravatar wm42016-05-12
| | | | | | | | | | Remove the attempted cleverness; keep it dumb. This strictly calculates the average speed over an at least 1 second window (longer if I/O blocks it). Since this doesn't reset the speed anymore when reading stops by going idle, the results might actually be more accurate now.
* travis: move travis-deps script to TOOLSGravatar wm42016-05-12
| | | | Don't let it clutter the top level directory.
* vo_opengl: slightly better FBO format checkGravatar wm42016-05-12
| | | | | | | | | | | Now that we know in advance whether an implementation should support a specific format, we have more flexibility when determining which format to use. In particular, we can drop the roundabout ES logic. I'm not sure if actually trying to create the FBO for probing still has any value. But it might, so leave it for now.
* vo_opengl: disable scalers on ES2Gravatar wm42016-05-12
| | | | | | | | Even if everything else is available, the need for first class arrays breaks it. In theory we could fix this since we don't strictly need them, but I guess it's not worth bothering. Also give the misnamed have_mix variable a slightly better name.
* vo_opengl: add detection for the ES texture_rg extensionGravatar wm42016-05-12
|
* vo_opengl: reorganize texture format handlingGravatar wm42016-05-12
| | | | | | | | | | | | | This merges all knowledge about texture format into a central table. Most of the work done here is actually identifying which formats exactly are supported by OpenGL(ES) under which circumstances, and keeping this information in the format table in a somewhat declarative way. (Although only to the extend needed by mpv.) In particular, ES and float formats are a horrible mess. Again this is a big refactor that might cause regression on "obscure" configurations.
* vo_opengl: correctly disable interpolation if tscale can't be usedGravatar wm42016-05-12
| | | | It'll fail with an assertion in the interpolation code otherwise.
* Add Appveyor CI integration for Windows buildsGravatar James Ross-Gowan2016-05-12
|
* vo_opengl: angle: dump translated shadersGravatar wm42016-05-12
| | | | Helpful for debugging and such.
* manpage: document missing sub-propertiesGravatar wm42016-05-11
| | | | | This is the client-API part; the normal descriptions are present in the text above.
* vo_opengl: don't use dumb-mode with 10 bit integer texture hackGravatar wm42016-05-11
| | | | | Recent regression. Caused it to use dumb-mode with integer textures, which on ANGLE leads to nearest scaling.
* vo_opengl: fix NULL deref on certain init failuresGravatar wm42016-05-11
|
* video: add --hwdec=auto-copy modeGravatar wm42016-05-11
| | | | | | | | This uses the normal autoprobing rules like "auto", but rejects anything that isn't flagged as copying data back to system memory. The chunk in command.c was dead code, so remove it instead of updating it.
* manpage: unmark d3d11va as "experimental"Gravatar wm42016-05-11
| | | | Also add missing mediacodec entry.
* vo_opengl: d3d11egl: support full range YUVGravatar wm42016-05-11
| | | | | | | | | MSDN documents this as "Introduced in Windows 8.1.". I assume on Windows 7 this field will simply be ignored. Too bad for Windows 7 users. Also, I'm not using D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 and D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255, because these are apparently completely missing from the MinGW headers. (Such a damn pain.)
* vo_opengl: d3d11egl: don't require EGL_EXT_device_queryGravatar wm42016-05-11
| | | | | | | Older ANGLE builds don't export this. This change is really only for convenience, and I might revert it at some later point.
* build: merge d3d11va and dxva2 hwaccel checksGravatar wm42016-05-11
| | | | | | We don't have any reason to disable either. Both are loaded dynamically at runtime anyway. There is also no reason why dxva2 would disappear from libavcodec any time soon.
* vo_opengl: angle: dynamically load ANGLEGravatar wm42016-05-11
| | | | | | | | | | | | ANGLE is _really_ annoying to build. (Requires special toolchain and a recent MSVC version.) This results in various issues with people having trouble to build mpv against ANGLE (apparently linking it against a prebuilt binary doesn't count, or using binaries from potentially untrusted sources is not wanted). Dynamically loading ANGLE is going to be a huge convenience. This commit implements this, with special focus on keeping it source compatible to a normal build with ANGLE linked at build-time.