Revert "Updated analysis in videoprocessor."
This reverts commit 1880c7162bd3637c433f9421c798808cd6eacaf7.
Reason for revert: breaks internal tests
Original change's description:
> Updated analysis in videoprocessor.
>
> - Run analysis after all frames are processed. Before part of it was
> done at bitrate change points;
> - Analysis is done for whole stream as well as for each rate update
> interval;
> - Changed units from number of frames to time units for some metrics
> and thresholds. E.g. 'num frames to hit tagret bitrate' is changed to
> 'time to reach target bitrate, sec';
> - Changed data type of FrameStatistic::max_nalu_length (renamed to
> max_nalu_size_bytes) from rtc::Optional to size_t. There it no need to
> use such advanced data type in such low level data structure.
>
> Bug: webrtc:8524
> Change-Id: Ic9f6eab5b15ee12a80324b1f9c101de1bf3c702f
> Reviewed-on: https://webrtc-review.googlesource.com/31901
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21653}
TBR=brandtr@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,ssilkin@webrtc.org
Change-Id: Id0b7d387bbba02e71637b229aeed6f6cf012af46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8524
Reviewed-on: https://webrtc-review.googlesource.com/40220
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21656}
diff --git a/modules/video_coding/codecs/test/videoprocessor.h b/modules/video_coding/codecs/test/videoprocessor.h
index 190b6a3..62a12ef 100644
--- a/modules/video_coding/codecs/test/videoprocessor.h
+++ b/modules/video_coding/codecs/test/videoprocessor.h
@@ -76,7 +76,13 @@
void ProcessFrame();
// Updates the encoder with target rates. Must be called at least once.
- void SetRates(size_t bitrate_kbps, size_t framerate_fps);
+ void SetRates(int bitrate_kbps, int framerate_fps);
+
+ // Returns the number of dropped frames.
+ std::vector<int> NumberDroppedFramesPerRateUpdate() const;
+
+ // Returns the number of spatial resizes.
+ std::vector<int> NumberSpatialResizesPerRateUpdate() const;
private:
class VideoProcessorEncodeCompleteCallback
@@ -184,7 +190,6 @@
webrtc::VideoEncoder* const encoder_;
webrtc::VideoDecoder* const decoder_;
const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_;
- BitrateAllocation bitrate_allocation_ RTC_GUARDED_BY(sequence_checker_);
// Adapters for the codec callbacks.
VideoProcessorEncodeCompleteCallback encode_callback_;
@@ -197,7 +202,7 @@
// Async codecs might queue frames. To handle that we keep input frame
// and release it after corresponding coded frame is decoded and quality
// measurement is done.
- std::map<size_t, std::unique_ptr<VideoFrame>> input_frames_
+ std::map<int, std::unique_ptr<VideoFrame>> input_frames_
RTC_GUARDED_BY(sequence_checker_);
// These (mandatory) file manipulators are used for, e.g., objective PSNR and
@@ -212,15 +217,13 @@
FrameWriter* const decoded_frame_writer_;
// Keep track of inputed/encoded/decoded frames, so we can detect frame drops.
- size_t last_inputed_frame_num_ RTC_GUARDED_BY(sequence_checker_);
- size_t last_encoded_frame_num_ RTC_GUARDED_BY(sequence_checker_);
- size_t last_decoded_frame_num_ RTC_GUARDED_BY(sequence_checker_);
- size_t num_encoded_frames_ RTC_GUARDED_BY(sequence_checker_);
- size_t num_decoded_frames_ RTC_GUARDED_BY(sequence_checker_);
+ int last_inputed_frame_num_ RTC_GUARDED_BY(sequence_checker_);
+ int last_encoded_frame_num_ RTC_GUARDED_BY(sequence_checker_);
+ int last_decoded_frame_num_ RTC_GUARDED_BY(sequence_checker_);
// Store an RTP timestamp -> frame number map, since the timestamps are
// based off of the frame rate, which can change mid-test.
- std::map<size_t, size_t> rtp_timestamp_to_frame_num_
+ std::map<uint32_t, int> rtp_timestamp_to_frame_num_
RTC_GUARDED_BY(sequence_checker_);
// Keep track of if we have excluded the first key frame from packet loss.
@@ -232,6 +235,9 @@
// Statistics.
Stats* stats_;
+ std::vector<int> num_dropped_frames_ RTC_GUARDED_BY(sequence_checker_);
+ std::vector<int> num_spatial_resizes_ RTC_GUARDED_BY(sequence_checker_);
+ int rate_update_index_ RTC_GUARDED_BY(sequence_checker_);
rtc::SequencedTaskChecker sequence_checker_;