Bug 1857841 - pt 3. Add a new page kind named "fresh" r=glandium
[gecko.git] / gfx / ycbcr / ycbcr_to_rgb565.h
blob7793962b5c26bb659c04023974645c604f8e22d9
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #ifndef MEDIA_BASE_YCBCR_TO_RGB565_H_
5 #define MEDIA_BASE_YCBCR_TO_RGB565_H_
6 #include "yuv_convert.h"
7 #include "mozilla/arm.h"
9 // It's currently only worth including this if we have NEON support.
10 #if defined(__arm__) && defined(MOZILLA_MAY_SUPPORT_NEON)
11 #define HAVE_YCBCR_TO_RGB565 1
12 #endif
14 namespace mozilla {
16 namespace gfx {
18 #ifdef HAVE_YCBCR_TO_RGB565
19 // Convert a frame of YUV to 16 bit RGB565.
20 void ConvertYCbCrToRGB565(const uint8_t* yplane,
21 const uint8_t* uplane,
22 const uint8_t* vplane,
23 uint8_t* rgbframe,
24 int pic_x,
25 int pic_y,
26 int pic_width,
27 int pic_height,
28 int ystride,
29 int uvstride,
30 int rgbstride,
31 YUVType yuv_type);
33 // Used to test if we have an accelerated version.
34 bool IsConvertYCbCrToRGB565Fast(int pic_x,
35 int pic_y,
36 int pic_width,
37 int pic_height,
38 YUVType yuv_type);
40 // Scale a frame of YUV to 16 bit RGB565.
41 void ScaleYCbCrToRGB565(const uint8_t *yplane,
42 const uint8_t *uplane,
43 const uint8_t *vplane,
44 uint8_t *rgbframe,
45 int source_x0,
46 int source_y0,
47 int source_width,
48 int source_height,
49 int width,
50 int height,
51 int ystride,
52 int uvstride,
53 int rgbstride,
54 YUVType yuv_type,
55 ScaleFilter filter);
57 // Used to test if we have an accelerated version.
58 bool IsScaleYCbCrToRGB565Fast(int source_x0,
59 int source_y0,
60 int source_width,
61 int source_height,
62 int width,
63 int height,
64 YUVType yuv_type,
65 ScaleFilter filter);
66 #endif // HAVE_YCBCR_TO_RGB565
68 } // namespace gfx
70 } // namespace mozilla
72 #endif // MEDIA_BASE_YCBCR_TO_RGB565_H_