summaryrefslogtreecommitdiff
path: root/libavcodec/av1.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-17 01:54:22 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-24 18:33:18 +0200
commita367e435d816dfe6939ab9932e87c089fb1f3f73 (patch)
treec0b3fdcfb8745cc11f2803df1be6e36e5214795a /libavcodec/av1.h
parent67eea6cf026a70940ea402d54685d67c660b49cd (diff)
downloadffmpeg-a367e435d816dfe6939ab9932e87c089fb1f3f73.tar.gz
avcodec/av1: Add upper bound for the size of a sane sequence header
It will be used by the Matroska muxer to reserve a certain number of bytes for the CodecPrivate in case no extradata is initially available (as it is for the libaom-av1 encoder). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/av1.h')
-rw-r--r--libavcodec/av1.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/av1.h b/libavcodec/av1.h
index 951a18ecb2..384f7cddc7 100644
--- a/libavcodec/av1.h
+++ b/libavcodec/av1.h
@@ -175,4 +175,10 @@ enum {
AV1_RESTORE_SWITCHABLE = 3,
};
+// Sequence Headers are actually unbounded because one can use
+// an arbitrary number of leading zeroes when encoding via uvlc.
+// The following estimate is based around using the lowest number
+// of bits for uvlc encoding.
+#define AV1_SANE_SEQUENCE_HEADER_MAX_BITS 3138
+
#endif /* AVCODEC_AV1_H */