diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /gfx/ycbcr/ycbcr_to_rgb565.h | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/ycbcr/ycbcr_to_rgb565.h')
-rw-r--r-- | gfx/ycbcr/ycbcr_to_rgb565.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/gfx/ycbcr/ycbcr_to_rgb565.h b/gfx/ycbcr/ycbcr_to_rgb565.h new file mode 100644 index 0000000000..7793962b5c --- /dev/null +++ b/gfx/ycbcr/ycbcr_to_rgb565.h @@ -0,0 +1,72 @@ +// 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. +#ifndef MEDIA_BASE_YCBCR_TO_RGB565_H_ +#define MEDIA_BASE_YCBCR_TO_RGB565_H_ +#include "yuv_convert.h" +#include "mozilla/arm.h" + +// It's currently only worth including this if we have NEON support. +#if defined(__arm__) && defined(MOZILLA_MAY_SUPPORT_NEON) +#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. +void ConvertYCbCrToRGB565(const uint8_t* yplane, + const uint8_t* uplane, + const uint8_t* vplane, + uint8_t* 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. +bool IsConvertYCbCrToRGB565Fast(int pic_x, + int pic_y, + int pic_width, + int pic_height, + YUVType yuv_type); + +// Scale a frame of YUV to 16 bit RGB565. +void ScaleYCbCrToRGB565(const uint8_t *yplane, + const uint8_t *uplane, + const uint8_t *vplane, + uint8_t *rgbframe, + 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. +bool IsScaleYCbCrToRGB565Fast(int source_x0, + int source_y0, + int source_width, + int source_height, + int width, + int height, + YUVType yuv_type, + ScaleFilter filter); +#endif // HAVE_YCBCR_TO_RGB565 + +} // namespace gfx + +} // namespace mozilla + +#endif // MEDIA_BASE_YCBCR_TO_RGB565_H_ |