OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 /* | |
12 * frame_preprocessor.h | |
13 */ | |
14 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCE_FRAME_PREPROCESSOR_H | |
15 #define WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCE_FRAME_PREPROCESSOR_H | |
16 | |
17 #include "webrtc/modules/video_processing/main/interface/video_processing.h" | |
18 #include "webrtc/modules/video_processing/main/source/content_analysis.h" | |
19 #include "webrtc/modules/video_processing/main/source/spatial_resampler.h" | |
20 #include "webrtc/modules/video_processing/main/source/video_decimator.h" | |
21 #include "webrtc/typedefs.h" | |
22 | |
23 namespace webrtc { | |
24 | |
25 class VPMFramePreprocessor { | |
26 public: | |
27 VPMFramePreprocessor(); | |
28 ~VPMFramePreprocessor(); | |
29 | |
30 void Reset(); | |
31 | |
32 // Enable temporal decimation. | |
33 void EnableTemporalDecimation(bool enable); | |
34 | |
35 void SetInputFrameResampleMode(VideoFrameResampling resampling_mode); | |
36 | |
37 // Enable content analysis. | |
38 void EnableContentAnalysis(bool enable); | |
39 | |
40 // Set target resolution: frame rate and dimension. | |
41 int32_t SetTargetResolution(uint32_t width, uint32_t height, | |
42 uint32_t frame_rate); | |
43 | |
44 // Set target frame rate. | |
45 void SetTargetFramerate(int frame_rate); | |
46 | |
47 // Update incoming frame rate/dimension. | |
48 void UpdateIncomingframe_rate(); | |
49 | |
50 int32_t updateIncomingFrameSize(uint32_t width, uint32_t height); | |
51 | |
52 // Set decimated values: frame rate/dimension. | |
53 uint32_t Decimatedframe_rate(); | |
54 uint32_t DecimatedWidth() const; | |
55 uint32_t DecimatedHeight() const; | |
56 | |
57 // Preprocess output: | |
58 int32_t PreprocessFrame(const VideoFrame& frame, | |
59 VideoFrame** processed_frame); | |
60 VideoContentMetrics* ContentMetrics() const; | |
61 | |
62 private: | |
63 // The content does not change so much every frame, so to reduce complexity | |
64 // we can compute new content metrics every |kSkipFrameCA| frames. | |
65 enum { kSkipFrameCA = 2 }; | |
66 | |
67 VideoContentMetrics* content_metrics_; | |
68 VideoFrame resampled_frame_; | |
69 VPMSpatialResampler* spatial_resampler_; | |
70 VPMContentAnalysis* ca_; | |
71 VPMVideoDecimator* vd_; | |
72 bool enable_ca_; | |
73 int frame_cnt_; | |
74 | |
75 }; | |
76 | |
77 } // namespace webrtc | |
78 | |
79 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCE_FRAME_PREPROCESSOR_H | |
OLD | NEW |