summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/lcms.c
Commit message (Collapse)AuthorAgeFilesLines
* vo_gpu: add missing PL_COLOR_TRC_ST428 case in lcmsKacper Michajłow2024-03-011-0/+5
|
* various: avoid function pointer castsKacper Michajłow2024-02-281-2/+1
| | | | | | | | | | | | | The opt validator functions are casted to generic validator, which has erased type for value. Calling function by pointer of different definition is an UB. Avoid that by generating wrapper function that does proper argument type conversion and calls validator function. Type erased functions have mangled type in the name. Fixes UBSAN failures on Clang 17, which enabled fsanitize=function by default.
* csputils: replace more primitives with pl_Kacper Michajłow2024-01-221-7/+7
| | | | | We can go deeper, but need to stop somewhere to not reimplement vo_gpu using libplacebo...
* csputils: replace mp_colorspace with pl_color_spaceKacper Michajłow2024-01-221-20/+20
|
* options: remove ancient option fallbacks/deprecationDudemanguy2023-09-211-2/+0
| | | | | | | | | | | | | We've got an ungodly amount of OPT_REPLACED and OPT_REMOVED sitting around in the code. This is harmless, but the vast majority of these are ancient. 26f4f18c0629998a9b91e94722d166866d8b80a3 is the last commit that touched the majority of these and of course that only changed how options were declared so all of this stuff was deprecated even before that. No use in keeping these, so just delete them all. As an aside, there was actually a cocoa_opts but it had only a single option which was replaced by something else and empty otherwise. So that entire thing was just simply removed. OPT_REPLACED/OPT_REMOVED declarations that were added in 0.35 or later were kept as is.
* vo_gpu: vo_gpu_next: support --icc-3dlut-size=autoNiklas Haas2023-09-151-1/+7
| | | | | | | | | | | | And make it the default. In libplacebo, this uses internal heuristics to pick a good size based on the actual ICC characteristics. This is significantly less wasteful than always generating a 64x64x64 3DLUT (the old status quo). In vo_gpu, for simplicity, just default to 65x65x65. Note that this provides slightly better accuracy than the old default of 64x64x64 for technical reasons, and matches what libplacebo defaults to for typical display profiles.
* various: correctly ignore cache files with --no-configDudemanguy2023-07-061-6/+7
| | | | | | | | | | | | --no-config should prevent loading user files of any type: configs, cache, etc. For cache files, this case wasn't properly handled and it was assumed they would always get something. vo_gpu's shader cache actually already handles this, so it was left untouched. In theory, demuxer cache should never have this issue because saving it to disk is disabled by default (and likely that will never change), but go ahead and change it for consistency's sake. Fixes some segfaults with --no-config and various combinations of settings (particularly --vo=gpu-next).
* vo_gpu/vo_gpu_next: enable gpu shader and icc cache by defaultDudemanguy2023-07-041-0/+1
| | | | | | | | | | | 4502522a7aee093c923e79a65e4684ea2634af30 changed the way mpv handled and saved cached files. In particular, it made a separate boolean option for actually enabling cache and left the *-dir options as purely just a path (i.e. having a dir set didn't mean you save cache). This technically regressed people's configs, so let's just turn the cache on by default. Linux users already expect random stuff in ~/.cache and well everyone else can just live with some files possibly appearing in their config directory.
* vo_gpu: fix some cache related memory leaksDudemanguy2023-07-041-2/+2
| | | | I goofed this up.
* vo_gpu_next: allow to use ICC profile luminance valueKacper Michajłow2023-05-131-0/+1
| | | | | | Also while at it respect target-peak option when ICC profile is used. Fixes #11449
* player: use XDG_CACHE_HOME by defaultDudemanguy2023-05-091-3/+9
| | | | | | | | | | | | This adds cache as a possible path for mpv to internally pick (~/.cache/mpv for non-darwin unix-like systems, the usual config directory for everyone else). For gpu shader cache and icc cache, controlling whether or not to write such files is done with the new --gpu-shader-cache and --icc-cache options respectively. Additionally, --cache-on-disk no longer requires explicitly setting the --cache-dir option. The old options, --cache-dir, --gpu-shader-cache-dir, and --icc-cache-dir simply set an override for the directory to save cache files. If unset, then the cache is saved in XDG_CACHE_HOME.
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-211-2/+2
| | | | | | c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
* various: replace if + abort() with MP_HANDLE_OOM()sfan52023-01-121-4/+2
| | | | | MP_HANDLE_OOM also aborts but calls assert() first, which will result in an useful message if compiled in debug mode.
* lcms: fix validate_3dlut_size_optNiklas Haas2022-11-211-4/+1
| | | | | Not only was this function needlessly convoluted, it was also broken - since it returned a bool value where an error code was expected.
* lcms: always parse lcms2-related optionsNiklas Haas2022-11-211-40/+34
| | | | | | | | | | | | | | Currently, the lcms-related options are only defined when lcms2 is enabled at build time. However, this causes issues (e.g. segfault) for vo_gpu_next, which relies on the presence of these options (to forward them to libplacebo). (That libplacebo internally depends on lcms2 as well is an implementation detail - compiling mpv *without* lcms against libplacebo *with* lcms should be possible in principle) Fixes: #10891 Closes: #10856
* vo_gpu: fix 3DLUT precisionNiklas Haas2022-07-151-2/+3
| | | | | | | | | | | | | Using cmsFLAGS_HIGHRESPRECALC results in Little-CMS generating an internal 49x49x49 3DLUT, from which it then samples our own 3DLUT. This is completely pointless and not only destroys the accuracy of the 3DLUT, but also results in no additional gain from increasing the 3DLUT precision further. The correct flag for us to be using is cmsFLAGS_NOOPTIMIZE, which suppresses this internal 3DLUT generation and gives us the full precision. We can also specify cmsFLAGS_NOCACHE, which is negligible but in theory prevents Little-CMS from unnecessary pixel equality tests.
* vo_gpu: lift ra_ctx_* opts to a global structNiklas Haas2021-11-031-14/+2
| | | | So I can re-use them for vo_gpu_next.
* vo_gpu: replace --icc-contrast by --icc-force-contrastNiklas Haas2021-05-261-41/+40
| | | | | | | | | | | | | | Not only does this have semantics that make far more sense, it also has a default that makes far more sense. (Equivalent to the old `icc-contrast=inf`) This removes the weird 1000:1 contrast default assumption which especially broke perceptual profiles and also screws things up for OLED/CRT/etc. Should probably close some issues but I honestly can't be bothered to figure out which of the thousands colorimetry-related issues are affected.
* options: Make validation and help possible for all option typesPhilip Langdale2021-03-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, validation is only possible for string type options. But there's no particular reason why it needs to be restricted in this way, and there are potential uses, to allow other options to be validated without forcing the option to have to reimplement parsing from scratch. The first part, simply making the validation function an explicit field instead of overloading priv is simple enough. But if we only do that, then the validation function still needs to deal with the raw pre-parsed string. Instead, we want to allow the value to be parsed before it is validated. That in turn leads to us having validator functions that should be type aware. Unfortunately, that means we need to keep the explicit macro like OPT_STRING_VALIDATE() as a way to enforce the correct typing of the function. Otherwise, we'd have to have the validator take a void * and hope the implementation can cast it correctly. For help, we don't have this problem, as help doesn't look at the value. Then, we turn validators that are really help generators into explicit help functions and where a validator is help + validation, we split them into two parts. I have, however, left functions that need to query information for both help and validation as single functions to avoid code duplication. In this change, I have not added an other OPT_FOO_VALIDATE() macros as they are not needed, but I will add some in a separate change to illustrate the pattern.
* options: change option macros and all option declarationswm42020-03-181-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all OPT_* macros such that they don't define the entire m_option initializer, and instead expand only to a part of it, which sets certain fields. This requires changing almost every option declaration, because they all use these macros. A declaration now always starts with {"name", ... followed by designated initializers only (possibly wrapped in macros). The OPT_* macros now initialize the .offset and .type fields only, sometimes also .priv and others. I think this change makes the option macros less tricky. The old code had to stuff everything into macro arguments (and attempted to allow setting arbitrary fields by letting the user pass designated initializers in the vararg parts). Some of this was made messy due to C99 and C11 not allowing 0-sized varargs with ',' removal. It's also possible that this change is pointless, other than cosmetic preferences. Not too happy about some things. For example, the OPT_CHOICE() indentation I applied looks a bit ugly. Much of this change was done with regex search&replace, but some places required manual editing. In particular, code in "obscure" areas (which I didn't include in compilation) might be broken now. In wayland_common.c the author of some option declarations confused the flags parameter with the default value (though the default value was also properly set below). I fixed this with this change.
* video: add pure gamma TRC curves for 2.0, 2.4 and 2.6.Wessel Dankers2019-09-271-0/+3
|
* lcms: allow infinite contrastzc622019-03-091-1/+1
| | | | Fixes #5980
* vo_gpu: allow higher icc-contrast and improve loggingNiklas Haas2018-05-171-2/+3
| | | | | | | | | | With the advent of actual HDR devices, my real measured ICC profile has an "infinite" contrast, since the display is completely off on pure black inputs. 100k:1 might not be enough, so let's just bump it up to 1m:1 to be safe. Also, improve the logging in the case that the detected contrast is too high by default.
* Fix various typos in log messagesNicolas F2017-12-031-1/+1
|
* vo_opengl: refactor into vo_gpuNiklas Haas2017-09-211-0/+531
This is done in several steps: 1. refactor MPGLContext -> struct ra_ctx 2. move GL-specific stuff in vo_opengl into opengl/context.c 3. generalize context creation to support other APIs, and add --gpu-api 4. rename all of the --opengl- options that are no longer opengl-specific 5. move all of the stuff from opengl/* that isn't GL-specific into gpu/ (note: opengl/gl_utils.h became opengl/utils.h) 6. rename vo_opengl to vo_gpu 7. to handle window screenshots, the short-term approach was to just add it to ra_swchain_fns. Long term (and for vulkan) this has to be moved to ra itself (and vo_gpu altered to compensate), but this was a stop-gap measure to prevent this commit from getting too big 8. move ra->fns->flush to ra_gl_ctx instead 9. some other minor changes that I've probably already forgotten Note: This is one half of a major refactor, the other half of which is provided by rossy's following commit. This commit enables support for all linux platforms, while his version enables support for all non-linux platforms. Note 2: vo_opengl_cb.c also re-uses ra_gl_ctx so it benefits from the --opengl- options like --opengl-early-flush, --opengl-finish etc. Should be a strict superset of the old functionality. Disclaimer: Since I have no way of compiling mpv on all platforms, some of these ports were done blindly. Specifically, the blind ports included context_mali_fbdev.c and context_rpi.c. Since they're both based on egl_helpers, the port should have gone smoothly without any major changes required. But if somebody complains about a compile error on those platforms (assuming anybody actually uses them), you know where to complain.