OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 // Exit if an invalid argument is supplied. | 483 // Exit if an invalid argument is supplied. |
484 if (return_code != 0) { | 484 if (return_code != 0) { |
485 return return_code; | 485 return return_code; |
486 } | 486 } |
487 | 487 |
488 PrintConfigurationSummary(config); | 488 PrintConfigurationSummary(config); |
489 | 489 |
490 webrtc::VP8Encoder* encoder = webrtc::VP8Encoder::Create(); | 490 webrtc::VP8Encoder* encoder = webrtc::VP8Encoder::Create(); |
491 webrtc::VP8Decoder* decoder = webrtc::VP8Decoder::Create(); | 491 webrtc::VP8Decoder* decoder = webrtc::VP8Decoder::Create(); |
492 webrtc::test::Stats stats; | 492 webrtc::test::Stats stats; |
493 webrtc::test::YuvFrameReaderImpl frame_reader(config.input_filename, | 493 webrtc::test::FrameReaderImpl frame_reader(config.input_filename, |
494 config.codec_settings->width, | 494 config.codec_settings->width, |
495 config.codec_settings->height); | 495 config.codec_settings->height); |
496 webrtc::test::YuvFrameWriterImpl frame_writer(config.output_filename, | 496 webrtc::test::FrameWriterImpl frame_writer(config.output_filename, |
497 config.codec_settings->width, | 497 config.frame_length_in_bytes); |
498 config.codec_settings->height); | |
499 frame_reader.Init(); | 498 frame_reader.Init(); |
500 frame_writer.Init(); | 499 frame_writer.Init(); |
501 webrtc::test::PacketReader packet_reader; | 500 webrtc::test::PacketReader packet_reader; |
502 | 501 |
503 webrtc::test::PacketManipulatorImpl packet_manipulator( | 502 webrtc::test::PacketManipulatorImpl packet_manipulator( |
504 &packet_reader, config.networking_config, config.verbose); | 503 &packet_reader, config.networking_config, config.verbose); |
505 // By default the packet manipulator is seeded with a fixed random. | 504 // By default the packet manipulator is seeded with a fixed random. |
506 // If disabled we must generate a new seed. | 505 // If disabled we must generate a new seed. |
507 if (FLAGS_disable_fixed_random_seed) { | 506 if (FLAGS_disable_fixed_random_seed) { |
508 packet_manipulator.InitializeRandomSeed(time(NULL)); | 507 packet_manipulator.InitializeRandomSeed(time(NULL)); |
509 } | 508 } |
510 webrtc::test::VideoProcessor* processor = | 509 webrtc::test::VideoProcessor* processor = |
511 new webrtc::test::VideoProcessorImpl( | 510 new webrtc::test::VideoProcessorImpl(encoder, decoder, &frame_reader, |
512 encoder, decoder, &frame_reader, &frame_writer, &packet_manipulator, | 511 &frame_writer, &packet_manipulator, |
513 config, &stats, nullptr /* source_frame_writer */, | 512 config, &stats); |
514 nullptr /* encoded_frame_writer */, | |
515 nullptr /* decoded_frame_writer */); | |
516 processor->Init(); | 513 processor->Init(); |
517 | 514 |
518 int frame_number = 0; | 515 int frame_number = 0; |
519 while (processor->ProcessFrame(frame_number)) { | 516 while (processor->ProcessFrame(frame_number)) { |
520 if (frame_number % 80 == 0) { | 517 if (frame_number % 80 == 0) { |
521 Log("\n"); // make the output a bit nicer. | 518 Log("\n"); // make the output a bit nicer. |
522 } | 519 } |
523 Log("."); | 520 Log("."); |
524 frame_number++; | 521 frame_number++; |
525 } | 522 } |
(...skipping 23 matching lines...) Expand all Loading... |
549 } | 546 } |
550 if (FLAGS_python) { | 547 if (FLAGS_python) { |
551 PrintPythonOutput(config, stats, ssim_result, psnr_result); | 548 PrintPythonOutput(config, stats, ssim_result, psnr_result); |
552 } | 549 } |
553 delete processor; | 550 delete processor; |
554 delete encoder; | 551 delete encoder; |
555 delete decoder; | 552 delete decoder; |
556 Log("Quality test finished!"); | 553 Log("Quality test finished!"); |
557 return 0; | 554 return 0; |
558 } | 555 } |
OLD | NEW |