Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h

Issue 2999643002: Rename SetProcessParams -> SetTestConfig. (Closed)
Patch Set: Rebase. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 psnr_result.average, psnr_result.min, ssim_result.average, 574 psnr_result.average, psnr_result.min, ssim_result.average,
575 ssim_result.min); 575 ssim_result.min);
576 printf("\n"); 576 printf("\n");
577 577
578 // Remove analysis file. 578 // Remove analysis file.
579 if (remove(config_.output_filename.c_str()) < 0) { 579 if (remove(config_.output_filename.c_str()) < 0) {
580 fprintf(stderr, "Failed to remove temporary file!\n"); 580 fprintf(stderr, "Failed to remove temporary file!\n");
581 } 581 }
582 } 582 }
583 583
584 static void SetProcessParams(TestConfig* config, 584 static void SetTestConfig(TestConfig* config,
585 bool hw_codec, 585 bool hw_codec,
586 bool use_single_core, 586 bool use_single_core,
587 float packet_loss_probability, 587 float packet_loss_probability,
588 int key_frame_interval, 588 std::string filename,
589 std::string filename, 589 bool verbose_logging,
590 bool verbose_logging, 590 bool batch_mode) {
591 bool batch_mode) {
592 // Configure input filename.
593 config->filename = filename; 591 config->filename = filename;
594 config->input_filename = ResourcePath(filename, "yuv"); 592 config->input_filename = ResourcePath(filename, "yuv");
595 // Generate an output filename in a safe way. 593 // Generate an output filename in a safe way.
596 config->output_filename = 594 config->output_filename =
597 TempFilename(OutputPath(), "videoprocessor_integrationtest"); 595 TempFilename(OutputPath(), "videoprocessor_integrationtest");
596 config->networking_config.packet_loss_probability = packet_loss_probability;
597 config->use_single_core = use_single_core;
598 config->verbose = verbose_logging;
598 config->hw_codec = hw_codec; 599 config->hw_codec = hw_codec;
599 config->use_single_core = use_single_core;
600 config->keyframe_interval = key_frame_interval;
601 config->networking_config.packet_loss_probability = packet_loss_probability;
602 config->verbose = verbose_logging;
603 config->batch_mode = batch_mode; 600 config->batch_mode = batch_mode;
604 } 601 }
605 602
606 static void SetCodecSettings(TestConfig* config, 603 static void SetCodecSettings(TestConfig* config,
607 VideoCodecType codec_type, 604 VideoCodecType codec_type,
608 int num_temporal_layers, 605 int num_temporal_layers,
609 bool error_concealment_on, 606 bool error_concealment_on,
610 bool denoising_on, 607 bool denoising_on,
611 bool frame_dropper_on, 608 bool frame_dropper_on,
612 bool spatial_resize_on, 609 bool spatial_resize_on,
613 bool resilience_on, 610 bool resilience_on,
614 int width, 611 int width,
615 int height) { 612 int height) {
616 webrtc::test::CodecSettings(codec_type, &config->codec_settings); 613 webrtc::test::CodecSettings(codec_type, &config->codec_settings);
617 config->codec_settings.width = width; 614 config->codec_settings.width = width;
618 config->codec_settings.height = height; 615 config->codec_settings.height = height;
619 switch (config->codec_settings.codecType) { 616 switch (config->codec_settings.codecType) {
617 case kVideoCodecVP8:
618 config->codec_settings.VP8()->resilience =
619 resilience_on ? kResilientStream : kResilienceOff;
620 config->codec_settings.VP8()->numberOfTemporalLayers =
621 num_temporal_layers;
622 config->codec_settings.VP8()->denoisingOn = denoising_on;
623 config->codec_settings.VP8()->errorConcealmentOn = error_concealment_on;
624 config->codec_settings.VP8()->automaticResizeOn = spatial_resize_on;
625 config->codec_settings.VP8()->frameDroppingOn = frame_dropper_on;
626 config->codec_settings.VP8()->keyFrameInterval = kBaseKeyFrameInterval;
627 break;
628 case kVideoCodecVP9:
629 config->codec_settings.VP9()->resilienceOn = resilience_on;
630 config->codec_settings.VP9()->numberOfTemporalLayers =
631 num_temporal_layers;
632 config->codec_settings.VP9()->denoisingOn = denoising_on;
633 config->codec_settings.VP9()->frameDroppingOn = frame_dropper_on;
634 config->codec_settings.VP9()->keyFrameInterval = kBaseKeyFrameInterval;
635 config->codec_settings.VP9()->automaticResizeOn = spatial_resize_on;
636 break;
620 case kVideoCodecH264: 637 case kVideoCodecH264:
621 config->codec_settings.H264()->frameDroppingOn = frame_dropper_on; 638 config->codec_settings.H264()->frameDroppingOn = frame_dropper_on;
622 config->codec_settings.H264()->keyFrameInterval = kBaseKeyFrameInterval; 639 config->codec_settings.H264()->keyFrameInterval = kBaseKeyFrameInterval;
623 break; 640 break;
624 case kVideoCodecVP8:
625 config->codec_settings.VP8()->errorConcealmentOn = error_concealment_on;
626 config->codec_settings.VP8()->denoisingOn = denoising_on;
627 config->codec_settings.VP8()->numberOfTemporalLayers =
628 num_temporal_layers;
629 config->codec_settings.VP8()->frameDroppingOn = frame_dropper_on;
630 config->codec_settings.VP8()->automaticResizeOn = spatial_resize_on;
631 config->codec_settings.VP8()->keyFrameInterval = kBaseKeyFrameInterval;
632 config->codec_settings.VP8()->resilience =
633 resilience_on ? kResilientStream : kResilienceOff;
634 break;
635 case kVideoCodecVP9:
636 config->codec_settings.VP9()->denoisingOn = denoising_on;
637 config->codec_settings.VP9()->numberOfTemporalLayers =
638 num_temporal_layers;
639 config->codec_settings.VP9()->frameDroppingOn = frame_dropper_on;
640 config->codec_settings.VP9()->automaticResizeOn = spatial_resize_on;
641 config->codec_settings.VP9()->keyFrameInterval = kBaseKeyFrameInterval;
642 config->codec_settings.VP9()->resilienceOn = resilience_on;
643 break;
644 default: 641 default:
645 RTC_NOTREACHED(); 642 RTC_NOTREACHED();
646 break; 643 break;
647 } 644 }
648 645
649 config->frame_length_in_bytes = 646 config->frame_length_in_bytes =
650 CalcBufferSize(VideoType::kI420, width, height); 647 CalcBufferSize(VideoType::kI420, width, height);
651 } 648 }
652 649
653 static void SetRateProfile(RateProfile* rate_profile, 650 static void SetRateProfile(RateProfile* rate_profile,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 float target_size_key_frame_initial_; 717 float target_size_key_frame_initial_;
721 float target_size_key_frame_; 718 float target_size_key_frame_;
722 float sum_key_frame_size_mismatch_; 719 float sum_key_frame_size_mismatch_;
723 int num_key_frames_; 720 int num_key_frames_;
724 }; 721 };
725 722
726 } // namespace test 723 } // namespace test
727 } // namespace webrtc 724 } // namespace webrtc
728 725
729 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTES T_H_ 726 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTES T_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698