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

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

Issue 2999643002: Rename SetProcessParams -> SetTestConfig. (Closed)
Patch Set: 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 psnr_result.average, psnr_result.min, ssim_result.average, 562 psnr_result.average, psnr_result.min, ssim_result.average,
563 ssim_result.min); 563 ssim_result.min);
564 printf("\n"); 564 printf("\n");
565 565
566 // Remove analysis file. 566 // Remove analysis file.
567 if (remove(config_.output_filename.c_str()) < 0) { 567 if (remove(config_.output_filename.c_str()) < 0) {
568 fprintf(stderr, "Failed to remove temporary file!\n"); 568 fprintf(stderr, "Failed to remove temporary file!\n");
569 } 569 }
570 } 570 }
571 571
572 static void SetProcessParams(TestConfig* config, 572 static void SetTestConfig(TestConfig* config,
573 bool hw_codec, 573 bool hw_codec,
574 bool use_single_core, 574 bool use_single_core,
575 float packet_loss_probability, 575 float packet_loss_probability,
576 int key_frame_interval, 576 std::string filename,
577 std::string filename, 577 bool verbose_logging,
578 bool verbose_logging, 578 bool batch_mode) {
579 bool batch_mode) {
580 // Configure input filename.
581 config->filename = filename; 579 config->filename = filename;
582 config->input_filename = ResourcePath(filename, "yuv"); 580 config->input_filename = ResourcePath(filename, "yuv");
583 // Generate an output filename in a safe way. 581 // Generate an output filename in a safe way.
584 config->output_filename = 582 config->output_filename =
585 TempFilename(OutputPath(), "videoprocessor_integrationtest"); 583 TempFilename(OutputPath(), "videoprocessor_integrationtest");
584 config->networking_config.packet_loss_probability = packet_loss_probability;
brandtr 2017/08/09 10:55:31 Reordered to match definitions in TestConfig.
585 config->use_single_core = use_single_core;
586 config->verbose = verbose_logging;
586 config->hw_codec = hw_codec; 587 config->hw_codec = hw_codec;
587 config->use_single_core = use_single_core;
588 config->keyframe_interval = key_frame_interval;
589 config->networking_config.packet_loss_probability = packet_loss_probability;
590 config->verbose = verbose_logging;
591 config->batch_mode = batch_mode; 588 config->batch_mode = batch_mode;
592 } 589 }
593 590
594 static void SetCodecSettings(TestConfig* config, 591 static void SetCodecSettings(TestConfig* config,
595 VideoCodecType codec_type, 592 VideoCodecType codec_type,
596 int num_temporal_layers, 593 int num_temporal_layers,
597 bool error_concealment_on, 594 bool error_concealment_on,
598 bool denoising_on, 595 bool denoising_on,
599 bool frame_dropper_on, 596 bool frame_dropper_on,
600 bool spatial_resize_on, 597 bool spatial_resize_on,
601 bool resilience_on, 598 bool resilience_on,
602 int width, 599 int width,
603 int height) { 600 int height) {
604 VideoCodingModule::Codec(codec_type, &config->codec_settings); 601 VideoCodingModule::Codec(codec_type, &config->codec_settings);
605 config->codec_settings.width = width; 602 config->codec_settings.width = width;
606 config->codec_settings.height = height; 603 config->codec_settings.height = height;
607 switch (config->codec_settings.codecType) { 604 switch (config->codec_settings.codecType) {
605 case kVideoCodecVP8:
606 config->codec_settings.VP8()->resilience =
brandtr 2017/08/09 10:55:31 Reordered to match definitions in VideoCodecVP8
607 resilience_on ? kResilientStream : kResilienceOff;
608 config->codec_settings.VP8()->numberOfTemporalLayers =
609 num_temporal_layers;
610 config->codec_settings.VP8()->denoisingOn = denoising_on;
611 config->codec_settings.VP8()->errorConcealmentOn = error_concealment_on;
612 config->codec_settings.VP8()->automaticResizeOn = spatial_resize_on;
613 config->codec_settings.VP8()->frameDroppingOn = frame_dropper_on;
614 config->codec_settings.VP8()->keyFrameInterval = kBaseKeyFrameInterval;
615 break;
616 case kVideoCodecVP9:
617 config->codec_settings.VP9()->resilienceOn = resilience_on;
618 config->codec_settings.VP9()->numberOfTemporalLayers =
619 num_temporal_layers;
620 config->codec_settings.VP9()->denoisingOn = denoising_on;
621 config->codec_settings.VP9()->frameDroppingOn = frame_dropper_on;
622 config->codec_settings.VP9()->keyFrameInterval = kBaseKeyFrameInterval;
623 config->codec_settings.VP9()->automaticResizeOn = spatial_resize_on;
624 break;
608 case kVideoCodecH264: 625 case kVideoCodecH264:
609 config->codec_settings.H264()->frameDroppingOn = frame_dropper_on; 626 config->codec_settings.H264()->frameDroppingOn = frame_dropper_on;
610 config->codec_settings.H264()->keyFrameInterval = kBaseKeyFrameInterval; 627 config->codec_settings.H264()->keyFrameInterval = kBaseKeyFrameInterval;
611 break; 628 break;
612 case kVideoCodecVP8:
613 config->codec_settings.VP8()->errorConcealmentOn = error_concealment_on;
614 config->codec_settings.VP8()->denoisingOn = denoising_on;
615 config->codec_settings.VP8()->numberOfTemporalLayers =
616 num_temporal_layers;
617 config->codec_settings.VP8()->frameDroppingOn = frame_dropper_on;
618 config->codec_settings.VP8()->automaticResizeOn = spatial_resize_on;
619 config->codec_settings.VP8()->keyFrameInterval = kBaseKeyFrameInterval;
620 config->codec_settings.VP8()->resilience =
621 resilience_on ? kResilientStream : kResilienceOff;
622 break;
623 case kVideoCodecVP9:
624 config->codec_settings.VP9()->denoisingOn = denoising_on;
625 config->codec_settings.VP9()->numberOfTemporalLayers =
626 num_temporal_layers;
627 config->codec_settings.VP9()->frameDroppingOn = frame_dropper_on;
628 config->codec_settings.VP9()->automaticResizeOn = spatial_resize_on;
629 config->codec_settings.VP9()->keyFrameInterval = kBaseKeyFrameInterval;
630 config->codec_settings.VP9()->resilienceOn = resilience_on;
631 break;
632 default: 629 default:
633 RTC_NOTREACHED(); 630 RTC_NOTREACHED();
634 break; 631 break;
635 } 632 }
636 633
637 config->frame_length_in_bytes = 634 config->frame_length_in_bytes =
638 CalcBufferSize(VideoType::kI420, width, height); 635 CalcBufferSize(VideoType::kI420, width, height);
639 } 636 }
640 637
641 static void SetRateProfile(RateProfile* rate_profile, 638 static void SetRateProfile(RateProfile* rate_profile,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 int start_frame_rate_; 709 int start_frame_rate_;
713 710
714 // Codec and network settings. 711 // Codec and network settings.
715 int num_temporal_layers_; 712 int num_temporal_layers_;
716 }; 713 };
717 714
718 } // namespace test 715 } // namespace test
719 } // namespace webrtc 716 } // namespace webrtc
720 717
721 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTES T_H_ 718 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTES T_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698