summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-09-02 20:32:13 +0200
committerNiklas Haas <git@haasn.dev>2023-09-02 22:22:54 +0200
commit67368ac5d207a72dcec1488e112af00198c650db (patch)
tree47ce8b13dde139cd0a1e886f6d11a8aba4972f74 /video
parente6afc53e7cabf7d36aab4a8b25a6e2688e4449c8 (diff)
downloadmpv-67368ac5d207a72dcec1488e112af00198c650db.tar.bz2
mpv-67368ac5d207a72dcec1488e112af00198c650db.tar.xz
vo_gpu_next: don't rotate gamut visualization
Causes bad performance with interpolation because the changing hue angle invalidates the mixing cache, as a result of libplacebo implementations (specifically, the fact that this graph is drawn during the color management process, instead of as a separate overlay). Fix it by just hard-coding a particular, relatively interesting plane (pi/4 approximately maps onto the red-blue axis).
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_gpu_next.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index c598cca3c8..4edfd1ace0 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -913,8 +913,7 @@ static void apply_crop(struct pl_frame *frame, struct mp_rect crop,
}
static void update_tm_viz(struct pl_color_map_params *params,
- const struct pl_frame *target,
- double pts)
+ const struct pl_frame *target)
{
if (!params->visualize_lut)
return;
@@ -930,9 +929,8 @@ static void update_tm_viz(struct pl_color_map_params *params,
.y1 = size / out_h,
};
- // Complete one full rotation of the hue plane every 10 seconds
- const float tm_period = 10.0;
- params->visualize_hue = 2 * M_PI * pts / tm_period;
+ // Visualize red-blue plane
+ params->visualize_hue = M_PI / 4.0;
}
static void draw_frame(struct vo *vo, struct vo_frame *frame)
@@ -1023,6 +1021,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
(frame->current && opts->blend_subs) ? OSD_DRAW_OSD_ONLY : 0,
PL_OVERLAY_COORDS_DST_FRAME, &p->osd_state, &target);
apply_crop(&target, p->dst, swframe.fbo->params.w, swframe.fbo->params.h);
+ update_tm_viz(&pars->color_map_params, &target);
struct pl_frame_mix mix = {0};
if (frame->current) {
@@ -1038,7 +1037,6 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
// initialization, but pl_queue does not like these. Hard-clamp as
// a simple work-around.
qparams.pts = p->last_pts = MPMAX(qparams.pts, p->last_pts);
- update_tm_viz(&pars->color_map_params, &target, qparams.pts);
switch (pl_queue_update(p->queue, &mix, &qparams)) {
case PL_QUEUE_ERR:
@@ -1348,7 +1346,7 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
apply_crop(&image, src, mpi->params.w, mpi->params.h);
apply_crop(&target, dst, fbo->params.w, fbo->params.h);
- update_tm_viz(&pars->color_map_params, &target, p->last_pts);
+ update_tm_viz(&pars->color_map_params, &target);
int osd_flags = 0;
if (!args->subs)