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

Side by Side Diff: webrtc/modules/video_processing/frame_preprocessor.h

Issue 1482913003: Initial VideoProcessing refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More lint. Created 5 years 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
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
11 /*
12 * frame_preprocessor.h
13 */
14 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_FRAME_PREPROCESSOR_H_ 11 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_FRAME_PREPROCESSOR_H_
15 #define WEBRTC_MODULES_VIDEO_PROCESSING_FRAME_PREPROCESSOR_H_ 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_FRAME_PREPROCESSOR_H_
16 13
14 #include "webrtc/base/scoped_ptr.h"
17 #include "webrtc/modules/video_processing/include/video_processing.h" 15 #include "webrtc/modules/video_processing/include/video_processing.h"
18 #include "webrtc/modules/video_processing/content_analysis.h" 16 #include "webrtc/modules/video_processing/content_analysis.h"
19 #include "webrtc/modules/video_processing/spatial_resampler.h" 17 #include "webrtc/modules/video_processing/spatial_resampler.h"
20 #include "webrtc/modules/video_processing/video_decimator.h" 18 #include "webrtc/modules/video_processing/video_decimator.h"
21 #include "webrtc/modules/video_processing/video_denoiser.h"
22 #include "webrtc/typedefs.h" 19 #include "webrtc/typedefs.h"
23 #include "webrtc/video_frame.h" 20 #include "webrtc/video_frame.h"
24 21
25 namespace webrtc { 22 namespace webrtc {
26 23
24 class VideoDenoiser;
25
27 class VPMFramePreprocessor { 26 class VPMFramePreprocessor {
28 public: 27 public:
29 VPMFramePreprocessor(); 28 VPMFramePreprocessor();
30 ~VPMFramePreprocessor(); 29 ~VPMFramePreprocessor();
31 30
32 void Reset(); 31 void Reset();
33 32
34 // Enable temporal decimation. 33 // Enable temporal decimation.
35 void EnableTemporalDecimation(bool enable); 34 void EnableTemporalDecimation(bool enable);
36 35
37 void SetInputFrameResampleMode(VideoFrameResampling resampling_mode); 36 void SetInputFrameResampleMode(VideoFrameResampling resampling_mode);
38 37
39 // Enable content analysis. 38 // Enable content analysis.
40 void EnableContentAnalysis(bool enable); 39 void EnableContentAnalysis(bool enable);
41 40
42 // Set target resolution: frame rate and dimension. 41 // Set target resolution: frame rate and dimension.
43 int32_t SetTargetResolution(uint32_t width, uint32_t height, 42 int32_t SetTargetResolution(uint32_t width, uint32_t height,
44 uint32_t frame_rate); 43 uint32_t frame_rate);
45 44
46 // Set target frame rate. 45 // Set target frame rate.
47 void SetTargetFramerate(int frame_rate); 46 void SetTargetFramerate(int frame_rate);
48 47
49 // Update incoming frame rate/dimension. 48 // Update incoming frame rate/dimension.
50 void UpdateIncomingframe_rate(); 49 void UpdateIncomingframe_rate();
51 50
52 int32_t updateIncomingFrameSize(uint32_t width, uint32_t height); 51 int32_t updateIncomingFrameSize(uint32_t width, uint32_t height);
53 52
54 // Set decimated values: frame rate/dimension. 53 // Set decimated values: frame rate/dimension.
55 uint32_t Decimatedframe_rate(); 54 uint32_t GetDecimatedFrameRate();
56 uint32_t DecimatedWidth() const; 55 uint32_t GetDecimatedWidth() const;
57 uint32_t DecimatedHeight() const; 56 uint32_t GetDecimatedHeight() const;
58 57
59 // Preprocess output: 58 // Preprocess output:
60 int32_t PreprocessFrame(const VideoFrame& frame, 59 void EnableDenosing(bool enable);
61 VideoFrame** processed_frame); 60 const VideoFrame* PreprocessFrame(const VideoFrame& frame);
62 VideoContentMetrics* ContentMetrics() const; 61 VideoContentMetrics* GetContentMetrics() const;
63 62
64 private: 63 private:
65 // The content does not change so much every frame, so to reduce complexity 64 // The content does not change so much every frame, so to reduce complexity
66 // we can compute new content metrics every |kSkipFrameCA| frames. 65 // we can compute new content metrics every |kSkipFrameCA| frames.
67 enum { kSkipFrameCA = 2 }; 66 enum { kSkipFrameCA = 2 };
68 67
68 // All pointers/members in this class are assumed to be protected by the class
pbos-webrtc 2015/11/30 11:51:57 Maybe put a note on the class itself rather than h
mflodman 2015/12/04 15:01:07 Done.
69 // owner.
69 VideoContentMetrics* content_metrics_; 70 VideoContentMetrics* content_metrics_;
70 VideoFrame denoised_frame_; 71 VideoFrame denoised_frame_;
71 VideoFrame resampled_frame_; 72 VideoFrame resampled_frame_;
72 VPMSpatialResampler* spatial_resampler_; 73 VPMSpatialResampler* spatial_resampler_;
73 VPMContentAnalysis* ca_; 74 VPMContentAnalysis* ca_;
74 VPMVideoDecimator* vd_; 75 VPMVideoDecimator* vd_;
75 VideoDenoiser* denoiser_; 76 rtc::scoped_ptr<VideoDenoiser> denoiser_;
76 bool enable_ca_; 77 bool enable_ca_;
77 bool enable_denoising_; 78 uint32_t frame_cnt_;
78 int frame_cnt_;
79
80 }; 79 };
81 80
82 } // namespace webrtc 81 } // namespace webrtc
83 82
84 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_FRAME_PREPROCESSOR_H_ 83 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_FRAME_PREPROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698