mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 08:46:47 +08:00
I422ToRGB24, I422ToRAW, I422ToRGB24MatrixFilter conversion functions added.
- YUV to RGB use linear for first and last row. - add assert(yuvconstants) - rename pointers to match row functions. - use macros that match row functions. - use 12 bit upsampler for conversions of 10 and 12 bits Cortex A53 AArch32 I420ToRGB24_Opt (3627 ms) I422ToRGB24_Opt (4099 ms) I444ToRGB24_Opt (4186 ms) I420ToRGB24Filter_Opt (5451 ms) I422ToRGB24Filter_Opt (5430 ms) AVX2 Was I420ToRGB24Filter_Opt (583 ms) Now I420ToRGB24Filter_Opt (560 ms) Neon Cortex A7 Was I420ToRGB24Filter_Opt (5447 ms) Now I420ToRGB24Filter_Opt (5439 ms) Bug: libyuv:938 Change-Id: I1731f2dd591073ae11a756f06574103ba0f803c7 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3906082 Reviewed-by: Justin Green <greenjustin@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
be50557db7
commit
248172e2ba
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1841
|
||||
Version: 1844
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -404,6 +404,32 @@ int U444ToABGR(const uint8_t* src_y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I444 to RGB24.
|
||||
LIBYUV_API
|
||||
int I444ToRGB24(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb24,
|
||||
int dst_stride_rgb24,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I444 to RAW.
|
||||
LIBYUV_API
|
||||
int I444ToRAW(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_raw,
|
||||
int dst_stride_raw,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I010 to ARGB.
|
||||
LIBYUV_API
|
||||
int I010ToARGB(const uint16_t* src_y,
|
||||
@ -1312,6 +1338,32 @@ int J420ToRAW(const uint8_t* src_y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I422 to RGB24.
|
||||
LIBYUV_API
|
||||
int I422ToRGB24(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb24,
|
||||
int dst_stride_rgb24,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I422 to RAW.
|
||||
LIBYUV_API
|
||||
int I422ToRAW(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_raw,
|
||||
int dst_stride_raw,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
LIBYUV_API
|
||||
int I420ToRGB565(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
@ -1495,6 +1547,20 @@ int I444ToARGBMatrix(const uint8_t* src_y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I444 to RGB24 with matrix.
|
||||
LIBYUV_API
|
||||
int I444ToRGB24Matrix(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb24,
|
||||
int dst_stride_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert 10 bit 420 YUV to ARGB with matrix.
|
||||
LIBYUV_API
|
||||
int I010ToAR30Matrix(const uint16_t* src_y,
|
||||
@ -1893,6 +1959,20 @@ int I420ToRGB24Matrix(const uint8_t* src_y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I422 to RGB24 with matrix.
|
||||
LIBYUV_API
|
||||
int I422ToRGB24Matrix(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb24,
|
||||
int dst_stride_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
// Convert I420 to RGB565 with specified color matrix.
|
||||
LIBYUV_API
|
||||
int I420ToRGB565Matrix(const uint8_t* src_y,
|
||||
@ -1975,6 +2055,21 @@ int I422ToARGBMatrixFilter(const uint8_t* src_y,
|
||||
int height,
|
||||
enum FilterMode filter);
|
||||
|
||||
// Convert I422 to RGB24 with matrix and UV filter mode.
|
||||
LIBYUV_API
|
||||
int I422ToRGB24MatrixFilter(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
const uint8_t* src_u,
|
||||
int src_stride_u,
|
||||
const uint8_t* src_v,
|
||||
int src_stride_v,
|
||||
uint8_t* dst_rgb24,
|
||||
int dst_stride_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width,
|
||||
int height,
|
||||
enum FilterMode filter);
|
||||
|
||||
// Convert I420 to RGB24 with matrix and UV filter mode.
|
||||
LIBYUV_API
|
||||
int I420ToRGB24MatrixFilter(const uint8_t* src_y,
|
||||
|
||||
@ -111,6 +111,7 @@ extern "C" {
|
||||
#define HAS_I422TOUYVYROW_SSE2
|
||||
#define HAS_I422TOYUY2ROW_SSE2
|
||||
#define HAS_I444TOARGBROW_SSSE3
|
||||
#define HAS_I444TORGB24ROW_SSSE3
|
||||
#define HAS_INTERPOLATEROW_SSSE3
|
||||
#define HAS_J400TOARGBROW_SSE2
|
||||
#define HAS_J422TOARGBROW_SSSE3
|
||||
@ -219,6 +220,7 @@ extern "C" {
|
||||
#define HAS_I422TORGB565ROW_AVX2
|
||||
#define HAS_I422TORGBAROW_AVX2
|
||||
#define HAS_I444TOARGBROW_AVX2
|
||||
#define HAS_I444TORGB24ROW_AVX2
|
||||
#define HAS_INTERPOLATEROW_AVX2
|
||||
#define HAS_J422TOARGBROW_AVX2
|
||||
#define HAS_MERGEUVROW_AVX2
|
||||
@ -469,6 +471,7 @@ extern "C" {
|
||||
#define HAS_I422TOYUY2ROW_NEON
|
||||
#define HAS_I444ALPHATOARGBROW_NEON
|
||||
#define HAS_I444TOARGBROW_NEON
|
||||
#define HAS_I444TORGB24ROW_NEON
|
||||
#define HAS_INTERPOLATEROW_16_NEON
|
||||
#define HAS_INTERPOLATEROW_NEON
|
||||
#define HAS_J400TOARGBROW_NEON
|
||||
@ -903,6 +906,12 @@ void I444ToARGBRow_NEON(const uint8_t* src_y,
|
||||
uint8_t* dst_argb,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToRGB24Row_NEON(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I422ToARGBRow_NEON(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
@ -3183,6 +3192,12 @@ void I444ToARGBRow_C(const uint8_t* src_y,
|
||||
uint8_t* rgb_buf,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToRGB24Row_C(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
uint8_t* rgb_buf,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I422ToARGBRow_C(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
@ -3377,6 +3392,18 @@ void I444ToARGBRow_AVX2(const uint8_t* y_buf,
|
||||
uint8_t* dst_argb,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToRGB24Row_SSSE3(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToRGB24Row_AVX2(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I422ToARGBRow_SSSE3(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
@ -3718,12 +3745,24 @@ void I444ToARGBRow_Any_SSSE3(const uint8_t* y_buf,
|
||||
uint8_t* dst_ptr,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToRGB24Row_Any_SSSE3(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_ptr,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToARGBRow_Any_AVX2(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_ptr,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToRGB24Row_Any_AVX2(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_ptr,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I422ToARGBRow_Any_SSSE3(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
@ -4385,6 +4424,12 @@ void I444ToARGBRow_Any_NEON(const uint8_t* y_buf,
|
||||
uint8_t* dst_ptr,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I444ToRGB24Row_Any_NEON(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_ptr,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I422ToARGBRow_Any_NEON(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1841
|
||||
#define LIBYUV_VERSION 1844
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -359,6 +359,9 @@ ANY31C(I422ToAR30Row_Any_AVX2, I422ToAR30Row_AVX2, 1, 0, 4, 15)
|
||||
#ifdef HAS_I444TOARGBROW_SSSE3
|
||||
ANY31C(I444ToARGBRow_Any_SSSE3, I444ToARGBRow_SSSE3, 0, 0, 4, 7)
|
||||
#endif
|
||||
#ifdef HAS_I444TORGB24ROW_SSSE3
|
||||
ANY31C(I444ToRGB24Row_Any_SSSE3, I444ToRGB24Row_SSSE3, 0, 0, 3, 15)
|
||||
#endif
|
||||
#ifdef HAS_I422TORGB24ROW_AVX2
|
||||
ANY31C(I422ToRGB24Row_Any_AVX2, I422ToRGB24Row_AVX2, 1, 0, 3, 31)
|
||||
#endif
|
||||
@ -374,6 +377,9 @@ ANY31C(I422ToRGBARow_Any_AVX2, I422ToRGBARow_AVX2, 1, 0, 4, 15)
|
||||
#ifdef HAS_I444TOARGBROW_AVX2
|
||||
ANY31C(I444ToARGBRow_Any_AVX2, I444ToARGBRow_AVX2, 0, 0, 4, 15)
|
||||
#endif
|
||||
#ifdef HAS_I444TORGB24ROW_AVX2
|
||||
ANY31C(I444ToRGB24Row_Any_AVX2, I444ToRGB24Row_AVX2, 0, 0, 3, 31)
|
||||
#endif
|
||||
#ifdef HAS_I422TOARGB4444ROW_AVX2
|
||||
ANY31C(I422ToARGB4444Row_Any_AVX2, I422ToARGB4444Row_AVX2, 1, 0, 2, 15)
|
||||
#endif
|
||||
@ -383,6 +389,9 @@ ANY31C(I422ToARGB1555Row_Any_AVX2, I422ToARGB1555Row_AVX2, 1, 0, 2, 15)
|
||||
#ifdef HAS_I422TORGB565ROW_AVX2
|
||||
ANY31C(I422ToRGB565Row_Any_AVX2, I422ToRGB565Row_AVX2, 1, 0, 2, 15)
|
||||
#endif
|
||||
#ifdef HAS_I444TORGB24ROW_NEON
|
||||
ANY31C(I444ToRGB24Row_Any_NEON, I444ToRGB24Row_NEON, 0, 0, 3, 7)
|
||||
#endif
|
||||
#ifdef HAS_I422TOARGBROW_NEON
|
||||
ANY31C(I444ToARGBRow_Any_NEON, I444ToARGBRow_NEON, 0, 0, 4, 7)
|
||||
ANY31C(I422ToARGBRow_Any_NEON, I422ToARGBRow_NEON, 1, 0, 4, 7)
|
||||
|
||||
@ -1863,6 +1863,23 @@ void I444ToARGBRow_C(const uint8_t* src_y,
|
||||
}
|
||||
}
|
||||
|
||||
void I444ToRGB24Row_C(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
uint8_t* rgb_buf,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width) {
|
||||
int x;
|
||||
for (x = 0; x < width; ++x) {
|
||||
YuvPixel(src_y[0], src_u[0], src_v[0], rgb_buf + 0, rgb_buf + 1,
|
||||
rgb_buf + 2, yuvconstants);
|
||||
src_y += 1;
|
||||
src_u += 1;
|
||||
src_v += 1;
|
||||
rgb_buf += 3; // Advance 1 pixel.
|
||||
}
|
||||
}
|
||||
|
||||
// Also used for 420
|
||||
void I422ToARGBRow_C(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
@ -4061,6 +4078,32 @@ void I422ToRGB24Row_AVX2(const uint8_t* src_y,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAS_I444TORGB24ROW_AVX2)
|
||||
void I444ToRGB24Row_AVX2(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width) {
|
||||
// Row buffer for intermediate ARGB pixels.
|
||||
SIMD_ALIGNED(uint8_t row[MAXTWIDTH * 4]);
|
||||
while (width > 0) {
|
||||
int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
|
||||
I444ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth);
|
||||
#if defined(HAS_ARGBTORGB24ROW_AVX2)
|
||||
ARGBToRGB24Row_AVX2(row, dst_rgb24, twidth);
|
||||
#else
|
||||
ARGBToRGB24Row_SSSE3(row, dst_rgb24, twidth);
|
||||
#endif
|
||||
src_y += twidth;
|
||||
src_u += twidth;
|
||||
src_v += twidth;
|
||||
dst_rgb24 += twidth * 3;
|
||||
width -= twidth;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAS_NV12TORGB565ROW_AVX2)
|
||||
void NV12ToRGB565Row_AVX2(const uint8_t* src_y,
|
||||
const uint8_t* src_uv,
|
||||
|
||||
@ -2582,6 +2582,20 @@ void RGBAToUVRow_SSSE3(const uint8_t* src_rgba,
|
||||
"movdqu %%xmm0,0x10(%[dst_rgba]) \n" \
|
||||
"lea 0x20(%[dst_rgba]),%[dst_rgba] \n"
|
||||
|
||||
// Store 8 RGB24 values.
|
||||
#define STORERGB24 \
|
||||
"punpcklbw %%xmm1,%%xmm0 \n" \
|
||||
"punpcklbw %%xmm2,%%xmm2 \n" \
|
||||
"movdqa %%xmm0,%%xmm1 \n" \
|
||||
"punpcklwd %%xmm2,%%xmm0 \n" \
|
||||
"punpckhwd %%xmm2,%%xmm1 \n" \
|
||||
"pshufb %%xmm5,%%xmm0 \n" \
|
||||
"pshufb %%xmm6,%%xmm1 \n" \
|
||||
"palignr $0xc,%%xmm0,%%xmm1 \n" \
|
||||
"movq %%xmm0,(%[dst_rgb24]) \n" \
|
||||
"movdqu %%xmm1,0x8(%[dst_rgb24]) \n" \
|
||||
"lea 0x18(%[dst_rgb24]),%[dst_rgb24] \n"
|
||||
|
||||
// Store 8 AR30 values.
|
||||
#define STOREAR30 \
|
||||
"psraw $0x4,%%xmm0 \n" \
|
||||
@ -2691,17 +2705,43 @@ void OMITFP I422ToRGB24Row_SSSE3(const uint8_t* y_buf,
|
||||
"1: \n"
|
||||
READYUV422
|
||||
YUVTORGB(yuvconstants)
|
||||
"punpcklbw %%xmm1,%%xmm0 \n"
|
||||
"punpcklbw %%xmm2,%%xmm2 \n"
|
||||
"movdqa %%xmm0,%%xmm1 \n"
|
||||
"punpcklwd %%xmm2,%%xmm0 \n"
|
||||
"punpckhwd %%xmm2,%%xmm1 \n"
|
||||
"pshufb %%xmm5,%%xmm0 \n"
|
||||
"pshufb %%xmm6,%%xmm1 \n"
|
||||
"palignr $0xc,%%xmm0,%%xmm1 \n"
|
||||
"movq %%xmm0,(%[dst_rgb24]) \n"
|
||||
"movdqu %%xmm1,0x8(%[dst_rgb24]) \n"
|
||||
"lea 0x18(%[dst_rgb24]),%[dst_rgb24] \n"
|
||||
STORERGB24
|
||||
"subl $0x8,%[width] \n"
|
||||
"jg 1b \n"
|
||||
: [y_buf]"+r"(y_buf), // %[y_buf]
|
||||
[u_buf]"+r"(u_buf), // %[u_buf]
|
||||
[v_buf]"+r"(v_buf), // %[v_buf]
|
||||
[dst_rgb24]"+r"(dst_rgb24), // %[dst_rgb24]
|
||||
#if defined(__i386__)
|
||||
[width]"+m"(width) // %[width]
|
||||
#else
|
||||
[width]"+rm"(width) // %[width]
|
||||
#endif
|
||||
: [yuvconstants]"r"(yuvconstants), // %[yuvconstants]
|
||||
[kShuffleMaskARGBToRGB24_0]"m"(kShuffleMaskARGBToRGB24_0),
|
||||
[kShuffleMaskARGBToRGB24]"m"(kShuffleMaskARGBToRGB24)
|
||||
: "memory", "cc", YUVTORGB_REGS
|
||||
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"
|
||||
);
|
||||
}
|
||||
|
||||
void OMITFP I444ToRGB24Row_SSSE3(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width) {
|
||||
asm volatile (
|
||||
YUVTORGB_SETUP(yuvconstants)
|
||||
"movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n"
|
||||
"movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n"
|
||||
"sub %[u_buf],%[v_buf] \n"
|
||||
|
||||
LABELALIGN
|
||||
"1: \n"
|
||||
READYUV444
|
||||
YUVTORGB(yuvconstants)
|
||||
STORERGB24
|
||||
"subl $0x8,%[width] \n"
|
||||
"jg 1b \n"
|
||||
: [y_buf]"+r"(y_buf), // %[y_buf]
|
||||
|
||||
@ -156,6 +156,29 @@ void I444ToARGBRow_NEON(const uint8_t* src_y,
|
||||
: "cc", "memory", YUVTORGB_REGS, "d6");
|
||||
}
|
||||
|
||||
void I444ToRGB24Row_NEON(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width) {
|
||||
asm volatile(
|
||||
YUVTORGB_SETUP
|
||||
"1: \n" READYUV444 YUVTORGB
|
||||
RGBTORGB8
|
||||
"subs %[width], %[width], #8 \n"
|
||||
"vst3.8 {d0, d2, d4}, [%[dst_rgb24]]! \n"
|
||||
"bgt 1b \n"
|
||||
: [src_y] "+r"(src_y), // %[src_y]
|
||||
[src_u] "+r"(src_u), // %[src_u]
|
||||
[src_v] "+r"(src_v), // %[src_v]
|
||||
[dst_rgb24] "+r"(dst_rgb24), // %[dst_argb]
|
||||
[width] "+r"(width) // %[width]
|
||||
: [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff]
|
||||
[kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias]
|
||||
: "cc", "memory", YUVTORGB_REGS);
|
||||
}
|
||||
|
||||
void I422ToARGBRow_NEON(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
|
||||
@ -142,6 +142,29 @@ void I444ToARGBRow_NEON(const uint8_t* src_y,
|
||||
: "cc", "memory", YUVTORGB_REGS, "v19");
|
||||
}
|
||||
|
||||
void I444ToRGB24Row_NEON(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width) {
|
||||
asm volatile(
|
||||
YUVTORGB_SETUP
|
||||
"1: \n" READYUV444 YUVTORGB
|
||||
RGBTORGB8
|
||||
"subs %w[width], %w[width], #8 \n"
|
||||
"st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n"
|
||||
"b.gt 1b \n"
|
||||
: [src_y] "+r"(src_y), // %[src_y]
|
||||
[src_u] "+r"(src_u), // %[src_u]
|
||||
[src_v] "+r"(src_v), // %[src_v]
|
||||
[dst_rgb24] "+r"(dst_rgb24), // %[dst_rgb24]
|
||||
[width] "+r"(width) // %[width]
|
||||
: [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff]
|
||||
[kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias]
|
||||
: "cc", "memory", YUVTORGB_REGS);
|
||||
}
|
||||
|
||||
void I422ToARGBRow_NEON(const uint8_t* src_y,
|
||||
const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
|
||||
@ -2789,6 +2789,44 @@ __declspec(naked) void I422ToRGB24Row_SSSE3(
|
||||
}
|
||||
}
|
||||
|
||||
// 8 pixels.
|
||||
// 8 UV values, mixed with 8 Y producing 8 RGB24 (24 bytes).
|
||||
__declspec(naked) void I444ToRGB24Row_SSSE3(
|
||||
const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
uint8_t* dst_rgb24,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width) {
|
||||
__asm {
|
||||
push esi
|
||||
push edi
|
||||
push ebx
|
||||
mov eax, [esp + 12 + 4] // Y
|
||||
mov esi, [esp + 12 + 8] // U
|
||||
mov edi, [esp + 12 + 12] // V
|
||||
mov edx, [esp + 12 + 16] // argb
|
||||
mov ebx, [esp + 12 + 20] // yuvconstants
|
||||
mov ecx, [esp + 12 + 24] // width
|
||||
sub edi, esi
|
||||
movdqa xmm5, xmmword ptr kShuffleMaskARGBToRGB24_0
|
||||
movdqa xmm6, xmmword ptr kShuffleMaskARGBToRGB24
|
||||
|
||||
convertloop:
|
||||
READYUV444
|
||||
YUVTORGB(ebx)
|
||||
STORERGB24
|
||||
|
||||
sub ecx, 8
|
||||
jg convertloop
|
||||
|
||||
pop ebx
|
||||
pop edi
|
||||
pop esi
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
// 8 pixels
|
||||
// 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 RGB565 (16 bytes).
|
||||
__declspec(naked) void I422ToRGB565Row_SSSE3(
|
||||
|
||||
@ -683,6 +683,9 @@ TESTBIPLANARTOP(MM21, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8, 16, 32)
|
||||
#define I420ToRGB24Filter(a, b, c, d, e, f, g, h, i, j) \
|
||||
I420ToRGB24MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \
|
||||
kFilterBilinear)
|
||||
#define I422ToRGB24Filter(a, b, c, d, e, f, g, h, i, j) \
|
||||
I420ToRGB24MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \
|
||||
kFilterBilinear)
|
||||
|
||||
#define ALIGNINT(V, ALIGN) (((V) + (ALIGN)-1) / (ALIGN) * (ALIGN))
|
||||
|
||||
@ -795,8 +798,12 @@ TESTPLANARTOB(V422, 2, 1, ARGB, 4, 4, 1)
|
||||
TESTPLANARTOB(V422, 2, 1, ABGR, 4, 4, 1)
|
||||
TESTPLANARTOB(I422, 2, 1, BGRA, 4, 4, 1)
|
||||
TESTPLANARTOB(I422, 2, 1, RGBA, 4, 4, 1)
|
||||
TESTPLANARTOB(I422, 1, 1, RGB24, 3, 3, 1)
|
||||
TESTPLANARTOB(I422, 1, 1, RAW, 3, 3, 1)
|
||||
TESTPLANARTOB(I444, 1, 1, ARGB, 4, 4, 1)
|
||||
TESTPLANARTOB(I444, 1, 1, ABGR, 4, 4, 1)
|
||||
TESTPLANARTOB(I444, 1, 1, RGB24, 3, 3, 1)
|
||||
TESTPLANARTOB(I444, 1, 1, RAW, 3, 3, 1)
|
||||
TESTPLANARTOB(J444, 1, 1, ARGB, 4, 4, 1)
|
||||
TESTPLANARTOB(J444, 1, 1, ABGR, 4, 4, 1)
|
||||
TESTPLANARTOB(H444, 1, 1, ARGB, 4, 4, 1)
|
||||
@ -820,6 +827,7 @@ TESTPLANARTOB(H420, 2, 2, AB30, 4, 4, 1)
|
||||
TESTPLANARTOB(I420, 2, 2, ARGBFilter, 4, 4, 1)
|
||||
TESTPLANARTOB(I422, 2, 1, ARGBFilter, 4, 4, 1)
|
||||
TESTPLANARTOB(I420, 2, 2, RGB24Filter, 3, 3, 1)
|
||||
TESTPLANARTOB(I422, 2, 2, RGB24Filter, 3, 3, 1)
|
||||
#else
|
||||
TESTPLANARTOB(I420, 2, 2, ABGR, 4, 4, 1)
|
||||
TESTPLANARTOB(I420, 2, 2, ARGB, 4, 4, 1)
|
||||
@ -844,6 +852,7 @@ TESTPLANARTOB(I422, 2, 1, UYVY, 2, 4, 1)
|
||||
TESTPLANARTOB(I422, 2, 1, YUY2, 2, 4, 1)
|
||||
TESTPLANARTOB(I420, 2, 2, ARGBFilter, 4, 4, 1)
|
||||
TESTPLANARTOB(I422, 2, 1, ARGBFilter, 4, 4, 1)
|
||||
TESTPLANARTOB(I420, 2, 2, RGB24Filter, 3, 3, 1)
|
||||
TESTPLANARTOB(I444, 1, 1, ABGR, 4, 4, 1)
|
||||
TESTPLANARTOB(I444, 1, 1, ARGB, 4, 4, 1)
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user