niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
andrew@webrtc.org | c1354bd | 2012-07-27 18:21:16 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
Henrik Kjellander | 0f59a88 | 2015-11-18 22:31:24 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ |
| 12 | #define WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
pbos@webrtc.org | 6f3d8fc | 2013-05-27 14:12:16 +0000 | [diff] [blame] | 14 | #include "webrtc/typedefs.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 15 | |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 16 | #include "webrtc/modules/include/module_common_types.h" |
Henrik Kjellander | 0f59a88 | 2015-11-18 22:31:24 +0100 | [diff] [blame] | 17 | #include "webrtc/modules/video_processing/include/video_processing_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 18 | |
pbos@webrtc.org | 6f3d8fc | 2013-05-27 14:12:16 +0000 | [diff] [blame] | 19 | #include "webrtc/common_video/libyuv/include/scaler.h" |
| 20 | #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
| 23 | |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 24 | class VPMSpatialResampler { |
| 25 | public: |
mflodman | 99ab944 | 2015-12-07 22:54:50 -0800 | [diff] [blame^] | 26 | virtual ~VPMSpatialResampler() {} |
pbos@webrtc.org | 1ab45f6 | 2013-04-09 13:38:10 +0000 | [diff] [blame] | 27 | virtual int32_t SetTargetFrameSize(int32_t width, int32_t height) = 0; |
mflodman | 99ab944 | 2015-12-07 22:54:50 -0800 | [diff] [blame^] | 28 | virtual void SetInputFrameResampleMode( |
| 29 | VideoFrameResampling resampling_mode) = 0; |
mikhal@webrtc.org | 2ab104e | 2011-12-09 02:46:22 +0000 | [diff] [blame] | 30 | virtual void Reset() = 0; |
Miguel Casas-Sanchez | 4765070 | 2015-05-29 17:21:40 -0700 | [diff] [blame] | 31 | virtual int32_t ResampleFrame(const VideoFrame& inFrame, |
| 32 | VideoFrame* outFrame) = 0; |
pbos@webrtc.org | 1ab45f6 | 2013-04-09 13:38:10 +0000 | [diff] [blame] | 33 | virtual int32_t TargetWidth() = 0; |
| 34 | virtual int32_t TargetHeight() = 0; |
| 35 | virtual bool ApplyResample(int32_t width, int32_t height) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | }; |
| 37 | |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 38 | class VPMSimpleSpatialResampler : public VPMSpatialResampler { |
| 39 | public: |
mikhal@webrtc.org | 2ab104e | 2011-12-09 02:46:22 +0000 | [diff] [blame] | 40 | VPMSimpleSpatialResampler(); |
| 41 | ~VPMSimpleSpatialResampler(); |
pbos@webrtc.org | 1ab45f6 | 2013-04-09 13:38:10 +0000 | [diff] [blame] | 42 | virtual int32_t SetTargetFrameSize(int32_t width, int32_t height); |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 43 | virtual void SetInputFrameResampleMode(VideoFrameResampling resampling_mode); |
mikhal@webrtc.org | 2ab104e | 2011-12-09 02:46:22 +0000 | [diff] [blame] | 44 | virtual void Reset(); |
Miguel Casas-Sanchez | 4765070 | 2015-05-29 17:21:40 -0700 | [diff] [blame] | 45 | virtual int32_t ResampleFrame(const VideoFrame& inFrame, |
| 46 | VideoFrame* outFrame); |
pbos@webrtc.org | 1ab45f6 | 2013-04-09 13:38:10 +0000 | [diff] [blame] | 47 | virtual int32_t TargetWidth(); |
| 48 | virtual int32_t TargetHeight(); |
| 49 | virtual bool ApplyResample(int32_t width, int32_t height); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 50 | |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 51 | private: |
mflodman | 99ab944 | 2015-12-07 22:54:50 -0800 | [diff] [blame^] | 52 | VideoFrameResampling resampling_mode_; |
| 53 | int32_t target_width_; |
| 54 | int32_t target_height_; |
| 55 | Scaler scaler_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
mikhal@webrtc.org | b43d807 | 2013-10-03 16:42:41 +0000 | [diff] [blame] | 58 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 59 | |
Henrik Kjellander | 0f59a88 | 2015-11-18 22:31:24 +0100 | [diff] [blame] | 60 | #endif // WEBRTC_MODULES_VIDEO_PROCESSING_SPATIAL_RESAMPLER_H_ |