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

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

Issue 3011923002: Clean up Stats class used in VideoProcessor tests. (Closed)
Patch Set: Fix VS compile. 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/codecs/test/videoprocessor.h
diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.h b/webrtc/modules/video_coding/codecs/test/videoprocessor.h
index e50f0d9018d2021657e6de1d0940222f53475781..3ae3dc5c0e5cfc5133b28078856f49edd542f836 100644
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor.h
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.h
@@ -134,9 +134,11 @@ class VideoProcessor {
// Tears down callbacks and releases the encoder and decoder.
void Release();
- // Processes a single frame. The frames must be processed in order, and the
- // VideoProcessor must be initialized first.
- void ProcessFrame(int frame_number);
+ // Reads a frame from the analysis frame reader and sends it to the encoder.
+ // When the encode callback is received, the encoded frame is sent to the
+ // decoder. The decoded frame is written to disk by the analysis frame writer.
+ // Objective video quality metrics can thus be calculated after the fact.
+ void ProcessFrame();
// Updates the encoder with target rates. Must be called at least once.
void SetRates(int bitrate_kbps, int framerate_fps);
@@ -148,18 +150,6 @@ class VideoProcessor {
std::vector<int> NumberSpatialResizesPerRateUpdate() const;
private:
- // Container that holds per-frame information that needs to be stored between
- // calls to Encode and Decode, as well as the corresponding callbacks. It is
- // not directly used for statistics -- for that, test::FrameStatistic is used.
- // TODO(brandtr): Get rid of this struct and use the Stats class instead.
- struct FrameInfo {
- int64_t encode_start_ns = 0;
- int64_t decode_start_ns = 0;
- int decoded_width = 0;
- int decoded_height = 0;
- size_t manipulated_length = 0;
- };
-
class VideoProcessorEncodeCompleteCallback
: public webrtc::EncodedImageCallback {
public:
@@ -283,10 +273,8 @@ class VideoProcessor {
IvfFileWriter* const encoded_frame_writer_;
FrameWriter* const decoded_frame_writer_;
- // Frame metadata for all frames that have been added through a call to
- // ProcessFrames(). We need to store this metadata over the course of the
- // test run, to support pipelining HW codecs.
- std::vector<FrameInfo> frame_infos_ GUARDED_BY(sequence_checker_);
+ // Keep track of inputed/encoded/decoded frames, so we can detect frame drops.
+ int last_inputed_frame_num_ GUARDED_BY(sequence_checker_);
int last_encoded_frame_num_ GUARDED_BY(sequence_checker_);
int last_decoded_frame_num_ GUARDED_BY(sequence_checker_);
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/stats_unittest.cc ('k') | webrtc/modules/video_coding/codecs/test/videoprocessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698