mirror of
https://github.com/mpv-player/mpv
synced 2024-11-14 22:48:35 +01:00
2dcf18c0c0
This commit refactors the 3DLUT loading mechanism to build the 3DLUT against the original source characteristics of the file. This allows us, among other things, to use a real BT.1886 profile for the source. This also allows us to actually use perceptual mappings. Finally, this reduces errors on standard gamut displays (where the previous 3DLUT target of BT.2020 was unreasonably wide). This also improves the overall accuracy of the 3DLUT due to eliminating rounding errors where possible, and allows for more accurate use of LUT-based ICC profiles. The current code is somewhat more ugly than necessary, because the idea was to implement this commit in a working state first, and then maybe refactor the profile loading mechanism in a later commit. Fixes #2815.
33 lines
855 B
C
33 lines
855 B
C
#ifndef MP_GL_LCMS_H
|
|
#define MP_GL_LCMS_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
#include "misc/bstr.h"
|
|
|
|
extern const struct m_sub_options mp_icc_conf;
|
|
|
|
struct mp_icc_opts {
|
|
char *profile;
|
|
int profile_auto;
|
|
char *cache_dir;
|
|
char *size_str;
|
|
int intent;
|
|
};
|
|
|
|
struct lut3d;
|
|
struct mp_log;
|
|
struct mpv_global;
|
|
struct gl_lcms;
|
|
|
|
struct gl_lcms *gl_lcms_init(void *talloc_ctx, struct mp_log *log,
|
|
struct mpv_global *global);
|
|
void gl_lcms_set_options(struct gl_lcms *p, struct mp_icc_opts *opts);
|
|
void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr *profile);
|
|
bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **,
|
|
enum mp_csp_prim prim, enum mp_csp_trc trc);
|
|
bool gl_lcms_has_changed(struct gl_lcms *p, enum mp_csp_prim prim,
|
|
enum mp_csp_trc trc);
|
|
|
|
#endif
|