History

vf_format: add hdr10plus sub-parameter to format video filter

Kacper Michajłow committed 2 years ago

Commit 024edb21 parent d9c1e9b3 files · +15 −0Browse files

Unified · Split

3 files
  1. DOCS/interface-changes.rst +1 −0
  2. DOCS/man/vf.rst +4 −0
  3. video/filter/vf_format.c +10 −0
DOCS/interface-changes.rst+1−0
@@ -62,6 +62,7 @@ Interface changes · 61 unmodified lines
6262 over blending alpha components into specific background types
6363 - add `--border-background` option
6464 - add `video-target-params` property
65+ - add `hdr10plus` sub-parameter to `format` video filter
6566 --- mpv 0.37.0 ---
6667 - `--save-position-on-quit` and its associated commands now store state files
6768 in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.
DOCS/man/vf.rst+4−0
@@ -316,6 +316,10 @@ Available mpv-only filters are: · 315 unmodified lines
316316 Whether or not to include Dolby Vision metadata (default: yes). If
317317 disabled, any Dolby Vision metadata will be stripped from frames.
318318
319+ ``<hdr10plus=yes|no>``
320+ Whether or not to include HDR10+ metadata (default: yes). If
321+ disabled, any HDR10+ metadata will be stripped from frames.
322+
319323 ``<film-grain=yes|no>``
320324 Whether or not to include film grain metadata (default: yes). If
321325 disabled, any film grain metadata will be stripped from frames.
video/filter/vf_format.c+10−0
@@ -60,6 +60,7 @@ struct vf_format_opts { · 59 unmodified lines
6060 bool convert;
6161 int force_scaler;
6262 bool dovi;
63+ bool hdr10plus;
6364 bool film_grain;
6465 };
6566
@@ -178,6 +179,13 @@ static void vf_format_process(struct mp_filter *f) · 112 unmodified lines
178179 });
179180 }
180181
182+ if (!priv->opts->hdr10plus) {
183+ memset(img->params.color.hdr.scene_max, 0,
184+ sizeof(img->params.color.hdr.scene_max));
185+ img->params.color.hdr.scene_avg = 0;
186+ img->params.color.hdr.ootf = (struct pl_hdr_bezier){0};
187+ }
188+
181189 if (!priv->opts->film_grain)
182190 av_buffer_unref(&img->film_grain);
183191
@@ -240,6 +248,7 @@ static const m_option_t vf_opts_fields[] = { · 56 unmodified lines
240248 {"dar", OPT_DOUBLE(dar)},
241249 {"convert", OPT_BOOL(convert)},
242250 {"dolbyvision", OPT_BOOL(dovi)},
251+ {"hdr10plus", OPT_BOOL(hdr10plus)},
243252 {"film-grain", OPT_BOOL(film_grain)},
244253 {"force-scaler", OPT_CHOICE(force_scaler,
245254 {"auto", MP_SWS_AUTO},
@@ -256,6 +265,7 @@ const struct mp_user_filter_entry vf_format = { · 10 unmodified lines
256265 .priv_defaults = &(const OPT_BASE_STRUCT){
257266 .rotate = -1,
258267 .dovi = true,
268+ .hdr10plus = true,
259269 .film_grain = true,
260270 },
261271 .options = vf_opts_fields,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t