From f2d9525a79d787ffc51239216c43c68fea5ea979 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Thu, 13 Feb 2014 12:07:11 -0800 Subject: [PATCH] Calling vpx_img_read() from vpx_temporal_scalable_patterns. Change-Id: I7aa0f9afbd802a1d8686cad9fc6eae4baa6a53c3 --- examples/vpx_temporal_scalable_patterns.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/vpx_temporal_scalable_patterns.c b/examples/vpx_temporal_scalable_patterns.c index 73278a8..464273c 100644 --- a/examples/vpx_temporal_scalable_patterns.c +++ b/examples/vpx_temporal_scalable_patterns.c @@ -441,7 +441,7 @@ int main(int argc, char **argv) { int max_intra_size_pct; vpx_svc_layer_id_t layer_id = {0, 0}; const VpxInterface *encoder = NULL; - struct VpxInputContext input_ctx = {0}; + FILE *infile = NULL; struct RateControlMetrics rc; exec_name = argv[0]; @@ -527,8 +527,7 @@ int main(int argc, char **argv) { set_rate_control_metrics(&rc, &cfg); // Open input file. - input_ctx.filename = argv[1]; - if (!(input_ctx.file = fopen(input_ctx.filename, "rb"))) { + if (!(infile = fopen(argv[1], "rb"))) { die("Failed to open %s for reading", argv[1]); } @@ -581,7 +580,7 @@ int main(int argc, char **argv) { vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id); } flags = layer_flags[frame_cnt % flag_periodicity]; - frame_avail = !read_yuv_frame(&input_ctx, &raw); + frame_avail = vpx_img_read(&raw, infile); if (frame_avail) ++rc.layer_input_frames[layer_id.temporal_layer_id]; if (vpx_codec_encode(&codec, frame_avail? &raw : NULL, pts, 1, flags, @@ -621,7 +620,7 @@ int main(int argc, char **argv) { ++frame_cnt; pts += frame_duration; } - fclose(input_ctx.file); + fclose(infile); printout_rate_control_summary(&rc, &cfg, frame_cnt); if (vpx_codec_destroy(&codec)) -- 2.7.4