${toggle_postproc_visualizer} macro block / block level visualizers
${toggle_multi_res_encoding} enable multiple-resolution encoding
${toggle_temporal_denoising} enable temporal denoising and disable the spatial denoiser
+ ${toggle_webm_io} enable input from and output to WebM container
Codecs:
Codecs can be selectively enabled or disabled individually, or by family:
postproc_visualizer
os_support
unit_tests
+ webm_io
decode_perf_tests
multi_res_encoding
temporal_denoising
small
postproc_visualizer
unit_tests
+ webm_io
decode_perf_tests
multi_res_encoding
temporal_denoising
enabled postproc || die "postproc_visualizer requires postproc to be enabled"
fi
+ # Enable WebM IO by default.
+ soft_enable webm_io
+
# Enable unit tests by default if we have a working C++ compiler.
case "$toolchain" in
*-vs*)
vpxdec.SRCS += args.c args.h
vpxdec.SRCS += ivfdec.c ivfdec.h
vpxdec.SRCS += tools_common.c tools_common.h
-vpxdec.SRCS += webmdec.c webmdec.h
vpxdec.SRCS += y4menc.c y4menc.h
-vpxdec.SRCS += third_party/nestegg/halloc/halloc.h
-vpxdec.SRCS += third_party/nestegg/halloc/src/align.h
-vpxdec.SRCS += third_party/nestegg/halloc/src/halloc.c
-vpxdec.SRCS += third_party/nestegg/halloc/src/hlist.h
-vpxdec.SRCS += third_party/nestegg/halloc/src/macros.h
-vpxdec.SRCS += third_party/nestegg/include/nestegg/nestegg.h
-vpxdec.SRCS += third_party/nestegg/src/nestegg.c
vpxdec.SRCS += $(LIBYUV_SRCS)
+ifeq ($(CONFIG_WEBM_IO),yes)
+ vpxdec.SRCS += third_party/nestegg/halloc/halloc.h
+ vpxdec.SRCS += third_party/nestegg/halloc/src/align.h
+ vpxdec.SRCS += third_party/nestegg/halloc/src/halloc.c
+ vpxdec.SRCS += third_party/nestegg/halloc/src/hlist.h
+ vpxdec.SRCS += third_party/nestegg/halloc/src/macros.h
+ vpxdec.SRCS += third_party/nestegg/include/nestegg/nestegg.h
+ vpxdec.SRCS += third_party/nestegg/src/nestegg.c
+ vpxdec.SRCS += webmdec.c webmdec.h
+endif
vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
vpxdec.DESCRIPTION = Full featured decoder
UTILS-$(CONFIG_ENCODERS) += vpxenc.c
vpxenc.SRCS += rate_hist.c rate_hist.h
vpxenc.SRCS += tools_common.c tools_common.h
vpxenc.SRCS += warnings.c warnings.h
-vpxenc.SRCS += webmenc.c webmenc.h
vpxenc.SRCS += vpx_ports/mem_ops.h
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
vpxenc.SRCS += vpx_ports/vpx_timer.h
vpxenc.SRCS += vpxstats.c vpxstats.h
-vpxenc.SRCS += third_party/libmkv/EbmlIDs.h
-vpxenc.SRCS += third_party/libmkv/EbmlWriter.c
-vpxenc.SRCS += third_party/libmkv/EbmlWriter.h
vpxenc.SRCS += $(LIBYUV_SRCS)
+ifeq ($(CONFIG_WEBM_IO),yes)
+ vpxenc.SRCS += third_party/libmkv/EbmlIDs.h
+ vpxenc.SRCS += third_party/libmkv/EbmlWriter.c
+ vpxenc.SRCS += third_party/libmkv/EbmlWriter.h
+ vpxenc.SRCS += webmenc.c webmenc.h
+endif
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
vpxenc.DESCRIPTION = Full featured encoder
EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_spatial_scalable_encoder.c
static int read_frame(struct VpxDecInputContext *input, uint8_t **buf,
size_t *bytes_in_buffer, size_t *buffer_size) {
switch (input->vpx_input_ctx->file_type) {
+#if CONFIG_WEBM_IO
case FILE_TYPE_WEBM:
return webm_read_frame(input->webm_ctx,
buf, bytes_in_buffer, buffer_size);
+#endif
case FILE_TYPE_RAW:
return raw_read_frame(input->vpx_input_ctx->file,
buf, bytes_in_buffer, buffer_size);
input.vpx_input_ctx->file = infile;
if (file_is_ivf(input.vpx_input_ctx))
input.vpx_input_ctx->file_type = FILE_TYPE_IVF;
+#if CONFIG_WEBM_IO
else if (file_is_webm(input.webm_ctx, input.vpx_input_ctx))
input.vpx_input_ctx->file_type = FILE_TYPE_WEBM;
+#endif
else if (file_is_raw(input.vpx_input_ctx))
input.vpx_input_ctx->file_type = FILE_TYPE_RAW;
else {
fprintf(stderr, "Unrecognized input file type.\n");
+#if !CONFIG_WEBM_IO
+ fprintf(stderr, "vpxdec was built without WebM container support.\n");
+#endif
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
+#if CONFIG_WEBM_IO
if (vpx_input_ctx.file_type == FILE_TYPE_WEBM) {
if (webm_guess_framerate(input.webm_ctx, input.vpx_input_ctx)) {
fprintf(stderr, "Failed to guess framerate -- error parsing "
return EXIT_FAILURE;
}
}
+#endif
}
fourcc_interface = get_vpx_decoder_by_fourcc(vpx_input_ctx.fourcc);
}
}
+#if CONFIG_WEBM_IO
if (input.vpx_input_ctx->file_type == FILE_TYPE_WEBM)
webm_free(input.webm_ctx);
- else
+#endif
+
+ if (input.vpx_input_ctx->file_type != FILE_TYPE_WEBM)
free(buf);
if (scaled_img) vpx_img_free(scaled_img);
return 0;
}
+#if CONFIG_WEBM_IO
/* Murmur hash derived from public domain reference implementation at
* http:// sites.google.com/site/murmurhash/
*/
return h;
}
-
+#endif // CONFIG_WEBM_IO
static const arg_def_t debugmode = ARG_DEF("D", "debug", 0,
"Debug mode (makes output deterministic)");
static const arg_def_t framerate = ARG_DEF(NULL, "fps", 1,
"Stream frame rate (rate/scale)");
static const arg_def_t use_ivf = ARG_DEF(NULL, "ivf", 0,
- "Output IVF (default is WebM)");
+ "Output IVF (default is WebM if WebM IO is enabled)");
static const arg_def_t out_part = ARG_DEF("P", "output-partitions", 0,
"Makes encoder output partitions. Requires IVF output!");
static const arg_def_t q_hist_n = ARG_DEF(NULL, "q-hist", 1,
/* Initialize remaining stream parameters */
stream->config.stereo_fmt = STEREO_FORMAT_MONO;
stream->config.write_webm = 1;
+#if CONFIG_WEBM_IO
stream->ebml.last_pts_ms = -1;
+#endif
/* Allows removal of the application version from the EBML tags */
stream->ebml.debug = global->debug;
if (stream->config.write_webm && fseek(stream->file, 0, SEEK_CUR))
fatal("WebM output to pipes not supported.");
+#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
stream->ebml.stream = stream->file;
write_webm_file_header(&stream->ebml, cfg,
&global->framerate,
stream->config.stereo_fmt,
global->codec->fourcc);
- } else {
+ }
+#endif
+
+ if (!stream->config.write_webm) {
ivf_write_file_header(stream->file, cfg, global->codec->fourcc, 0);
}
}
if (cfg->g_pass == VPX_RC_FIRST_PASS)
return;
+#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
write_webm_file_footer(&stream->ebml, stream->hash);
free(stream->ebml.cue_list);
stream->ebml.cue_list = NULL;
- } else {
+ }
+#endif
+
+ if (!stream->config.write_webm) {
if (!fseek(stream->file, 0, SEEK_SET))
ivf_write_file_header(stream->file, &stream->config.cfg,
fourcc,
fprintf(stderr, " %6luF", (unsigned long)pkt->data.frame.sz);
update_rate_histogram(stream->rate_hist, cfg, pkt);
+#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
/* Update the hash */
if (!stream->ebml.debug)
stream->hash);
write_webm_block(&stream->ebml, cfg, pkt);
- } else {
+ }
+#endif
+ if (!stream->config.write_webm) {
if (pkt->data.frame.partition_id <= 0) {
ivf_header_pos = ftello(stream->file);
fsize = pkt->data.frame.sz;
" and --passes=2\n", stream->index, global.pass);
});
+#if !CONFIG_WEBM_IO
+ FOREACH_STREAM({
+ stream->config.write_webm = 0;
+ warn("vpxenc was compiled without WebM container support."
+ "Producing IVF output");
+ });
+#endif
+
/* Use the frame rate from the file only if none was specified
* on the command-line.
*/