Commit cfff527a authored by Frank Barchard's avatar Frank Barchard Committed by Frank Barchard

clang-tidy and clang-format applied

TBR=braveyao@chromium.org
Bug: None
Test: local arm builds still pass
Change-Id: Iac042fbaad940e01fc4ce228a104d3d561b80f92
Reviewed-on: https://chromium-review.googlesource.com/929999Reviewed-by: 's avatarFrank Barchard <fbarchard@chromium.org>
parent 18c9ab10
...@@ -547,7 +547,6 @@ int ARGB4444ToARGB(const uint8_t* src_argb4444, ...@@ -547,7 +547,6 @@ int ARGB4444ToARGB(const uint8_t* src_argb4444,
int width, int width,
int height); int height);
// Aliases // Aliases
#define AB30ToARGB AR30ToABGR #define AB30ToARGB AR30ToABGR
#define AB30ToABGR AR30ToARGB #define AB30ToABGR AR30ToARGB
...@@ -562,7 +561,6 @@ int AR30ToARGB(const uint8_t* src_ar30, ...@@ -562,7 +561,6 @@ int AR30ToARGB(const uint8_t* src_ar30,
int width, int width,
int height); int height);
// Convert AR30 To ABGR. // Convert AR30 To ABGR.
LIBYUV_API LIBYUV_API
int AR30ToABGR(const uint8_t* src_ar30, int AR30ToABGR(const uint8_t* src_ar30,
......
...@@ -512,8 +512,8 @@ int I010ToAB30(const uint16_t* src_y, ...@@ -512,8 +512,8 @@ int I010ToAB30(const uint16_t* src_y,
int dst_stride_ab30, int dst_stride_ab30,
int width, int width,
int height) { int height) {
return I010ToAR30Matrix(src_y, src_stride_y, src_v, return I010ToAR30Matrix(src_y, src_stride_y, src_v, src_stride_v, src_u,
src_stride_v, src_u, src_stride_u, dst_ab30, dst_stride_ab30, src_stride_u, dst_ab30, dst_stride_ab30,
&kYvuI601Constants, width, height); &kYvuI601Constants, width, height);
} }
...@@ -529,8 +529,8 @@ int H010ToAB30(const uint16_t* src_y, ...@@ -529,8 +529,8 @@ int H010ToAB30(const uint16_t* src_y,
int dst_stride_ab30, int dst_stride_ab30,
int width, int width,
int height) { int height) {
return I010ToAR30Matrix(src_y, src_stride_y, src_v, return I010ToAR30Matrix(src_y, src_stride_y, src_v, src_stride_v, src_u,
src_stride_v, src_u, src_stride_u, dst_ab30, dst_stride_ab30, src_stride_u, dst_ab30, dst_stride_ab30,
&kYvuH709Constants, width, height); &kYvuH709Constants, width, height);
} }
......
...@@ -29,9 +29,9 @@ static void ARGBTranspose(const uint8_t* src_argb, ...@@ -29,9 +29,9 @@ static void ARGBTranspose(const uint8_t* src_argb,
int height) { int height) {
int i; int i;
int src_pixel_step = src_stride_argb >> 2; int src_pixel_step = src_stride_argb >> 2;
void (*ScaleARGBRowDownEven)(const uint8_t* src_argb, ptrdiff_t src_stride_argb, void (*ScaleARGBRowDownEven)(
int src_step, uint8_t* dst_argb, int dst_width) = const uint8_t* src_argb, ptrdiff_t src_stride_argb, int src_step,
ScaleARGBRowDownEven_C; uint8_t* dst_argb, int dst_width) = ScaleARGBRowDownEven_C;
#if defined(HAS_SCALEARGBROWDOWNEVEN_SSE2) #if defined(HAS_SCALEARGBROWDOWNEVEN_SSE2)
if (TestCpuFlag(kCpuHasSSE2)) { if (TestCpuFlag(kCpuHasSSE2)) {
ScaleARGBRowDownEven = ScaleARGBRowDownEven_Any_SSE2; ScaleARGBRowDownEven = ScaleARGBRowDownEven_Any_SSE2;
...@@ -75,7 +75,8 @@ void ARGBRotate90(const uint8_t* src_argb, ...@@ -75,7 +75,8 @@ void ARGBRotate90(const uint8_t* src_argb,
// of the buffer and flip the sign of the source stride. // of the buffer and flip the sign of the source stride.
src_argb += src_stride_argb * (height - 1); src_argb += src_stride_argb * (height - 1);
src_stride_argb = -src_stride_argb; src_stride_argb = -src_stride_argb;
ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb, width, height); ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb, width,
height);
} }
void ARGBRotate270(const uint8_t* src_argb, void ARGBRotate270(const uint8_t* src_argb,
...@@ -89,7 +90,8 @@ void ARGBRotate270(const uint8_t* src_argb, ...@@ -89,7 +90,8 @@ void ARGBRotate270(const uint8_t* src_argb,
// of the buffer and flip the sign of the destination stride. // of the buffer and flip the sign of the destination stride.
dst_argb += dst_stride_argb * (width - 1); dst_argb += dst_stride_argb * (width - 1);
dst_stride_argb = -dst_stride_argb; dst_stride_argb = -dst_stride_argb;
ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb, width, height); ARGBTranspose(src_argb, src_stride_argb, dst_argb, dst_stride_argb, width,
height);
} }
void ARGBRotate180(const uint8_t* src_argb, void ARGBRotate180(const uint8_t* src_argb,
...@@ -106,7 +108,8 @@ void ARGBRotate180(const uint8_t* src_argb, ...@@ -106,7 +108,8 @@ void ARGBRotate180(const uint8_t* src_argb,
int y; int y;
void (*ARGBMirrorRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = void (*ARGBMirrorRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) =
ARGBMirrorRow_C; ARGBMirrorRow_C;
void (*CopyRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = CopyRow_C; void (*CopyRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) =
CopyRow_C;
#if defined(HAS_ARGBMIRRORROW_NEON) #if defined(HAS_ARGBMIRRORROW_NEON)
if (TestCpuFlag(kCpuHasNEON)) { if (TestCpuFlag(kCpuHasNEON)) {
ARGBMirrorRow = ARGBMirrorRow_Any_NEON; ARGBMirrorRow = ARGBMirrorRow_Any_NEON;
......
...@@ -113,9 +113,12 @@ void I444ToARGBRow_NEON(const uint8_t* src_y, ...@@ -113,9 +113,12 @@ void I444ToARGBRow_NEON(const uint8_t* src_y,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"vmov.u8 d23, #255 \n" "vmov.u8 d23, #255 \n"
"1: \n" READYUV444 YUVTORGB "1: \n"
READYUV444 YUVTORGB
"subs %4, %4, #8 \n" "subs %4, %4, #8 \n"
"vst4.8 {d20, d21, d22, d23}, [%3]! \n" "vst4.8 {d20, d21, d22, d23}, [%3]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -139,9 +142,12 @@ void I422ToARGBRow_NEON(const uint8_t* src_y, ...@@ -139,9 +142,12 @@ void I422ToARGBRow_NEON(const uint8_t* src_y,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"vmov.u8 d23, #255 \n" "vmov.u8 d23, #255 \n"
"1: \n" READYUV422 YUVTORGB "1: \n"
READYUV422 YUVTORGB
"subs %4, %4, #8 \n" "subs %4, %4, #8 \n"
"vst4.8 {d20, d21, d22, d23}, [%3]! \n" "vst4.8 {d20, d21, d22, d23}, [%3]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -166,8 +172,12 @@ void I422AlphaToARGBRow_NEON(const uint8_t* src_y, ...@@ -166,8 +172,12 @@ void I422AlphaToARGBRow_NEON(const uint8_t* src_y,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"1: \n" READYUV422 YUVTORGB
"1: \n"
READYUV422 YUVTORGB
"subs %5, %5, #8 \n" "subs %5, %5, #8 \n"
"vld1.8 {d23}, [%3]! \n" "vld1.8 {d23}, [%3]! \n"
"vst4.8 {d20, d21, d22, d23}, [%4]! \n" "vst4.8 {d20, d21, d22, d23}, [%4]! \n"
...@@ -194,7 +204,9 @@ void I422ToRGBARow_NEON(const uint8_t* src_y, ...@@ -194,7 +204,9 @@ void I422ToRGBARow_NEON(const uint8_t* src_y,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"1: \n" READYUV422 YUVTORGB "1: \n"
READYUV422 YUVTORGB
"subs %4, %4, #8 \n" "subs %4, %4, #8 \n"
"vmov.u8 d19, #255 \n" // d19 modified by "vmov.u8 d19, #255 \n" // d19 modified by
// YUVTORGB // YUVTORGB
...@@ -220,8 +232,12 @@ void I422ToRGB24Row_NEON(const uint8_t* src_y, ...@@ -220,8 +232,12 @@ void I422ToRGB24Row_NEON(const uint8_t* src_y,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"1: \n" READYUV422 YUVTORGB
"1: \n"
READYUV422 YUVTORGB
"subs %4, %4, #8 \n" "subs %4, %4, #8 \n"
"vst3.8 {d20, d21, d22}, [%3]! \n" "vst3.8 {d20, d21, d22}, [%3]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -253,8 +269,13 @@ void I422ToRGB565Row_NEON(const uint8_t* src_y, ...@@ -253,8 +269,13 @@ void I422ToRGB565Row_NEON(const uint8_t* src_y,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"1: \n" READYUV422 YUVTORGB "1: \n"
"subs %4, %4, #8 \n" ARGBTORGB565
READYUV422 YUVTORGB
"subs %4, %4, #8 \n"
ARGBTORGB565
"vst1.8 {q0}, [%3]! \n" // store 8 pixels RGB565. "vst1.8 {q0}, [%3]! \n" // store 8 pixels RGB565.
"bgt 1b \n" "bgt 1b \n"
: "+r"(src_y), // %0 : "+r"(src_y), // %0
...@@ -286,10 +307,15 @@ void I422ToARGB1555Row_NEON(const uint8_t* src_y, ...@@ -286,10 +307,15 @@ void I422ToARGB1555Row_NEON(const uint8_t* src_y,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"1: \n" READYUV422 YUVTORGB "1: \n"
READYUV422 YUVTORGB
"subs %4, %4, #8 \n" "subs %4, %4, #8 \n"
"vmov.u8 d23, #255 \n" ARGBTOARGB1555 "vmov.u8 d23, #255 \n"
ARGBTOARGB1555
"vst1.8 {q0}, [%3]! \n" // store 8 pixels "vst1.8 {q0}, [%3]! \n" // store 8 pixels
// ARGB1555. // ARGB1555.
"bgt 1b \n" "bgt 1b \n"
...@@ -325,9 +351,13 @@ void I422ToARGB4444Row_NEON(const uint8_t* src_y, ...@@ -325,9 +351,13 @@ void I422ToARGB4444Row_NEON(const uint8_t* src_y,
YUVTORGB_SETUP YUVTORGB_SETUP
"vmov.u8 d4, #0x0f \n" // bits to clear with "vmov.u8 d4, #0x0f \n" // bits to clear with
// vbic. // vbic.
"1: \n" READYUV422 YUVTORGB "1: \n"
READYUV422 YUVTORGB
"subs %4, %4, #8 \n" "subs %4, %4, #8 \n"
"vmov.u8 d23, #255 \n" ARGBTOARGB4444 "vmov.u8 d23, #255 \n"
ARGBTOARGB4444
"vst1.8 {q0}, [%3]! \n" // store 8 pixels "vst1.8 {q0}, [%3]! \n" // store 8 pixels
// ARGB4444. // ARGB4444.
"bgt 1b \n" "bgt 1b \n"
...@@ -346,9 +376,12 @@ void I422ToARGB4444Row_NEON(const uint8_t* src_y, ...@@ -346,9 +376,12 @@ void I422ToARGB4444Row_NEON(const uint8_t* src_y,
void I400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) { void I400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"vmov.u8 d23, #255 \n" "vmov.u8 d23, #255 \n"
"1: \n" READYUV400 YUVTORGB "1: \n"
READYUV400 YUVTORGB
"subs %2, %2, #8 \n" "subs %2, %2, #8 \n"
"vst4.8 {d20, d21, d22, d23}, [%1]! \n" "vst4.8 {d20, d21, d22, d23}, [%1]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -385,9 +418,14 @@ void NV12ToARGBRow_NEON(const uint8_t* src_y, ...@@ -385,9 +418,14 @@ void NV12ToARGBRow_NEON(const uint8_t* src_y,
uint8_t* dst_argb, uint8_t* dst_argb,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile(YUVTORGB_SETUP asm volatile(
YUVTORGB_SETUP
"vmov.u8 d23, #255 \n" "vmov.u8 d23, #255 \n"
"1: \n" READNV12 YUVTORGB
"1: \n"
READNV12 YUVTORGB
"subs %3, %3, #8 \n" "subs %3, %3, #8 \n"
"vst4.8 {d20, d21, d22, d23}, [%2]! \n" "vst4.8 {d20, d21, d22, d23}, [%2]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -399,8 +437,8 @@ void NV12ToARGBRow_NEON(const uint8_t* src_y, ...@@ -399,8 +437,8 @@ void NV12ToARGBRow_NEON(const uint8_t* src_y,
[kUVToG] "r"(&yuvconstants->kUVToG), [kUVToG] "r"(&yuvconstants->kUVToG),
[kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR), [kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR),
[kYToRgb] "r"(&yuvconstants->kYToRgb) [kYToRgb] "r"(&yuvconstants->kYToRgb)
: "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", : "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11",
"q10", "q11", "q12", "q13", "q14", "q15"); "q12", "q13", "q14", "q15");
} }
void NV21ToARGBRow_NEON(const uint8_t* src_y, void NV21ToARGBRow_NEON(const uint8_t* src_y,
...@@ -408,9 +446,14 @@ void NV21ToARGBRow_NEON(const uint8_t* src_y, ...@@ -408,9 +446,14 @@ void NV21ToARGBRow_NEON(const uint8_t* src_y,
uint8_t* dst_argb, uint8_t* dst_argb,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile(YUVTORGB_SETUP asm volatile(
YUVTORGB_SETUP
"vmov.u8 d23, #255 \n" "vmov.u8 d23, #255 \n"
"1: \n" READNV21 YUVTORGB
"1: \n"
READNV21 YUVTORGB
"subs %3, %3, #8 \n" "subs %3, %3, #8 \n"
"vst4.8 {d20, d21, d22, d23}, [%2]! \n" "vst4.8 {d20, d21, d22, d23}, [%2]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -422,8 +465,8 @@ void NV21ToARGBRow_NEON(const uint8_t* src_y, ...@@ -422,8 +465,8 @@ void NV21ToARGBRow_NEON(const uint8_t* src_y,
[kUVToG] "r"(&yuvconstants->kUVToG), [kUVToG] "r"(&yuvconstants->kUVToG),
[kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR), [kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR),
[kYToRgb] "r"(&yuvconstants->kYToRgb) [kYToRgb] "r"(&yuvconstants->kYToRgb)
: "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", : "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11",
"q10", "q11", "q12", "q13", "q14", "q15"); "q12", "q13", "q14", "q15");
} }
void NV12ToRGB565Row_NEON(const uint8_t* src_y, void NV12ToRGB565Row_NEON(const uint8_t* src_y,
...@@ -433,8 +476,13 @@ void NV12ToRGB565Row_NEON(const uint8_t* src_y, ...@@ -433,8 +476,13 @@ void NV12ToRGB565Row_NEON(const uint8_t* src_y,
int width) { int width) {
asm volatile( asm volatile(
YUVTORGB_SETUP YUVTORGB_SETUP
"1: \n" READNV12 YUVTORGB "1: \n"
"subs %3, %3, #8 \n" ARGBTORGB565
READNV12 YUVTORGB
"subs %3, %3, #8 \n"
ARGBTORGB565
"vst1.8 {q0}, [%2]! \n" // store 8 pixels RGB565. "vst1.8 {q0}, [%2]! \n" // store 8 pixels RGB565.
"bgt 1b \n" "bgt 1b \n"
: "+r"(src_y), // %0 : "+r"(src_y), // %0
...@@ -453,9 +501,13 @@ void YUY2ToARGBRow_NEON(const uint8_t* src_yuy2, ...@@ -453,9 +501,13 @@ void YUY2ToARGBRow_NEON(const uint8_t* src_yuy2,
uint8_t* dst_argb, uint8_t* dst_argb,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile(YUVTORGB_SETUP asm volatile(
YUVTORGB_SETUP
"vmov.u8 d23, #255 \n" "vmov.u8 d23, #255 \n"
"1: \n" READYUY2 YUVTORGB "1: \n"
READYUY2 YUVTORGB
"subs %2, %2, #8 \n" "subs %2, %2, #8 \n"
"vst4.8 {d20, d21, d22, d23}, [%1]! \n" "vst4.8 {d20, d21, d22, d23}, [%1]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -466,17 +518,21 @@ void YUY2ToARGBRow_NEON(const uint8_t* src_yuy2, ...@@ -466,17 +518,21 @@ void YUY2ToARGBRow_NEON(const uint8_t* src_yuy2,
[kUVToG] "r"(&yuvconstants->kUVToG), [kUVToG] "r"(&yuvconstants->kUVToG),
[kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR), [kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR),
[kYToRgb] "r"(&yuvconstants->kYToRgb) [kYToRgb] "r"(&yuvconstants->kYToRgb)
: "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", : "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11",
"q10", "q11", "q12", "q13", "q14", "q15"); "q12", "q13", "q14", "q15");
} }
void UYVYToARGBRow_NEON(const uint8_t* src_uyvy, void UYVYToARGBRow_NEON(const uint8_t* src_uyvy,
uint8_t* dst_argb, uint8_t* dst_argb,
const struct YuvConstants* yuvconstants, const struct YuvConstants* yuvconstants,
int width) { int width) {
asm volatile(YUVTORGB_SETUP asm volatile(
YUVTORGB_SETUP
"vmov.u8 d23, #255 \n" "vmov.u8 d23, #255 \n"
"1: \n" READUYVY YUVTORGB "1: \n"
READUYVY YUVTORGB
"subs %2, %2, #8 \n" "subs %2, %2, #8 \n"
"vst4.8 {d20, d21, d22, d23}, [%1]! \n" "vst4.8 {d20, d21, d22, d23}, [%1]! \n"
"bgt 1b \n" "bgt 1b \n"
...@@ -487,8 +543,8 @@ void UYVYToARGBRow_NEON(const uint8_t* src_uyvy, ...@@ -487,8 +543,8 @@ void UYVYToARGBRow_NEON(const uint8_t* src_uyvy,
[kUVToG] "r"(&yuvconstants->kUVToG), [kUVToG] "r"(&yuvconstants->kUVToG),
[kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR), [kUVBiasBGR] "r"(&yuvconstants->kUVBiasBGR),
[kYToRgb] "r"(&yuvconstants->kYToRgb) [kYToRgb] "r"(&yuvconstants->kYToRgb)
: "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", : "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11",
"q10", "q11", "q12", "q13", "q14", "q15"); "q12", "q13", "q14", "q15");
} }
// Reads 16 pairs of UV and write even values to dst_u and odd to dst_v. // Reads 16 pairs of UV and write even values to dst_u and odd to dst_v.
......
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