Skip to content

Commit

Permalink
tone_mapping: don't use BT.2446a for HDR<->HDR conversions
Browse files Browse the repository at this point in the history
This is designed for SDR<->HDR, so prevent using it for HDR<->HDR out of
the box.
  • Loading branch information
haasn committed Feb 17, 2023
1 parent efcc1e5 commit 4d26b3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tone_mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void pl_tone_map_params_infer(struct pl_tone_map_params *par)
} else if (src_max < 1 + 1e-3 && dst_max < 1 + 1e-3) {
// SDR<->SDR range conversion, use linear light stretching
par->function = &pl_tone_map_linear;
} else if (fmaxf(ratio, 1 / ratio) > 2) {
} else if (fmaxf(ratio, 1 / ratio) > 2 && fminf(src_max, dst_max) < 1.5f) {
// Reasonably ranged HDR<->SDR conversion, pick BT.2446a since it
// was designed for this task
par->function = &pl_tone_map_bt2446a;
Expand Down

0 comments on commit 4d26b3d

Please sign in to comment.