2011-01-19 20:38:38 +03:00
|
|
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2011-04-08 22:57:52 +04:00
|
|
|
#ifndef MEDIA_BASE_YCBCR_TO_RGB565_H_
|
|
|
|
#define MEDIA_BASE_YCBCR_TO_RGB565_H_
|
2011-04-08 22:59:22 +04:00
|
|
|
#include "yuv_convert.h"
|
2011-04-08 22:57:52 +04:00
|
|
|
#include "mozilla/arm.h"
|
2011-01-19 20:38:38 +03:00
|
|
|
|
2011-04-08 22:59:22 +04:00
|
|
|
// It's currently only worth including this if we have NEON support.
|
2017-04-28 07:22:07 +03:00
|
|
|
#if defined(__arm__) && defined(MOZILLA_MAY_SUPPORT_NEON)
|
2011-04-08 22:59:22 +04:00
|
|
|
#define HAVE_YCBCR_TO_RGB565 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace gfx {
|
|
|
|
|
|
|
|
#ifdef HAVE_YCBCR_TO_RGB565
|
|
|
|
// Convert a frame of YUV to 16 bit RGB565.
|
2015-09-08 00:53:36 +03:00
|
|
|
void ConvertYCbCrToRGB565(const uint8* yplane,
|
2011-04-08 22:59:22 +04:00
|
|
|
const uint8* uplane,
|
|
|
|
const uint8* vplane,
|
|
|
|
uint8* rgbframe,
|
|
|
|
int pic_x,
|
|
|
|
int pic_y,
|
|
|
|
int pic_width,
|
|
|
|
int pic_height,
|
|
|
|
int ystride,
|
|
|
|
int uvstride,
|
|
|
|
int rgbstride,
|
|
|
|
YUVType yuv_type);
|
|
|
|
|
|
|
|
// Used to test if we have an accelerated version.
|
2015-09-08 00:53:36 +03:00
|
|
|
bool IsConvertYCbCrToRGB565Fast(int pic_x,
|
2011-04-08 22:59:22 +04:00
|
|
|
int pic_y,
|
|
|
|
int pic_width,
|
|
|
|
int pic_height,
|
|
|
|
YUVType yuv_type);
|
2011-04-15 04:32:15 +04:00
|
|
|
|
|
|
|
// Scale a frame of YUV to 16 bit RGB565.
|
2015-09-08 00:53:36 +03:00
|
|
|
void ScaleYCbCrToRGB565(const uint8_t *yplane,
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint8_t *uplane,
|
|
|
|
const uint8_t *vplane,
|
|
|
|
uint8_t *rgbframe,
|
2011-04-15 04:32:15 +04:00
|
|
|
int source_x0,
|
|
|
|
int source_y0,
|
|
|
|
int source_width,
|
|
|
|
int source_height,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
int ystride,
|
|
|
|
int uvstride,
|
|
|
|
int rgbstride,
|
|
|
|
YUVType yuv_type,
|
|
|
|
ScaleFilter filter);
|
|
|
|
|
|
|
|
// Used to test if we have an accelerated version.
|
2015-09-08 00:53:36 +03:00
|
|
|
bool IsScaleYCbCrToRGB565Fast(int source_x0,
|
2011-04-15 04:32:15 +04:00
|
|
|
int source_y0,
|
|
|
|
int source_width,
|
|
|
|
int source_height,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
YUVType yuv_type,
|
|
|
|
ScaleFilter filter);
|
2011-04-08 22:59:22 +04:00
|
|
|
#endif // HAVE_YCBCR_TO_RGB565
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gfx
|
2011-04-08 22:59:22 +04:00
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|
2011-04-08 22:57:52 +04:00
|
|
|
|
|
|
|
#endif // MEDIA_BASE_YCBCR_TO_RGB565_H_
|