Commit bb6bddc9 authored by fbarchard@google.com's avatar fbarchard@google.com

Style fixes for mips version of SplitUV for nv12/21

BUG=126
TEST=lint passes and rotate_test and cpu_test on try bot pass.
Review URL: https://webrtc-codereview.appspot.com/884004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@418 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent c4163acb
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 417 Version: 418
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -271,7 +271,8 @@ void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width); ...@@ -271,7 +271,8 @@ void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
void SplitUV_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); void SplitUV_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
void SplitUV_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); void SplitUV_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
void SplitUV_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); void SplitUV_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
int pix);
void SplitUV_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); void SplitUV_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix);
void CopyRow_SSE2(const uint8* src, uint8* dst, int count); void CopyRow_SSE2(const uint8* src, uint8* dst, int count);
......
...@@ -11,6 +11,6 @@ ...@@ -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 417 #define LIBYUV_VERSION 418
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -380,7 +380,7 @@ static int X420ToI420(const uint8* src_y, ...@@ -380,7 +380,7 @@ static int X420ToI420(const uint8* src_y,
SplitUV = SplitUV_SSE2; SplitUV = SplitUV_SSE2;
} }
#elif defined(HAS_SPLITUV_MIPS_DSPR2) #elif defined(HAS_SPLITUV_MIPS_DSPR2)
if (TestCpuFlag(kCpuHasMIPS) && TestCpuFlag(kCpuHasMIPS_DSPR2)){ if (TestCpuFlag(kCpuHasMIPS_DSPR2)) {
SplitUV = SplitUV_MIPS_DSPR2; SplitUV = SplitUV_MIPS_DSPR2;
} }
#endif #endif
......
...@@ -101,41 +101,38 @@ static const int kXCR_XFEATURE_ENABLED_MASK = 0; ...@@ -101,41 +101,38 @@ static const int kXCR_XFEATURE_ENABLED_MASK = 0;
// For Arm, but public to allow testing on any CPU // For Arm, but public to allow testing on any CPU
LIBYUV_API LIBYUV_API
int ArmCpuCaps(const char* cpuinfo_name) { int ArmCpuCaps(const char* cpuinfo_name) {
int flags = 0; FILE* f = fopen(cpuinfo_name, "r");
FILE* fin = fopen(cpuinfo_name, "r"); if (f) {
if (fin) {
char buf[512]; char buf[512];
while (fgets(buf, 511, fin)) { while (fgets(buf, 511, f)) {
if (memcmp(buf, "Features", 8) == 0) { if (memcmp(buf, "Features", 8) == 0) {
char* p = strstr(buf, " neon"); char* p = strstr(buf, " neon");
if (p && (p[5] == ' ' || p[5] == '\n')) { if (p && (p[5] == ' ' || p[5] == '\n')) {
flags |= kCpuHasNEON; fclose(f);
break; return kCpuHasNEON;
} }
} }
} }
fclose(fin); fclose(f);
} }
return flags; return 0;
} }
static int MipsCpuCaps(const char *search_string) { static int MipsCpuCaps(const char* search_string) {
int flags = 0; const char* file_name = "/proc/cpuinfo";
const char *file_name = "/proc/cpuinfo";
char cpuinfo_line[256]; char cpuinfo_line[256];
FILE *f = NULL; FILE* f = NULL;
if ((f = fopen(file_name, "r")) != NULL) {
if ((f = fopen (file_name, "r")) != NULL) { while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f) != NULL) {
while (fgets (cpuinfo_line, sizeof (cpuinfo_line), f) != NULL) { if (strstr(cpuinfo_line, search_string) != NULL) {
if (strstr (cpuinfo_line, search_string) != NULL) { fclose(f);
flags |= kCpuHasMIPS_DSP; return kCpuHasMIPS_DSP;
fclose (f);
return flags;
} }
} }
fclose(f);
} }
/* Did not find string in the proc file, or not Linux ELF. */ /* Did not find string in the proc file, or not Linux ELF. */
return flags; return 0;
} }
// CPU detect function for SIMD instruction sets. // CPU detect function for SIMD instruction sets.
...@@ -197,9 +194,9 @@ int InitCpuFlags(void) { ...@@ -197,9 +194,9 @@ int InitCpuFlags(void) {
if (TestEnv("LIBYUV_DISABLE_AVX2")) { if (TestEnv("LIBYUV_DISABLE_AVX2")) {
cpu_info_ &= ~kCpuHasAVX2; cpu_info_ &= ~kCpuHasAVX2;
} }
#elif defined (__mips__) && defined(__linux__) #elif defined(__mips__) && defined(__linux__)
// linux mips parse text file for dsp detect. // linux mips parse text file for dsp detect.
cpu_info_ = MipsCpuCaps("dsp"); // set kCpuHasMIPS_DSP cpu_info_ = MipsCpuCaps("dsp"); // set kCpuHasMIPS_DSP.
#if defined(__mips_dspr2) #if defined(__mips_dspr2)
cpu_info_ |= kCpuHasMIPS_DSPR2; cpu_info_ |= kCpuHasMIPS_DSPR2;
#endif #endif
...@@ -214,7 +211,6 @@ int InitCpuFlags(void) { ...@@ -214,7 +211,6 @@ int InitCpuFlags(void) {
if (getenv("LIBYUV_DISABLE_MIPS_DSPR2")) { if (getenv("LIBYUV_DISABLE_MIPS_DSPR2")) {
cpu_info_ &= ~kCpuHasMIPS_DSPR2; cpu_info_ &= ~kCpuHasMIPS_DSPR2;
} }
#elif defined(__arm__) #elif defined(__arm__)
#if defined(__linux__) && (defined(__ARM_NEON__) || defined(LIBYUV_NEON)) #if defined(__linux__) && (defined(__ARM_NEON__) || defined(LIBYUV_NEON))
// linux arm parse text file for neon detect. // linux arm parse text file for neon detect.
......
This diff is collapsed.
...@@ -909,7 +909,8 @@ void I422ToUYVYRow_NEON(const uint8* src_y, ...@@ -909,7 +909,8 @@ void I422ToUYVYRow_NEON(const uint8* src_y,
} }
#ifdef HAS_ARGBTOARGB4444ROW_NEON #ifdef HAS_ARGBTOARGB4444ROW_NEON
void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_argb4444, int pix) { void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_argb4444,
int pix) {
asm volatile ( asm volatile (
"vmov.u8 d4, #0x0f \n" // bits to clear with vbic. "vmov.u8 d4, #0x0f \n" // bits to clear with vbic.
".p2align 2 \n" ".p2align 2 \n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment