Commit f2d9525a authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Calling vpx_img_read() from vpx_temporal_scalable_patterns.

Change-Id: I7aa0f9afbd802a1d8686cad9fc6eae4baa6a53c3
parent d805b39d
...@@ -441,7 +441,7 @@ int main(int argc, char **argv) { ...@@ -441,7 +441,7 @@ int main(int argc, char **argv) {
int max_intra_size_pct; int max_intra_size_pct;
vpx_svc_layer_id_t layer_id = {0, 0}; vpx_svc_layer_id_t layer_id = {0, 0};
const VpxInterface *encoder = NULL; const VpxInterface *encoder = NULL;
struct VpxInputContext input_ctx = {0}; FILE *infile = NULL;
struct RateControlMetrics rc; struct RateControlMetrics rc;
exec_name = argv[0]; exec_name = argv[0];
...@@ -527,8 +527,7 @@ int main(int argc, char **argv) { ...@@ -527,8 +527,7 @@ int main(int argc, char **argv) {
set_rate_control_metrics(&rc, &cfg); set_rate_control_metrics(&rc, &cfg);
// Open input file. // Open input file.
input_ctx.filename = argv[1]; if (!(infile = fopen(argv[1], "rb"))) {
if (!(input_ctx.file = fopen(input_ctx.filename, "rb"))) {
die("Failed to open %s for reading", argv[1]); die("Failed to open %s for reading", argv[1]);
} }
...@@ -581,7 +580,7 @@ int main(int argc, char **argv) { ...@@ -581,7 +580,7 @@ int main(int argc, char **argv) {
vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id); vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id);
} }
flags = layer_flags[frame_cnt % flag_periodicity]; 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) if (frame_avail)
++rc.layer_input_frames[layer_id.temporal_layer_id]; ++rc.layer_input_frames[layer_id.temporal_layer_id];
if (vpx_codec_encode(&codec, frame_avail? &raw : NULL, pts, 1, flags, if (vpx_codec_encode(&codec, frame_avail? &raw : NULL, pts, 1, flags,
...@@ -621,7 +620,7 @@ int main(int argc, char **argv) { ...@@ -621,7 +620,7 @@ int main(int argc, char **argv) {
++frame_cnt; ++frame_cnt;
pts += frame_duration; pts += frame_duration;
} }
fclose(input_ctx.file); fclose(infile);
printout_rate_control_summary(&rc, &cfg, frame_cnt); printout_rate_control_summary(&rc, &cfg, frame_cnt);
if (vpx_codec_destroy(&codec)) if (vpx_codec_destroy(&codec))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment