mirror of
https://github.com/mpv-player/mpv
synced 2025-03-30 07:18:17 +00:00
vo_opengl: avoid redundant double-gamma conversion
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)
This commit is contained in:
parent
f81f486c68
commit
3cfe98c684
@ -2506,15 +2506,15 @@ static void pass_render_frame(struct gl_video *p)
|
||||
rect.ml *= scale[0]; rect.mr *= scale[0];
|
||||
rect.mt *= scale[1]; rect.mb *= scale[1];
|
||||
// We should always blend subtitles in non-linear light
|
||||
if (p->use_linear)
|
||||
if (p->use_linear) {
|
||||
pass_delinearize(p->sc, p->image_params.gamma);
|
||||
p->use_linear = false;
|
||||
}
|
||||
finish_pass_fbo(p, &p->blend_subs_fbo, p->texture_w, p->texture_h,
|
||||
FBOTEX_FUZZY);
|
||||
pass_draw_osd(p, OSD_DRAW_SUB_ONLY, vpts, rect,
|
||||
p->texture_w, p->texture_h, p->blend_subs_fbo.fbo, false);
|
||||
pass_read_fbo(p, &p->blend_subs_fbo);
|
||||
if (p->use_linear)
|
||||
pass_linearize(p->sc, p->image_params.gamma);
|
||||
}
|
||||
|
||||
pass_opt_hook_point(p, "SCALED", NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user