mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
wrapper for yuv to argb that handles destination misalignment and odd widths by using a memcpy
BUG=none TEST=none Review URL: https://webrtc-codereview.appspot.com/364001 git-svn-id: http://libyuv.googlecode.com/svn/trunk@145 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
0e6ce93c84
commit
882ddbd9c2
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 144
|
||||
Version: 145
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -1512,12 +1512,16 @@ int I420ToARGB(const uint8* src_y, int src_stride_y,
|
||||
#if defined(HAS_FASTCONVERTYUVTOARGBROW_NEON)
|
||||
if (TestCpuFlag(kCpuHasNEON) && IS_ALIGNED(width, 16)) {
|
||||
FastConvertYUVToARGBRow = FastConvertYUVToARGBRow_NEON;
|
||||
} else if (TestCpuFlag(kCpuHasNEON)) {
|
||||
FastConvertYUVToARGBRow = FastConvertYUVToARGBAnyRow_NEON;
|
||||
} else
|
||||
#elif defined(HAS_FASTCONVERTYUVTOARGBROW_SSSE3)
|
||||
if (TestCpuFlag(kCpuHasSSSE3) &&
|
||||
IS_ALIGNED(width, 8) &&
|
||||
IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) {
|
||||
FastConvertYUVToARGBRow = FastConvertYUVToARGBRow_SSSE3;
|
||||
} else if (TestCpuFlag(kCpuHasSSSE3)) {
|
||||
FastConvertYUVToARGBRow = FastConvertYUVToARGBAnyRow_SSSE3;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
79
source/row.h
79
source/row.h
@ -38,11 +38,6 @@
|
||||
#define HAS_FASTCONVERTYUVTOARGBROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUVTOBGRAROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUVTOABGRROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUVTORGB565ROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUVTOARGB1555ROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUVTOARGB4444ROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUVTORGB24ROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUVTORAWROW_SSSE3
|
||||
#define HAS_FASTCONVERTYUV444TOARGBROW_SSSE3
|
||||
#define HAS_REVERSE_ROW_SSSE3
|
||||
#define HAS_REVERSE_ROW_SSE2
|
||||
@ -67,11 +62,6 @@
|
||||
#define HAS_FASTCONVERTYUVTOARGBROW_NEON
|
||||
#define HAS_FASTCONVERTYUVTOBGRAROW_NEON
|
||||
#define HAS_FASTCONVERTYUVTOABGRROW_NEON
|
||||
#define HAS_FASTCONVERTYUVTORGB565ROW_NEON
|
||||
#define HAS_FASTCONVERTYUVTOARGB1555ROW_NEON
|
||||
#define HAS_FASTCONVERTYUVTOARGB4444ROW_NEON
|
||||
#define HAS_FASTCONVERTYUVTORGB24ROW_NEON
|
||||
#define HAS_FASTCONVERTYUVTORAWROW_NEON
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -91,7 +81,6 @@ typedef unsigned char __attribute__((vector_size(16))) uvec8;
|
||||
typedef signed short __attribute__((vector_size(16))) vec16;
|
||||
#endif
|
||||
|
||||
|
||||
void FastConvertYUVToARGBRow_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
@ -107,31 +96,6 @@ void FastConvertYUVToABGRRow_NEON(const uint8* y_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
void FastConvertYUVToRGB565Row_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
void FastConvertYUVToARGB1555Row_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
void FastConvertYUVToARGB4444Row_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
void FastConvertYUVToRGB24Row_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
void FastConvertYUVToRAWRow_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
|
||||
void BGRAToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix);
|
||||
@ -181,8 +145,6 @@ void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
|
||||
void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
|
||||
void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix);
|
||||
|
||||
// ARGBToABGRRow_C is same as ABGRToARGB
|
||||
// ARGBToBGRARow_C is same as BGRAToARGB
|
||||
void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
|
||||
void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix);
|
||||
void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix);
|
||||
@ -220,34 +182,6 @@ void FastConvertYToARGBRow_C(const uint8* y_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void FastConvertYUVToARGBRow_SSE2(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void FastConvertYUVToBGRARow_SSE2(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void FastConvertYUVToABGRRow_SSE2(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void FastConvertYUV444ToARGBRow_SSE2(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void FastConvertYToARGBRow_SSE2(const uint8* y_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void FastConvertYUVToARGBRow_SSSE3(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
@ -276,6 +210,19 @@ void FastConvertYToARGBRow_SSE2(const uint8* y_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
// 'Any' wrappers use memcpy()
|
||||
void FastConvertYUVToARGBAnyRow_SSSE3(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
void FastConvertYUVToARGBAnyRow_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
} // namespace libyuv
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include "row.h"
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
#include <string.h> // For memcpy
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace libyuv {
|
||||
@ -367,6 +368,39 @@ void ReverseRow_C(const uint8* src, uint8* dst, int width) {
|
||||
}
|
||||
}
|
||||
|
||||
// Wrappers to handle odd sizes/alignments
|
||||
#if defined(HAS_FASTCONVERTYUVTOARGBROW_SSSE3)
|
||||
void FastConvertYUVToARGBAnyRow_SSSE3(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width) {
|
||||
SIMD_ALIGNED(uint8 row[kMaxStride]);
|
||||
FastConvertYUVToARGBRow_SSSE3(y_buf,
|
||||
u_buf,
|
||||
v_buf,
|
||||
row,
|
||||
width);
|
||||
memcpy(rgb_buf, row, width << 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAS_FASTCONVERTYUVTOARGBROW_NEON)
|
||||
void FastConvertYUVToARGBAnyRow_NEON(const uint8* y_buf,
|
||||
const uint8* u_buf,
|
||||
const uint8* v_buf,
|
||||
uint8* rgb_buf,
|
||||
int width) {
|
||||
SIMD_ALIGNED(uint8 row[kMaxStride]);
|
||||
FastConvertYUVToARGBRow_NEON(y_buf,
|
||||
u_buf,
|
||||
v_buf,
|
||||
row,
|
||||
width);
|
||||
memcpy(rgb_buf, row, width << 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
} // namespace libyuv
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user