| Index: source/row_common.cc
|
| diff --git a/source/row_common.cc b/source/row_common.cc
|
| index 229da97527c440b5786f4560828e033aa90c3a6f..b5e42b3aec26b028eb10ff0bf52d0f3cd71e0dd1 100644
|
| --- a/source/row_common.cc
|
| +++ b/source/row_common.cc
|
| @@ -13,6 +13,7 @@
|
| #include <string.h> // For memcpy and memset.
|
|
|
| #include "libyuv/basic_types.h"
|
| +#include "libyuv/cpu_id.h"
|
|
|
| #ifdef __cplusplus
|
| namespace libyuv {
|
| @@ -1800,6 +1801,37 @@ void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width) {
|
| }
|
| }
|
|
|
| +SplitUVRowFunction GetOptimizedSplitUVRowFunction(
|
| + const uint8 *src_uv, int src_stride_uv,
|
| + const uint8 *dst_u, int dst_stride_u,
|
| + const uint8 *dst_v, int dst_stride_v,
|
| + int width) {
|
| +#if defined(HAS_SPLITUVROW_DSPR2)
|
| + if (TestCpuFlag(kCpuHasDSPR2) &&
|
| + IS_ALIGNED(src_uv, 4) && IS_ALIGNED(src_stride_uv, 4) &&
|
| + IS_ALIGNED(dst_u, 4) && IS_ALIGNED(dst_stride_u, 4) &&
|
| + IS_ALIGNED(dst_v, 4) && IS_ALIGNED(dst_stride_v, 4)) {
|
| + return IS_ALIGNED(width, 16) ? SplitUVRow_DSPR2 : SplitUVRow_Any_DSPR2;
|
| + }
|
| +#endif
|
| +#if defined(HAS_SPLITUVROW_NEON)
|
| + if (TestCpuFlag(kCpuHasNEON)) {
|
| + return IS_ALIGNED(width, 16) ? SplitUVRow_NEON : SplitUVRow_Any_NEON;
|
| + }
|
| +#endif
|
| +#if defined(HAS_SPLITUVROW_AVX2)
|
| + if (TestCpuFlag(kCpuHasAVX2)) {
|
| + return IS_ALIGNED(width, 32) ? SplitUVRow_AVX2 : SplitUVRow_Any_AVX2;
|
| + }
|
| +#endif
|
| +#if defined(HAS_SPLITUVROW_SSE2)
|
| + if (TestCpuFlag(kCpuHasSSE2)) {
|
| + return IS_ALIGNED(width, 16) ? SplitUVRow_SSE2 : SplitUVRow_Any_SSE2;
|
| + }
|
| +#endif
|
| + return SplitUVRow_C;
|
| +}
|
| +
|
| void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
|
| int width) {
|
| int x;
|
| @@ -1816,6 +1848,25 @@ void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
|
| }
|
| }
|
|
|
| +MergeUVRowFunction GetOptimizedMergeUVRowFunction(int width) {
|
| +#if defined(HAS_MERGEUVROW_NEON)
|
| + if (TestCpuFlag(kCpuHasNEON)) {
|
| + return IS_ALIGNED(width, 16) ? MergeUVRow_NEON : MergeUVRow_Any_NEON;
|
| + }
|
| +#endif
|
| +#if defined(HAS_MERGEUVROW_AVX2)
|
| + if (TestCpuFlag(kCpuHasAVX2)) {
|
| + return IS_ALIGNED(width, 32) ? MergeUVRow_AVX2 : MergeUVRow_Any_AVX2;
|
| + }
|
| +#endif
|
| +#if defined(HAS_MERGEUVROW_SSE2)
|
| + if (TestCpuFlag(kCpuHasSSE2)) {
|
| + return IS_ALIGNED(width, 16) ? MergeUVRow_SSE2 : MergeUVRow_Any_SSE2;
|
| + }
|
| +#endif
|
| + return MergeUVRow_C;
|
| +}
|
| +
|
| void CopyRow_C(const uint8* src, uint8* dst, int count) {
|
| memcpy(dst, src, count);
|
| }
|
|
|