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

Unified Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.cc

Issue 2903163002: Add unit tests for qp parser. (Closed)
Patch Set: Refactor. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/codecs/test/videoprocessor.cc
diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
index 623c417ff53bdfab4f0b3d840d906c0df5d13d34..8a310c15dbda33c205951de8baf066107af57be5 100644
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
@@ -232,6 +232,16 @@ FrameType VideoProcessorImpl::EncodedFrameType(int frame_number) {
return frame_infos_[frame_number].encoded_frame_type;
}
+int VideoProcessorImpl::GetQpFromEncoder(int frame_number) {
+ RTC_DCHECK_LT(frame_number, frame_infos_.size());
+ return frame_infos_[frame_number].qp_encoder;
+}
+
+int VideoProcessorImpl::GetQpFromBitstream(int frame_number) {
+ RTC_DCHECK_LT(frame_number, frame_infos_.size());
+ return frame_infos_[frame_number].qp_bitstream;
+}
+
int VideoProcessorImpl::NumberDroppedFrames() {
return num_dropped_frames_;
}
@@ -347,6 +357,14 @@ void VideoProcessorImpl::FrameEncoded(
FrameInfo* frame_info = &frame_infos_[frame_number];
frame_info->encoded_frame_size = encoded_image._length;
frame_info->encoded_frame_type = encoded_image._frameType;
+ frame_info->qp_encoder = encoded_image.qp_;
+ if (codec == kVideoCodecVP8) {
+ vp8::GetQp(encoded_image._buffer, encoded_image._length,
+ &frame_info->qp_bitstream);
+ } else if (codec == kVideoCodecVP9) {
+ vp9::GetQp(encoded_image._buffer, encoded_image._length,
+ &frame_info->qp_bitstream);
+ }
FrameStatistic* frame_stat = &stats_->stats_[frame_number];
frame_stat->encode_time_in_us =
GetElapsedTimeMicroseconds(frame_info->encode_start_ns, encode_stop_ns);

Powered by Google App Engine
This is Rietveld 408576698