mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 09:16:48 +08:00
rotate nv12 any width
BUG=libyuv:464 R=harryjin@google.com Review URL: https://webrtc-codereview.appspot.com/55709004.
This commit is contained in:
parent
478ff9608b
commit
9425c4b01a
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 1461
|
Version: 1462
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ extern "C" {
|
|||||||
defined(__mips__) && \
|
defined(__mips__) && \
|
||||||
defined(__mips_dsp) && (__mips_dsp_rev >= 2)
|
defined(__mips_dsp) && (__mips_dsp_rev >= 2)
|
||||||
#define HAS_TRANSPOSEWX8_MIPS_DSPR2
|
#define HAS_TRANSPOSEWX8_MIPS_DSPR2
|
||||||
#define HAS_TRANSPOSEUVWx8_MIPS_DSPR2
|
#define HAS_TRANSPOSEUVWX8_MIPS_DSPR2
|
||||||
#endif // defined(__mips__)
|
#endif // defined(__mips__)
|
||||||
|
|
||||||
void TransposeWxH_C(const uint8* src, int src_stride,
|
void TransposeWxH_C(const uint8* src, int src_stride,
|
||||||
@ -103,6 +103,16 @@ void TransposeUVWx8_MIPS_DSPR2(const uint8* src, int src_stride,
|
|||||||
uint8* dst_a, int dst_stride_a,
|
uint8* dst_a, int dst_stride_a,
|
||||||
uint8* dst_b, int dst_stride_b, int width);
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
|
||||||
|
void TransposeUVWx8_Any_SSE2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
void TransposeUVWx8_Any_NEON(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
void TransposeUVWx8_Any_MIPS_DSPR2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
} // namespace libyuv
|
} // namespace libyuv
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 1461
|
#define LIBYUV_VERSION 1462
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||||
|
|||||||
@ -204,11 +204,14 @@ void TransposeUV(const uint8* src, int src_stride,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAS_TRANSPOSEUVWX8_SSE2)
|
#if defined(HAS_TRANSPOSEUVWX8_SSE2)
|
||||||
if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(width, 8)) {
|
if (TestCpuFlag(kCpuHasSSE2)) {
|
||||||
TransposeUVWx8 = TransposeUVWx8_SSE2;
|
TransposeUVWx8 = TransposeUVWx8_Any_SSE2;
|
||||||
|
if (IS_ALIGNED(width, 8)) {
|
||||||
|
TransposeUVWx8 = TransposeUVWx8_SSE2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAS_TRANSPOSEUVWx8_MIPS_DSPR2)
|
#if defined(HAS_TRANSPOSEUVWX8_MIPS_DSPR2)
|
||||||
if (TestCpuFlag(kCpuHasMIPS_DSPR2) && IS_ALIGNED(width, 2) &&
|
if (TestCpuFlag(kCpuHasMIPS_DSPR2) && IS_ALIGNED(width, 2) &&
|
||||||
IS_ALIGNED(src, 4) && IS_ALIGNED(src_stride, 4)) {
|
IS_ALIGNED(src, 4) && IS_ALIGNED(src_stride, 4)) {
|
||||||
TransposeUVWx8 = TransposeUVWx8_MIPS_DSPR2;
|
TransposeUVWx8 = TransposeUVWx8_MIPS_DSPR2;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ namespace libyuv {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TANY(NAMEANY, TPOS_SIMD, TPOS_C, MASK) \
|
#define TANY(NAMEANY, TPOS_SIMD, MASK) \
|
||||||
void NAMEANY(const uint8* src, int src_stride, \
|
void NAMEANY(const uint8* src, int src_stride, \
|
||||||
uint8* dst, int dst_stride, int width) { \
|
uint8* dst, int dst_stride, int width) { \
|
||||||
int r = width & MASK; \
|
int r = width & MASK; \
|
||||||
@ -26,24 +26,49 @@ extern "C" {
|
|||||||
if (n > 0) { \
|
if (n > 0) { \
|
||||||
TPOS_SIMD(src, src_stride, dst, dst_stride, n); \
|
TPOS_SIMD(src, src_stride, dst, dst_stride, n); \
|
||||||
} \
|
} \
|
||||||
TPOS_C(src + n, src_stride, dst + n * dst_stride, dst_stride, r); \
|
TransposeWx8_C(src + n, src_stride, dst + n * dst_stride, dst_stride, r);\
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_TRANSPOSEWX8_NEON
|
#ifdef HAS_TRANSPOSEWX8_NEON
|
||||||
TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, TransposeWx8_C, 7)
|
TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, 7)
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_TRANSPOSEWX8_SSSE3
|
#ifdef HAS_TRANSPOSEWX8_SSSE3
|
||||||
TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, TransposeWx8_C, 7)
|
TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, 7)
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_TRANSPOSEWX8_FAST_SSSE3
|
#ifdef HAS_TRANSPOSEWX8_FAST_SSSE3
|
||||||
TANY(TransposeWx8_Fast_Any_SSSE3, TransposeWx8_Fast_SSSE3, TransposeWx8_C, 15)
|
TANY(TransposeWx8_Fast_Any_SSSE3, TransposeWx8_Fast_SSSE3, 15)
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_TRANSPOSEWX8_MIPS_DSPR2
|
#ifdef HAS_TRANSPOSEWX8_MIPS_DSPR2
|
||||||
TANY(TransposeWx8_Any_MIPS_DSPR2, TransposeWx8_MIPS_DSPR2, TransposeWx8_C, 7)
|
TANY(TransposeWx8_Any_MIPS_DSPR2, TransposeWx8_MIPS_DSPR2, 7)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef TANY
|
#undef TANY
|
||||||
|
|
||||||
|
#define TUVANY(NAMEANY, TPOS_SIMD, MASK) \
|
||||||
|
void NAMEANY(const uint8* src, int src_stride, \
|
||||||
|
uint8* dst_a, int dst_stride_a, \
|
||||||
|
uint8* dst_b, int dst_stride_b, int width) { \
|
||||||
|
int r = width & MASK; \
|
||||||
|
int n = width - r; \
|
||||||
|
if (n > 0) { \
|
||||||
|
TPOS_SIMD(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b, \
|
||||||
|
n); \
|
||||||
|
} \
|
||||||
|
TransposeUVWx8_C(src + n * 2, src_stride, \
|
||||||
|
dst_a + n * dst_stride_a, dst_stride_a, \
|
||||||
|
dst_b + n * dst_stride_b, dst_stride_b, r); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAS_TRANSPOSEUVWX8_NEON
|
||||||
|
TUVANY(TransposeUVWx8_Any_NEON, TransposeUVWx8_NEON, 7)
|
||||||
|
#endif
|
||||||
|
#ifdef HAS_TRANSPOSEUVWX8_SSE2
|
||||||
|
TUVANY(TransposeUVWx8_Any_SSE2, TransposeUVWx8_SSE2, 7)
|
||||||
|
#endif
|
||||||
|
#ifdef HAS_TRANSPOSEUVWX8_MIPS_DSPR2
|
||||||
|
TUVANY(TransposeUVWx8_Any_MIPS_DSPR2, TransposeUVWx8_MIPS_DSPR2, 7)
|
||||||
|
#endif
|
||||||
|
#undef TUVANY
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
} // namespace libyuv
|
} // namespace libyuv
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user