vf_format: add vf=format=enhancement-layer option

This commit is contained in:
Kacper Michajłow committed 2026-07-01 04:46:42 +02:00
1 parent 6c4480cbfd
commit 0480011ac4
3 files changed
+13

No files matched your search

+1
View File
@@ -0,0 +1 @@
add `vf=format=enhancement-layer` option
+6
View File
@@ -323,6 +323,12 @@ Available mpv-only filters are:
Whether or not to include HDR10+ metadata (default: yes). If
disabled, any HDR10+ metadata will be stripped from frames.
``<enhancement-layer=yes|no>``
Whether or not to apply the image enhancement layer (default: yes).
If disabled, the enhancement-layer frame paired with each base-layer
frame is discarded. Currently this controls Dolby Vision Profile 7 FEL
application.
``<min-luma>``
Set the minimum luminance value for the mastering display metadata.
This is a float value in nits (cd/m²).
+6
View File
@@ -61,6 +61,7 @@ struct vf_format_opts {
int force_scaler;
bool dovi;
bool hdr10plus;
bool enhancement_layer;
float min_luma;
float max_luma;
float max_cll;
@@ -187,6 +188,9 @@ static void vf_format_process(struct mp_filter *f)
});
}
if (!priv->opts->enhancement_layer)
mp_image_unrefp(&img->enhancement_layer);
if (!priv->opts->hdr10plus) {
memset(img->params.color.hdr.scene_max, 0,
sizeof(img->params.color.hdr.scene_max));
@@ -269,6 +273,7 @@ static const m_option_t vf_opts_fields[] = {
{"dar", OPT_DOUBLE(dar)},
{"convert", OPT_BOOL(convert)},
{"dolbyvision", OPT_BOOL(dovi)},
{"enhancement-layer", OPT_BOOL(enhancement_layer)},
{"hdr10plus", OPT_BOOL(hdr10plus)},
{"min-luma", OPT_FLOAT(min_luma), M_RANGE(0, 10000)},
{"max-luma", OPT_FLOAT(max_luma), M_RANGE(0, 10000)},
@@ -290,6 +295,7 @@ const struct mp_user_filter_entry vf_format = {
.priv_defaults = &(const OPT_BASE_STRUCT){
.rotate = -1,
.dovi = true,
.enhancement_layer = true,
.hdr10plus = true,
.film_grain = true,
},