aboutsummaryrefslogtreecommitdiff
path: root/files/util
diff options
context:
space:
mode:
authorVignesh Venkatasubramanian <vigneshv@google.com>2023-06-12 21:28:09 +0000
committerAndroid Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-06-12 21:28:09 +0000
commit01fadae8618ea360608cc52c823a022c48f855b5 (patch)
tree303e8eabb435a80ebec36a19c23ca85744d58fb5 /files/util
parent435db9f11b09187e0d60683813a28d07cc13166b (diff)
downloadlibyuv-01fadae8618ea360608cc52c823a022c48f855b5.tar.gz
libyuv: Update to r1871 (2a6cb743)
Changes from upstream: https://chromium.googlesource.com/libyuv/libyuv/+log/d53f1bee..2a6cb743 The intention of the CL is to import the functions necessary to enable AV1 (and AVIF) 12-bit color conversion. Bug: 268505204 Test: Builds. Media and Camera CTS tests pass. (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:27750a13c6eaacb9f716da3fe1734a8d106d7ff4) Merged-In: I756d3bd5047d4719659f9e1a449217b1940e51a4 Change-Id: I756d3bd5047d4719659f9e1a449217b1940e51a4
Diffstat (limited to 'files/util')
-rw-r--r--files/util/cpuid.c60
-rw-r--r--files/util/yuvconstants.c11
-rw-r--r--files/util/yuvconvert.cc10
3 files changed, 44 insertions, 37 deletions
diff --git a/files/util/cpuid.c b/files/util/cpuid.c
index b618bb10..edc6a26e 100644
--- a/files/util/cpuid.c
+++ b/files/util/cpuid.c
@@ -21,8 +21,9 @@ using namespace libyuv;
int main(int argc, const char* argv[]) {
int cpu_flags = TestCpuFlag(-1);
int has_arm = TestCpuFlag(kCpuHasARM);
- int has_mips = TestCpuFlag(kCpuHasMIPS);
+ int has_riscv = TestCpuFlag(kCpuHasRISCV);
int has_x86 = TestCpuFlag(kCpuHasX86);
+ int has_mips = TestCpuFlag(kCpuHasMIPS);
int has_loongarch = TestCpuFlag(kCpuHasLOONGARCH);
(void)argc;
(void)argv;
@@ -62,24 +63,28 @@ int main(int argc, const char* argv[]) {
model, model);
}
#endif
- printf("Cpu Flags %x\n", cpu_flags);
- printf("Has ARM %x\n", has_arm);
- printf("Has MIPS %x\n", has_mips);
- printf("Has X86 %x\n", has_x86);
- printf("Has LOONGARCH %x\n", has_loongarch);
+ printf("Cpu Flags 0x%x\n", cpu_flags);
if (has_arm) {
int has_neon = TestCpuFlag(kCpuHasNEON);
- printf("Has NEON %x\n", has_neon);
+ printf("Has ARM 0x%x\n", has_arm);
+ printf("Has NEON 0x%x\n", has_neon);
+ }
+ if (has_riscv) {
+ int has_rvv = TestCpuFlag(kCpuHasRVV);
+ printf("Has RISCV 0x%x\n", has_riscv);
+ printf("Has RVV 0x%x\n", has_rvv);
}
if (has_mips) {
int has_msa = TestCpuFlag(kCpuHasMSA);
- printf("Has MSA %x\n", has_msa);
+ printf("Has MIPS 0x%x\n", has_mips);
+ printf("Has MSA 0x%x\n", has_msa);
}
if (has_loongarch) {
int has_lsx = TestCpuFlag(kCpuHasLSX);
- printf("Has LSX %x\n", has_lsx);
int has_lasx = TestCpuFlag(kCpuHasLASX);
- printf("Has LASX %x\n", has_lasx);
+ printf("Has LOONGARCH 0x%x\n", has_loongarch);
+ printf("Has LSX 0x%x\n", has_lsx);
+ printf("Has LASX 0x%x\n", has_lasx);
}
if (has_x86) {
int has_sse2 = TestCpuFlag(kCpuHasSSE2);
@@ -99,23 +104,24 @@ int main(int argc, const char* argv[]) {
int has_avx512vbmi2 = TestCpuFlag(kCpuHasAVX512VBMI2);
int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG);
int has_avx512vpopcntdq = TestCpuFlag(kCpuHasAVX512VPOPCNTDQ);
- printf("Has SSE2 %x\n", has_sse2);
- printf("Has SSSE3 %x\n", has_ssse3);
- printf("Has SSE4.1 %x\n", has_sse41);
- printf("Has SSE4.2 %x\n", has_sse42);
- printf("Has AVX %x\n", has_avx);
- printf("Has AVX2 %x\n", has_avx2);
- printf("Has ERMS %x\n", has_erms);
- printf("Has FMA3 %x\n", has_fma3);
- printf("Has F16C %x\n", has_f16c);
- printf("Has GFNI %x\n", has_gfni);
- printf("Has AVX512BW %x\n", has_avx512bw);
- printf("Has AVX512VL %x\n", has_avx512vl);
- printf("Has AVX512VNNI %x\n", has_avx512vnni);
- printf("Has AVX512VBMI %x\n", has_avx512vbmi);
- printf("Has AVX512VBMI2 %x\n", has_avx512vbmi2);
- printf("Has AVX512VBITALG %x\n", has_avx512vbitalg);
- printf("Has AVX512VPOPCNTDQ %x\n", has_avx512vpopcntdq);
+ printf("Has X86 0x%x\n", has_x86);
+ printf("Has SSE2 0x%x\n", has_sse2);
+ printf("Has SSSE3 0x%x\n", has_ssse3);
+ printf("Has SSE4.1 0x%x\n", has_sse41);
+ printf("Has SSE4.2 0x%x\n", has_sse42);
+ printf("Has AVX 0x%x\n", has_avx);
+ printf("Has AVX2 0x%x\n", has_avx2);
+ printf("Has ERMS 0x%x\n", has_erms);
+ printf("Has FMA3 0x%x\n", has_fma3);
+ printf("Has F16C 0x%x\n", has_f16c);
+ printf("Has GFNI 0x%x\n", has_gfni);
+ printf("Has AVX512BW 0x%x\n", has_avx512bw);
+ printf("Has AVX512VL 0x%x\n", has_avx512vl);
+ printf("Has AVX512VNNI 0x%x\n", has_avx512vnni);
+ printf("Has AVX512VBMI 0x%x\n", has_avx512vbmi);
+ printf("Has AVX512VBMI2 0x%x\n", has_avx512vbmi2);
+ printf("Has AVX512VBITALG 0x%x\n", has_avx512vbitalg);
+ printf("Has AVX512VPOPCNTDQ 0x%x\n", has_avx512vpopcntdq);
}
return 0;
}
diff --git a/files/util/yuvconstants.c b/files/util/yuvconstants.c
index 037e0824..4e5185af 100644
--- a/files/util/yuvconstants.c
+++ b/files/util/yuvconstants.c
@@ -43,9 +43,10 @@
// #define BR (-VR * 128 + YB)
int main(int argc, const char* argv[]) {
- if (argc < 2) {
- printf("yuvconstants Kr Kb\n");
- printf(" MC BT KR = 0.2126; KB = 0.0722\n");
+ if (argc < 3) {
+ printf("yuvconstants [KR] [KB]\n");
+ printf(" e.g. yuvconstants 0.2126 0.0722\n");
+ printf(" MC BT KR KB\n");
printf(" 1 BT.709 KR = 0.2126; KB = 0.0722\n");
printf(" 4 FCC KR = 0.30; KB = 0.11\n");
printf(" 6 BT.601 KR = 0.299; KB = 0.114\n");
@@ -53,8 +54,8 @@ int main(int argc, const char* argv[]) {
printf(" 9 BT.2020 KR = 0.2627; KB = 0.0593\n");
return -1;
}
- float kr = atof(argv[1]);
- float kb = atof(argv[2]);
+ float kr = (float)atof(argv[1]);
+ float kb = (float)atof(argv[2]);
float kg = 1 - kr - kb;
float vr = 2 * (1 - kr);
diff --git a/files/util/yuvconvert.cc b/files/util/yuvconvert.cc
index 332699e3..93b52668 100644
--- a/files/util/yuvconvert.cc
+++ b/files/util/yuvconvert.cc
@@ -42,9 +42,9 @@ static __inline uint32_t Abs(int32_t v) {
}
// Parse PYUV format. ie name.1920x800_24Hz_P420.yuv
-bool ExtractResolutionFromFilename(const char* name,
- int* width_ptr,
- int* height_ptr) {
+static bool ExtractResolutionFromFilename(const char* name,
+ int* width_ptr,
+ int* height_ptr) {
// Isolate the .width_height. section of the filename by searching for a
// dot or underscore followed by a digit.
for (int i = 0; name[i]; ++i) {
@@ -59,7 +59,7 @@ bool ExtractResolutionFromFilename(const char* name,
return false;
}
-void PrintHelp(const char* program) {
+static void PrintHelp(const char* program) {
printf("%s [-options] src_argb.raw dst_yuv.raw\n", program);
printf(
" -s <width> <height> .... specify source resolution. "
@@ -78,7 +78,7 @@ void PrintHelp(const char* program) {
exit(0);
}
-void ParseOptions(int argc, const char* argv[]) {
+static void ParseOptions(int argc, const char* argv[]) {
if (argc <= 1) {
PrintHelp(argv[0]);
}