aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dovi_rpu.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-03-22 21:25:35 +0100
committerNiklas Haas <git@haasn.dev>2024-04-22 12:17:05 +0200
commit2a99d3527bb5c9195292ea3b9496ca1bfb5d066b (patch)
treed00e58c219690ff6c56c01453a1a229f8c1e5271 /libavcodec/dovi_rpu.h
parentdbfd979c1b7f08d7309d227165812226755cc41c (diff)
downloadffmpeg-2a99d3527bb5c9195292ea3b9496ca1bfb5d066b.tar.gz
avcodec/dovi_rpu: expose guess_profile(), clarify semantics
To allow internally re-using it for both the encoder and decoder. This is based on HEVC only, H.264/AV1 use their own (hopefully correctly signalled) profiles (and in particular, the AV1 decoders implicitly default the correct profile in the absence of a configuration record).
Diffstat (limited to 'libavcodec/dovi_rpu.h')
-rw-r--r--libavcodec/dovi_rpu.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/dovi_rpu.h b/libavcodec/dovi_rpu.h
index 9a68e45bf1..a866bbfebe 100644
--- a/libavcodec/dovi_rpu.h
+++ b/libavcodec/dovi_rpu.h
@@ -87,6 +87,10 @@ void ff_dovi_ctx_flush(DOVIContext *s);
* DOVIContext struct.
*
* Returns 0 or an error code.
+ *
+ * Note: `DOVIContext.cfg` should be initialized before calling into this
+ * function. If not done, the profile will be guessed according to HEVC
+ * semantics.
*/
int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size,
int err_recognition);
@@ -96,4 +100,11 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size,
*/
int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame);
+/**
+ * Internal helper function to guess the correct DV profile for HEVC.
+ *
+ * Returns the profile number or 0 if unknown.
+ */
+int ff_dovi_guess_profile_hevc(const AVDOVIRpuDataHeader *hdr);
+
#endif /* AVCODEC_DOVI_RPU_H */