util/libav: do not bail on MEL-only RPUs w/EL#286
util/libav: do not bail on MEL-only RPUs w/EL#286intelfx wants to merge 4 commits intohaasn:masterfrom
Conversation
|
diff --git a/src/include/libplacebo/utils/libav_internal.h b/src/include/libplacebo/utils/libav_internal.h
index a754e98b..928d37f6 100644
--- a/src/include/libplacebo/utils/libav_internal.h
+++ b/src/include/libplacebo/utils/libav_internal.h
@@ -925,14 +925,14 @@ PL_LIBAV_API void pl_map_avdovi_metadata(struct pl_color_space *color,
pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NITS, dovi_color->source_min_pq / 4095.0f);
color->hdr.max_luma =
pl_hdr_rescale(PL_HDR_PQ, PL_HDR_NITS, dovi_color->source_max_pq / 4095.0f);
+ }
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(59, 12, 100)
- if ((dovi_ext = av_dovi_find_level(metadata, 1))) {
- color->hdr.max_pq_y = dovi_ext->l1.max_pq / 4095.0f;
- color->hdr.avg_pq_y = dovi_ext->l1.avg_pq / 4095.0f;
- }
-#endif
+ if ((dovi_ext = av_dovi_find_level(metadata, 1))) {
+ color->hdr.max_pq_y = dovi_ext->l1.max_pq / 4095.0f;
+ color->hdr.avg_pq_y = dovi_ext->l1.avg_pq / 4095.0f;
}
+#endif
}
PL_LIBAV_API void pl_frame_map_avdovi_metadata(struct pl_frame *out_frame,which makes it awkward with |
|
Any progress on this issue? Also any progress on NLQ and full FEL implementation? DoviBaker is good now. |
|
After thinking about this. I think the current PR is ok, but we should also add an option to allow using RPU metadata forcefully. I propose to: Remove For example caller code could be then written such that, it allows external option to decide whether to map metadata. if (opts->force_dovi_rpu || pl_can_map_avdovi_metadata(metadata)) {
pl_map_avdovi_metadata(&dst->params.color, &dst->params.repr, (void *)dst->dovi->data, metadata);EDIT: Also |
9a2f6d6 to
e6ebae6
Compare
|
I have split the suggested changes into their own commits just for visibility. I'll squash them back eventually. I'm not sure how to pass pl_options to I did bump the API version, but I'm not sure how I should handle the API semantics change. Do I declare a new function with new semantics and deprecate the old one, or should I leave it as it is now? I also did not change the semantics of the already-deprecated |
7b9e409 to
5e51e0d
Compare
There was a problem hiding this comment.
I have split the suggested changes into their own commits just for visibility. I'll squash them back eventually. I'm not sure how to pass pl_options to
pl_map_avframe_ex(); did I use the right options here or did you mean anything else?
I think using params is fine.
I did bump the API version, but I'm not sure how I should handle the API semantics change. Do I declare a new function with new semantics and deprecate the old one, or should I leave it as it is now?
Which functions would you deprecate?
We could deprecate libdovi usage.
I also did not change the semantics of the already-deprecated
pl_frame_map_avdovi_metadata().
That's fine.
I think the patch is fine, it will change mapping for users that directly map dovi metadata using those API, but we have api version bump and generally preserving some backward compatibility with not mapping this metadata, would require duplicating APIs. I don't think it's worth it.
/cc @haasn
I meant deprecate the current At least that's how they do it in projects with "perfect" API versioning and compat guarantees 🙃 |
|
Updated the mpv counterpart in mpv-player/mpv#14692. |
5e51e0d to
e8faca4
Compare
| PL_LIBAV_API void pl_map_avdovi_metadata(struct pl_color_space *color, | ||
| struct pl_color_repr *repr, | ||
| struct pl_dovi_metadata *dovi, | ||
| const AVDOVIMetadata *metadata); |
There was a problem hiding this comment.
API-wise, I would offer a design like this:
PL_LIBAV_API bool pl_map_avdovi_metadata(..., const AVDOVIMetadata *metadata)With the function returning whether successful. You can run it with color = repr = dovi = NULL to test for support without doing anything.
There was a problem hiding this comment.
I see the idea, but this would be awkward as it stands currently.
pl_map_avdovi_metadata() maps dovi regardless if it is fully supported or not. Meaning, it can be used to "force" part of dovi metadata (without FEL).
So it would do:
pl_map_avdovi_metadata(NULL, NULL, NULL, meta); => false (not fully supported)
pl_map_avdovi_metadata(&color, &repr, &dovi, meta); => true (mapped even if FEL)
Which is not incorrect, but little bit awkward to return false/true with the same meta.
It could return int or enum to be explicit about mapping state, but not sure if that's better?
There was a problem hiding this comment.
Is there anything for me to do here?
meson.build
Outdated
| 7, | ||
| # API version | ||
| { | ||
| '359': 'add pl_avdovi_metadata_supported, lift checks out of pl_map_avdovi_metadata, extend pl_avframe_params', |
There was a problem hiding this comment.
Should merge this in with the actual commits that change the API. (Even if it creates two separate API version bumps; though I would prefer to change all signatures in one go)
Edit: Nvm, I saw that you intend to squash these commits before merge
33cb6f2 to
f0471e9
Compare
f0471e9 to
983713a
Compare
We can still map DV metadata that indicates enhancement layer usage (!disable_residual_flag, Profile 7 and 4) for MEL-only bitstreams, which is indicated by trivial NLQ parameters.
(But not `pl_frame_map_avdovi_metadata()`.) Let caller decide whether they want to map the metadata. This way, the caller can decide whether they want to use the luma and PQ values even despite not having the NLQ curve and the EL actually processed.
983713a to
09b073e
Compare
We can still map DV metadata that indicates enhancement layer usage (!disable_residual_flag, Profile 7 and 4) for MEL-only bitstreams, which is indicated by trivial NLQ parameters.