blob: 2f295c72a6c257b6dd1c0bc014c789a234f5d9e3 [file] [log] [blame]
niklase@google.com77ae29b2011-05-30 11:22:19 +00001/*
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// This file implements a class that can be used for scaling frames.
12#ifndef WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_
13#define WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_
14
15#ifdef WEBRTC_MODULE_UTILITY_VIDEO
16
17#include "engine_configurations.h"
18#include "module_common_types.h"
19#include "typedefs.h"
20
21namespace webrtc
22{
23// TODO (perkj): add interpolator. Current implementation only support scaling
24// (up or down) where the width and height are scaled by a constant factor 2-4.
25// Also remove NO_INTERPOLATOR.
26
27// Disable usage of the old intertpolator implementation.
28#define NO_INTERPOLATOR 1
29
30
31class VideoFrame;
32class FrameScaler
33{
34public:
35 FrameScaler();
36 ~FrameScaler();
37
38 // Re-size videoFrame so that it has the width outWidth and height
39 // outHeight.
40 WebRtc_Word32 ResizeFrameIfNeeded(VideoFrame& videoFrame,
41 WebRtc_UWord32 outWidth,
42 WebRtc_UWord32 outHeight);
43private:
44 typedef WebRtc_Word8* VideoInterpolator;
45 VideoInterpolator*_ptrVideoInterpolator;
46
47 VideoFrame _interpolatorBuffer;
48 WebRtc_UWord32 _outWidth;
49 WebRtc_UWord32 _outHeight;
50 WebRtc_UWord32 _inWidth;
51 WebRtc_UWord32 _inHeight;
52
53};
54#endif // WEBRTC_MODULE_UTILITY_VIDEO
55} // namespace webrtc
56#endif // WEBRTC_MODULES_UTILITY_SOURCE_FRAME_SCALER_H_