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..b8cb42c1fa9d286e571b1f6c37a4752be9467697 100644 |
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc |
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc |
@@ -147,7 +147,9 @@ VideoProcessorImpl::VideoProcessorImpl(webrtc::VideoEncoder* encoder, |
last_decoded_frame_buffer_(0, analysis_frame_reader->FrameLength()), |
stats_(stats), |
num_dropped_frames_(0), |
- num_spatial_resizes_(0) { |
+ num_spatial_resizes_(0), |
+ qp_encoder_(0), |
+ qp_bitstream_(0) { |
RTC_DCHECK(encoder); |
RTC_DCHECK(decoder); |
RTC_DCHECK(packet_manipulator); |
@@ -360,6 +362,14 @@ void VideoProcessorImpl::FrameEncoded( |
encoded_image._length / config_.networking_config.packet_size_in_bytes + |
1; |
+ // Get qp from the encoder and the parser. |
+ qp_encoder_ = encoded_image.qp_; |
brandtr
2017/05/26 07:18:45
Move to after line 351, and add to |frame_info| in
jianj
2017/05/26 18:20:27
Done.
|
+ if (codec == kVideoCodecVP8) { |
+ vp8::GetQp(encoded_image._buffer, encoded_image._length, &qp_bitstream_); |
brandtr
2017/05/26 07:18:45
These too :)
jianj
2017/05/26 18:20:27
Done.
|
+ } else if (codec == kVideoCodecVP9) { |
+ vp9::GetQp(encoded_image._buffer, encoded_image._length, &qp_bitstream_); |
+ } |
+ |
// Simulate packet loss. |
bool exclude_this_frame = false; |
if (encoded_image._frameType == kVideoFrameKey) { |
@@ -423,6 +433,14 @@ void VideoProcessorImpl::FrameEncoded( |
} |
} |
+int VideoProcessorImpl::GetQpFromEncoder() { |
brandtr
2017/05/26 07:18:45
After moving the declarations in the .h file, plea
jianj
2017/05/26 18:20:27
Done.
|
+ return qp_encoder_; |
+} |
+ |
+int VideoProcessorImpl::GetQpFromBitstream() { |
+ return qp_bitstream_; |
+} |
+ |
void VideoProcessorImpl::FrameDecoded(const VideoFrame& image) { |
// For the highest measurement accuracy of the decode time, the start/stop |
// time recordings should wrap the Decode call as tightly as possible. |