File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1111,6 +1111,21 @@ 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
+ // max_cll is not used in tone mapping, set it to source value.
1115
+ if (!hint .hdr .max_cll )
1116
+ hint .hdr .max_cll = source -> hdr .max_cll ;
1117
+ // If tone mapping is required, adjust maxCLL and maxFALL.
1118
+ if (source -> hdr .max_luma > hint .hdr .max_luma || opts -> tone_map .inverse ) {
1119
+ // Set maxCLL to the target luminance if it's not already lower.
1120
+ if (!hint .hdr .max_cll || hint .hdr .max_luma < hint .hdr .max_cll || opts -> tone_map .inverse )
1121
+ hint .hdr .max_cll = hint .hdr .max_luma ;
1122
+ // There's no reliable way to estimate maxFALL here.
1123
+ // Scaling it linearly with max_luma would be inaccurate, depending
1124
+ // on tone mapping curve. Just reset it to 0.
1125
+ hint .hdr .max_fall = 0 ;
1126
+ }
1127
+ if (!hint .hdr .max_cll && hint .hdr .max_fall > hint .hdr .max_cll )
1128
+ hint .hdr .max_fall = 0 ;
1114
1129
apply_target_contrast (p , & hint , hint .hdr .min_luma );
1115
1130
if (!pass_colorspace )
1116
1131
pl_swapchain_colorspace_hint (p -> sw , & hint );
You can’t perform that action at this time.
0 commit comments