diff --git a/Android.mk b/Android.mk index 2696f5821..4d2092acf 100644 --- a/Android.mk +++ b/Android.mk @@ -19,6 +19,7 @@ LOCAL_SRC_FILES := \ source/cpu_id.cc \ source/planar_functions.cc \ source/rotate.cc \ + source/rotate_any.cc \ source/rotate_argb.cc \ source/rotate_common.cc \ source/rotate_mips.cc \ diff --git a/BUILD.gn b/BUILD.gn index 455274f8e..f4a392f26 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -56,6 +56,7 @@ source_set("libyuv") { "source/mjpeg_validate.cc", "source/planar_functions.cc", "source/rotate.cc", + "source/rotate_any.cc", "source/rotate_argb.cc", "source/rotate_common.cc", "source/rotate_mips.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c7082503..1b7deba17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ set(ly_source_files ${ly_src_dir}/mjpeg_validate.cc ${ly_src_dir}/planar_functions.cc ${ly_src_dir}/rotate.cc + ${ly_src_dir}/rotate_any.cc ${ly_src_dir}/rotate_argb.cc ${ly_src_dir}/rotate_common.cc ${ly_src_dir}/rotate_mips.cc diff --git a/include/libyuv/rotate_row.h b/include/libyuv/rotate_row.h index 9694b2311..65c5fef22 100644 --- a/include/libyuv/rotate_row.h +++ b/include/libyuv/rotate_row.h @@ -98,11 +98,19 @@ void TransposeWx8_NEON(const uint8* src, int src_stride, uint8* dst, int dst_stride, int width); void TransposeWx8_SSSE3(const uint8* src, int src_stride, uint8* dst, int dst_stride, int width); +void TransposeWx8_FAST_SSSE3(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); void TransposeWx8_MIPS_DSPR2(const uint8* src, int src_stride, uint8* dst, int dst_stride, int width); -void TransposeWx8_FAST_SSSE3(const uint8* src, int src_stride, - uint8* dst, int dst_stride, int width); +void TransposeWx8_Any_NEON(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_Any_SSSE3(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_FAST_Any_SSSE3(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); +void TransposeWx8_Any_MIPS_DSPR2(const uint8* src, int src_stride, + uint8* dst, int dst_stride, int width); void TransposeUVWxH_C(const uint8* src, int src_stride, uint8* dst_a, int dst_stride_a, diff --git a/libyuv.gypi b/libyuv.gypi index eccde39c8..ceeab5386 100644 --- a/libyuv.gypi +++ b/libyuv.gypi @@ -22,6 +22,7 @@ 'include/libyuv/planar_functions.h', 'include/libyuv/rotate.h', 'include/libyuv/rotate_argb.h', + 'include/libyuv/rotate_row.h', 'include/libyuv/row.h', 'include/libyuv/scale.h', 'include/libyuv/scale_argb.h', @@ -46,6 +47,7 @@ 'source/mjpeg_validate.cc', 'source/planar_functions.cc', 'source/rotate.cc', + 'source/rotate_any.cc', 'source/rotate_argb.cc', 'source/rotate_common.cc', 'source/rotate_mips.cc', diff --git a/linux.mk b/linux.mk index d0b47a690..563f8ef45 100644 --- a/linux.mk +++ b/linux.mk @@ -18,6 +18,7 @@ LOCAL_OBJ_FILES := \ source/cpu_id.o \ source/planar_functions.o \ source/rotate.o \ + source/rotate_any.o \ source/rotate_argb.o \ source/rotate_common.o \ source/rotate_gcc.o \ diff --git a/source/rotate_any.cc b/source/rotate_any.cc new file mode 100644 index 000000000..72e7e6e4a --- /dev/null +++ b/source/rotate_any.cc @@ -0,0 +1,55 @@ +/* + * Copyright 2015 The LibYuv Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "libyuv/rotate.h" +#include "libyuv/rotate_row.h" + +#include "libyuv/basic_types.h" + +#ifdef __cplusplus +namespace libyuv { +extern "C" { +#endif + +#define TANY(NAMEANY, TPOS_SIMD, TPOS_C, MASK) \ + void NAMEANY(const uint8* src, int src_stride, \ + uint8* dst, int dst_stride, int width) { \ + int r = width & MASK; \ + int n = width - r; \ + if (n > 0) { \ + TPOS_SIMD(src, src_stride, dst, dst_stride, n); \ + } \ + TPOS_C(src + n, src_stride, dst + n * dst_stride, dst_stride, r); \ + } + +#ifdef HAS_TRANSPOSE_WX8_NEON +TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, TransposeWx8_C, 7) +#endif +#ifdef HAS_TRANSPOSEWX8_SSSE3 +TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, TransposeWx8_C, 7) +#endif +#ifdef HAS_TRANSPOSEWX8_FAST_SSSE3 +TANY(TransposeWx8_FAST_Any_SSSE3, TransposeWx8_FAST_SSSE3, TransposeWx8_C, 15) +#endif +#ifdef HAS_TRANSPOSE_WX8_MIPS_DSPR2 +TANY(TransposeWx8_Any_MIPS_DSPR2, TransposeWx8_MIPS_DSPR2, TransposeWx8_C, 7) +#endif + +#undef TANY + +#ifdef __cplusplus +} // extern "C" +} // namespace libyuv +#endif + + + + + diff --git a/winarm.mk b/winarm.mk index 442fe75f9..c4307a431 100644 --- a/winarm.mk +++ b/winarm.mk @@ -1,4 +1,5 @@ # This is a generic makefile for libyuv for Windows Arm. +# call "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat" # nmake /f winarm.mk # make -f winarm.mk # nmake /f winarm.mk clean @@ -21,11 +22,13 @@ LOCAL_OBJ_FILES = \ source/cpu_id.o\ source/planar_functions.o\ source/rotate.o\ + source/rotate_any.o\ source/rotate_argb.o\ source/rotate_common.o\ source/row_any.o\ source/row_common.o\ source/scale.o\ + source/scale_any.o\ source/scale_argb.o\ source/scale_common.o\ source/video_common.o