File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1111,6 +1111,16 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame)
1111
1111
hint .transfer = opts -> target_trc ;
1112
1112
if (opts -> target_peak )
1113
1113
hint .hdr .max_luma = opts -> target_peak ;
1114
+ // If tone mapping is required, adjust maxCLL and maxFALL.
1115
+ if (source -> hdr .max_luma > hint .hdr .max_luma ) {
1116
+ // Set maxCLL to the target luminance if it's not already lower.
1117
+ if (!hint .hdr .max_cll || hint .hdr .max_luma < hint .hdr .max_cll || opts -> tone_map .inverse )
1118
+ hint .hdr .max_cll = hint .hdr .max_luma ;
1119
+ // There's no reliable way to estimate maxFALL here.
1120
+ // Scaling it linearly with max_luma would be inaccurate, depending
1121
+ // on tone mapping curve. Just reset it to 0.
1122
+ hint .hdr .max_fall = 0 ;
1123
+ }
1114
1124
apply_target_contrast (p , & hint , hint .hdr .min_luma );
1115
1125
if (!pass_colorspace )
1116
1126
pl_swapchain_colorspace_hint (p -> sw , & hint );
You can’t perform that action at this time.
0 commit comments