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

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

Issue 2434073003: Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: Updated tl listener registration. Fixed tests. Created 4 years, 2 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
11 #include <math.h> 11 #include <math.h>
12 12
13 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" 13 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
14 #include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h" 14 #include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h"
15 #include "webrtc/modules/video_coding/codecs/test/videoprocessor.h" 15 #include "webrtc/modules/video_coding/codecs/test/videoprocessor.h"
16 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" 16 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
17 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" 17 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h"
18 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
18 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" 19 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
19 #include "webrtc/modules/video_coding/include/video_codec_interface.h" 20 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
20 #include "webrtc/modules/video_coding/include/video_coding.h" 21 #include "webrtc/modules/video_coding/include/video_coding.h"
21 #include "webrtc/test/gtest.h" 22 #include "webrtc/test/gtest.h"
22 #include "webrtc/test/testsupport/fileutils.h" 23 #include "webrtc/test/testsupport/fileutils.h"
23 #include "webrtc/test/testsupport/frame_reader.h" 24 #include "webrtc/test/testsupport/frame_reader.h"
24 #include "webrtc/test/testsupport/frame_writer.h" 25 #include "webrtc/test/testsupport/frame_writer.h"
25 #include "webrtc/test/testsupport/metrics/video_metrics.h" 26 #include "webrtc/test/testsupport/metrics/video_metrics.h"
26 #include "webrtc/test/testsupport/packet_reader.h" 27 #include "webrtc/test/testsupport/packet_reader.h"
27 #include "webrtc/typedefs.h" 28 #include "webrtc/typedefs.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 VideoEncoder* encoder_; 107 VideoEncoder* encoder_;
107 VideoDecoder* decoder_; 108 VideoDecoder* decoder_;
108 webrtc::test::FrameReader* frame_reader_; 109 webrtc::test::FrameReader* frame_reader_;
109 webrtc::test::FrameWriter* frame_writer_; 110 webrtc::test::FrameWriter* frame_writer_;
110 webrtc::test::PacketReader packet_reader_; 111 webrtc::test::PacketReader packet_reader_;
111 webrtc::test::PacketManipulator* packet_manipulator_; 112 webrtc::test::PacketManipulator* packet_manipulator_;
112 webrtc::test::Stats stats_; 113 webrtc::test::Stats stats_;
113 webrtc::test::TestConfig config_; 114 webrtc::test::TestConfig config_;
114 VideoCodec codec_settings_; 115 VideoCodec codec_settings_;
115 webrtc::test::VideoProcessor* processor_; 116 webrtc::test::VideoProcessor* processor_;
117 TemporalLayersFactory tl_factory_;
116 118
117 // Quantities defined/updated for every encoder rate update. 119 // Quantities defined/updated for every encoder rate update.
118 // Some quantities defined per temporal layer (at most 3 layers in this test). 120 // Some quantities defined per temporal layer (at most 3 layers in this test).
119 int num_frames_per_update_[3]; 121 int num_frames_per_update_[3];
120 float sum_frame_size_mismatch_[3]; 122 float sum_frame_size_mismatch_[3];
121 float sum_encoded_frame_size_[3]; 123 float sum_encoded_frame_size_[3];
122 float encoding_bitrate_[3]; 124 float encoding_bitrate_[3];
123 float per_frame_bandwidth_[3]; 125 float per_frame_bandwidth_[3];
124 float bit_rate_layer_[3]; 126 float bit_rate_layer_[3];
125 float frame_rate_layer_[3]; 127 float frame_rate_layer_[3];
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 error_concealment_on_; 203 error_concealment_on_;
202 config_.codec_settings->codecSpecific.VP8.denoisingOn = denoising_on_; 204 config_.codec_settings->codecSpecific.VP8.denoisingOn = denoising_on_;
203 config_.codec_settings->codecSpecific.VP8.numberOfTemporalLayers = 205 config_.codec_settings->codecSpecific.VP8.numberOfTemporalLayers =
204 num_temporal_layers_; 206 num_temporal_layers_;
205 config_.codec_settings->codecSpecific.VP8.frameDroppingOn = 207 config_.codec_settings->codecSpecific.VP8.frameDroppingOn =
206 frame_dropper_on_; 208 frame_dropper_on_;
207 config_.codec_settings->codecSpecific.VP8.automaticResizeOn = 209 config_.codec_settings->codecSpecific.VP8.automaticResizeOn =
208 spatial_resize_on_; 210 spatial_resize_on_;
209 config_.codec_settings->codecSpecific.VP8.keyFrameInterval = 211 config_.codec_settings->codecSpecific.VP8.keyFrameInterval =
210 kBaseKeyFrameInterval; 212 kBaseKeyFrameInterval;
213 config_.codec_settings->codecSpecific.VP8.tl_factory = &tl_factory_;
211 break; 214 break;
212 case kVideoCodecVP9: 215 case kVideoCodecVP9:
213 config_.codec_settings->codecSpecific.VP9.denoisingOn = denoising_on_; 216 config_.codec_settings->codecSpecific.VP9.denoisingOn = denoising_on_;
214 config_.codec_settings->codecSpecific.VP9.numberOfTemporalLayers = 217 config_.codec_settings->codecSpecific.VP9.numberOfTemporalLayers =
215 num_temporal_layers_; 218 num_temporal_layers_;
216 config_.codec_settings->codecSpecific.VP9.frameDroppingOn = 219 config_.codec_settings->codecSpecific.VP9.frameDroppingOn =
217 frame_dropper_on_; 220 frame_dropper_on_;
218 config_.codec_settings->codecSpecific.VP9.automaticResizeOn = 221 config_.codec_settings->codecSpecific.VP9.automaticResizeOn =
219 spatial_resize_on_; 222 spatial_resize_on_;
220 config_.codec_settings->codecSpecific.VP9.keyFrameInterval = 223 config_.codec_settings->codecSpecific.VP9.keyFrameInterval =
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 QualityMetrics quality_metrics; 1009 QualityMetrics quality_metrics;
1007 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); 1010 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80);
1008 // Metrics for rate control. 1011 // Metrics for rate control.
1009 RateControlMetrics rc_metrics[2]; 1012 RateControlMetrics rc_metrics[2];
1010 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); 1013 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1);
1011 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); 1014 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0);
1012 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 1015 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
1013 rc_metrics); 1016 rc_metrics);
1014 } 1017 }
1015 } // namespace webrtc 1018 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698