| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2011 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 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCEdeflickering__H | |
| 12 #define WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCEdeflickering__H | |
| 13 | |
| 14 #include <string.h> // NULL | |
| 15 | |
| 16 #include "webrtc/modules/video_processing/main/interface/video_processing.h" | |
| 17 #include "webrtc/typedefs.h" | |
| 18 | |
| 19 namespace webrtc { | |
| 20 | |
| 21 class VPMDeflickering { | |
| 22 public: | |
| 23 VPMDeflickering(); | |
| 24 ~VPMDeflickering(); | |
| 25 | |
| 26 void Reset(); | |
| 27 int32_t ProcessFrame(VideoFrame* frame, | |
| 28 VideoProcessingModule::FrameStats* stats); | |
| 29 | |
| 30 private: | |
| 31 int32_t PreDetection(uint32_t timestamp, | |
| 32 const VideoProcessingModule::FrameStats& stats); | |
| 33 | |
| 34 int32_t DetectFlicker(); | |
| 35 | |
| 36 enum { kMeanBufferLength = 32 }; | |
| 37 enum { kFrameHistory_size = 15 }; | |
| 38 enum { kNumProbs = 12 }; | |
| 39 enum { kNumQuants = kNumProbs + 2 }; | |
| 40 enum { kMaxOnlyLength = 5 }; | |
| 41 | |
| 42 uint32_t mean_buffer_length_; | |
| 43 uint8_t detection_state_; // 0: No flickering | |
| 44 // 1: Flickering detected | |
| 45 // 2: In flickering | |
| 46 int32_t mean_buffer_[kMeanBufferLength]; | |
| 47 uint32_t timestamp_buffer_[kMeanBufferLength]; | |
| 48 uint32_t frame_rate_; | |
| 49 static const uint16_t prob_uw16_[kNumProbs]; | |
| 50 static const uint16_t weight_uw16_[kNumQuants - kMaxOnlyLength]; | |
| 51 uint8_t quant_hist_uw8_[kFrameHistory_size][kNumQuants]; | |
| 52 }; | |
| 53 | |
| 54 } // namespace webrtc | |
| 55 | |
| 56 #endif // WEBRTC_MODULES_VIDEO_PROCESSING_MAIN_SOURCEdeflickering__H | |
| OLD | NEW |