Write AV1 CodecPrivate when outputting WebM.
Per https://github.com/Matroska-Org/matroska-specification/blob/master/codec/av1.md
the presence of the CodecPrivate is mandatory.
STATS_CHANGED:
This change slightly increases the size of all WebM output from aomenc
due to the addition of the CodecPrivate element that contains the AV1
configuration information.
BUG=aomedia:2027
Change-Id: I1e320c9ecfb5e2c8ddb4840deaab2bce16fcbe9a
diff --git a/apps/aomenc.c b/apps/aomenc.c
index 2e5d35c..a9c6f78 100644
--- a/apps/aomenc.c
+++ b/apps/aomenc.c
@@ -1463,8 +1463,9 @@
#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
stream->webm_ctx.stream = stream->file;
- write_webm_file_header(&stream->webm_ctx, cfg, stream->config.stereo_fmt,
- global->codec->fourcc, pixel_aspect_ratio);
+ write_webm_file_header(&stream->webm_ctx, &stream->encoder, cfg,
+ stream->config.stereo_fmt, global->codec->fourcc,
+ pixel_aspect_ratio);
}
#else
(void)pixel_aspect_ratio;
@@ -2153,10 +2154,11 @@
}
FOREACH_STREAM(stream, streams) { setup_pass(stream, &global, pass); }
+ FOREACH_STREAM(stream, streams) { initialize_encoder(stream, &global); }
FOREACH_STREAM(stream, streams) {
open_output_file(stream, &global, &input.pixel_aspect_ratio);
}
- FOREACH_STREAM(stream, streams) { initialize_encoder(stream, &global); }
+
if (strcmp(global.codec->name, "av1") == 0 ||
strcmp(global.codec->name, "av1") == 0) {
// Check to see if at least one stream uses 16 bit internal.