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
62 over blending alpha components into specific background types62 over blending alpha components into specific background types
63 - add `--border-background` option63 - add `--border-background` option
64 - add `video-target-params` property64 - add `video-target-params` property
65 - add `hdr10plus` sub-parameter to `format` video filter
65 --- mpv 0.37.0 ---66 --- mpv 0.37.0 ---
66 - `--save-position-on-quit` and its associated commands now store state files67 - `--save-position-on-quit` and its associated commands now store state files
67 in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.68 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
316 Whether or not to include Dolby Vision metadata (default: yes). If316 Whether or not to include Dolby Vision metadata (default: yes). If
317 disabled, any Dolby Vision metadata will be stripped from frames.317 disabled, any Dolby Vision metadata will be stripped from frames.
318 318
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
319 ``<film-grain=yes|no>``323 ``<film-grain=yes|no>``
320 Whether or not to include film grain metadata (default: yes). If324 Whether or not to include film grain metadata (default: yes). If
321 disabled, any film grain metadata will be stripped from frames.325 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
60 bool convert;60 bool convert;
61 int force_scaler;61 int force_scaler;
62 bool dovi;62 bool dovi;
63 bool hdr10plus;
63 bool film_grain;64 bool film_grain;
64};65};
65 66
@@ -178,6 +179,13 @@ static void vf_format_process(struct mp_filter *f) · 112 unmodified lines
178 });179 });
179 }180 }
180 181
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
181 if (!priv->opts->film_grain)189 if (!priv->opts->film_grain)
182 av_buffer_unref(&img->film_grain);190 av_buffer_unref(&img->film_grain);
183 191
@@ -240,6 +248,7 @@ static const m_option_t vf_opts_fields[] = { · 56 unmodified lines
240 {"dar", OPT_DOUBLE(dar)},248 {"dar", OPT_DOUBLE(dar)},
241 {"convert", OPT_BOOL(convert)},249 {"convert", OPT_BOOL(convert)},
242 {"dolbyvision", OPT_BOOL(dovi)},250 {"dolbyvision", OPT_BOOL(dovi)},
251 {"hdr10plus", OPT_BOOL(hdr10plus)},
243 {"film-grain", OPT_BOOL(film_grain)},252 {"film-grain", OPT_BOOL(film_grain)},
244 {"force-scaler", OPT_CHOICE(force_scaler,253 {"force-scaler", OPT_CHOICE(force_scaler,
245 {"auto", MP_SWS_AUTO},254 {"auto", MP_SWS_AUTO},
@@ -256,6 +265,7 @@ const struct mp_user_filter_entry vf_format = { · 10 unmodified lines
256 .priv_defaults = &(const OPT_BASE_STRUCT){265 .priv_defaults = &(const OPT_BASE_STRUCT){
257 .rotate = -1,266 .rotate = -1,
258 .dovi = true,267 .dovi = true,
268 .hdr10plus = true,
259 .film_grain = true,269 .film_grain = true,
260 },270 },
261 .options = vf_opts_fields,271 .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