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

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

Issue 3007753002: Verify parsed QP value when frame is encoded instead of storing parsed value and verifying later. (Closed)
Patch Set: Created 3 years, 3 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
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/test/videoprocessor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Tears down callbacks and releases the encoder and decoder. 152 // Tears down callbacks and releases the encoder and decoder.
153 void Release(); 153 void Release();
154 154
155 // Processes a single frame. The frames must be processed in order, and the 155 // Processes a single frame. The frames must be processed in order, and the
156 // VideoProcessor must be initialized first. 156 // VideoProcessor must be initialized first.
157 void ProcessFrame(int frame_number); 157 void ProcessFrame(int frame_number);
158 158
159 // Updates the encoder with target rates. Must be called at least once. 159 // Updates the encoder with target rates. Must be called at least once.
160 void SetRates(int bitrate_kbps, int framerate_fps); 160 void SetRates(int bitrate_kbps, int framerate_fps);
161 161
162
163 // TODO(brandtr): Get rid of these functions by moving the corresponding QP
164 // fields to the Stats object.
165 int GetQpFromEncoder(int frame_number) const;
166 int GetQpFromBitstream(int frame_number) const;
167
168
169 // Return the number of dropped frames. 162 // Return the number of dropped frames.
170 int NumberDroppedFrames(); 163 int NumberDroppedFrames();
171 164
172 // Return the number of spatial resizes. 165 // Return the number of spatial resizes.
173 int NumberSpatialResizes(); 166 int NumberSpatialResizes();
174 167
175 private: 168 private:
176 // Container that holds per-frame information that needs to be stored between 169 // Container that holds per-frame information that needs to be stored between
177 // calls to Encode and Decode, as well as the corresponding callbacks. It is 170 // calls to Encode and Decode, as well as the corresponding callbacks. It is
178 // not directly used for statistics -- for that, test::FrameStatistic is used. 171 // not directly used for statistics -- for that, test::FrameStatistic is used.
179 // TODO(brandtr): Get rid of this struct and use the Stats class instead. 172 // TODO(brandtr): Get rid of this struct and use the Stats class instead.
180 struct FrameInfo { 173 struct FrameInfo {
181 int64_t encode_start_ns = 0; 174 int64_t encode_start_ns = 0;
182 int64_t decode_start_ns = 0; 175 int64_t decode_start_ns = 0;
183 int qp_encoder = 0;
184 int qp_bitstream = 0;
185 int decoded_width = 0; 176 int decoded_width = 0;
186 int decoded_height = 0; 177 int decoded_height = 0;
187 size_t manipulated_length = 0; 178 size_t manipulated_length = 0;
188 }; 179 };
189 180
190 class VideoProcessorEncodeCompleteCallback 181 class VideoProcessorEncodeCompleteCallback
191 : public webrtc::EncodedImageCallback { 182 : public webrtc::EncodedImageCallback {
192 public: 183 public:
193 explicit VideoProcessorEncodeCompleteCallback( 184 explicit VideoProcessorEncodeCompleteCallback(
194 VideoProcessor* video_processor) 185 VideoProcessor* video_processor)
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 329
339 rtc::SequencedTaskChecker sequence_checker_; 330 rtc::SequencedTaskChecker sequence_checker_;
340 331
341 RTC_DISALLOW_COPY_AND_ASSIGN(VideoProcessor); 332 RTC_DISALLOW_COPY_AND_ASSIGN(VideoProcessor);
342 }; 333 };
343 334
344 } // namespace test 335 } // namespace test
345 } // namespace webrtc 336 } // namespace webrtc
346 337
347 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ 338 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/test/videoprocessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698