Fix -Wmissing-prototypes warnings

Declare functions as static. Declare functions in a header. Include the
header that declares the functions. Delete undeclared and unused
functions ScaleFilterRows_NEON() and ScaleRowUp2_16_NEON(). Delete
unused function ScaleY() in psnr_main.cc.

Change-Id: I182ec30611df83c61ffd01bbab595cd61fb5f1e5
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5778601
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
Wan-Teh Chang 2024-08-12 12:03:21 -07:00 committed by Frank Barchard
parent a97746349b
commit 3cf54e90d3
17 changed files with 155 additions and 297 deletions

View File

@ -6679,6 +6679,7 @@ void GaussCol_F32_C(const float* src0,
int width);
void GaussRow_C(const uint32_t* src, uint16_t* dst, int width);
void GaussRow_NEON(const uint32_t* src, uint16_t* dst, int width);
void GaussCol_C(const uint16_t* src0,
const uint16_t* src1,
const uint16_t* src2,
@ -6686,6 +6687,13 @@ void GaussCol_C(const uint16_t* src0,
const uint16_t* src4,
uint32_t* dst,
int width);
void GaussCol_NEON(const uint16_t* src0,
const uint16_t* src1,
const uint16_t* src2,
const uint16_t* src3,
const uint16_t* src4,
uint32_t* dst,
int width);
void ClampFloatToZero_SSE2(const float* src_x, float* dst_y, int width);

View File

@ -347,6 +347,10 @@ void ScaleRowDown2Box_16_C(const uint16_t* src_ptr,
ptrdiff_t src_stride,
uint16_t* dst,
int dst_width);
void ScaleRowDown2Box_16_NEON(const uint16_t* src_ptr,
ptrdiff_t src_stride,
uint16_t* dst,
int dst_width);
void ScaleRowDown2Box_16To8_C(const uint16_t* src_ptr,
ptrdiff_t src_stride,
uint8_t* dst,

View File

@ -1833,7 +1833,8 @@ struct RgbUVConstants {
};
// 8x1 pixels.
void ARGBToUV444MatrixRow_NEON(const uint8_t* src_argb,
static void ARGBToUV444MatrixRow_NEON(
const uint8_t* src_argb,
uint8_t* dst_u,
uint8_t* dst_v,
int width,
@ -2752,7 +2753,7 @@ static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0},
static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, 0x1080};
// ARGB expects first 3 values to contain RGB and 4th value is ignored.
void ARGBToYMatrixRow_NEON(const uint8_t* src_argb,
static void ARGBToYMatrixRow_NEON(const uint8_t* src_argb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -2802,7 +2803,7 @@ void ABGRToYJRow_NEON(const uint8_t* src_abgr, uint8_t* dst_yj, int width) {
// RGBA expects first value to be A and ignored, then 3 values to contain RGB.
// Same code as ARGB, except the LD4
void RGBAToYMatrixRow_NEON(const uint8_t* src_rgba,
static void RGBAToYMatrixRow_NEON(const uint8_t* src_rgba,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -2846,7 +2847,7 @@ void BGRAToYRow_NEON(const uint8_t* src_bgra, uint8_t* dst_y, int width) {
RGBAToYMatrixRow_NEON(src_bgra, dst_y, width, &kRawI601Constants);
}
void RGBToYMatrixRow_NEON(const uint8_t* src_rgb,
static void RGBToYMatrixRow_NEON(const uint8_t* src_rgb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {

View File

@ -2722,7 +2722,8 @@ struct RgbUVConstantsI8 {
};
// 8x1 pixels.
void ARGBToUV444MatrixRow_NEON(const uint8_t* src_argb,
static void ARGBToUV444MatrixRow_NEON(
const uint8_t* src_argb,
uint8_t* dst_u,
uint8_t* dst_v,
int width,
@ -2763,7 +2764,7 @@ void ARGBToUV444MatrixRow_NEON(const uint8_t* src_argb,
"v27", "v28", "v29");
}
void ARGBToUV444MatrixRow_NEON_I8MM(
static void ARGBToUV444MatrixRow_NEON_I8MM(
const uint8_t* src_argb,
uint8_t* dst_u,
uint8_t* dst_v,
@ -3519,7 +3520,7 @@ struct RgbConstants {
};
// ARGB expects first 3 values to contain RGB and 4th value is ignored.
void ARGBToYMatrixRow_NEON(const uint8_t* src_argb,
static void ARGBToYMatrixRow_NEON(const uint8_t* src_argb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -3552,8 +3553,8 @@ void ARGBToYMatrixRow_NEON(const uint8_t* src_argb,
"v17");
}
void
ARGBToYMatrixRow_NEON_DotProd(const uint8_t* src_argb,
static void ARGBToYMatrixRow_NEON_DotProd(
const uint8_t* src_argb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -3655,7 +3656,7 @@ void ABGRToYJRow_NEON_DotProd(const uint8_t* src_abgr,
// RGBA expects first value to be A and ignored, then 3 values to contain RGB.
// Same code as ARGB, except the LD4
void RGBAToYMatrixRow_NEON(const uint8_t* src_rgba,
static void RGBAToYMatrixRow_NEON(const uint8_t* src_rgba,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -3727,7 +3728,7 @@ void BGRAToYRow_NEON_DotProd(const uint8_t* src_bgra,
&kRawI601DotProdConstants);
}
void RGBToYMatrixRow_NEON(const uint8_t* src_rgb,
static void RGBToYMatrixRow_NEON(const uint8_t* src_rgb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {

View File

@ -2079,7 +2079,7 @@ static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0},
// ARGB expects first 3 values to contain RGB and 4th value is ignored
#ifdef HAS_ARGBTOYMATRIXROW_RVV
#ifdef LIBYUV_RVV_HAS_TUPLE_TYPE
void ARGBToYMatrixRow_RVV(const uint8_t* src_argb,
static void ARGBToYMatrixRow_RVV(const uint8_t* src_argb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -2112,7 +2112,7 @@ void ARGBToYMatrixRow_RVV(const uint8_t* src_argb,
} while (w > 0);
}
#else
void ARGBToYMatrixRow_RVV(const uint8_t* src_argb,
static void ARGBToYMatrixRow_RVV(const uint8_t* src_argb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -2171,7 +2171,7 @@ void ABGRToYJRow_RVV(const uint8_t* src_abgr, uint8_t* dst_yj, int width) {
// RGBA expects first value to be A and ignored, then 3 values to contain RGB.
#ifdef HAS_RGBATOYMATRIXROW_RVV
#ifdef LIBYUV_RVV_HAS_TUPLE_TYPE
void RGBAToYMatrixRow_RVV(const uint8_t* src_rgba,
static void RGBAToYMatrixRow_RVV(const uint8_t* src_rgba,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -2204,7 +2204,7 @@ void RGBAToYMatrixRow_RVV(const uint8_t* src_rgba,
} while (w > 0);
}
#else
void RGBAToYMatrixRow_RVV(const uint8_t* src_rgba,
static void RGBAToYMatrixRow_RVV(const uint8_t* src_rgba,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -2256,7 +2256,7 @@ void BGRAToYRow_RVV(const uint8_t* src_bgra, uint8_t* dst_y, int width) {
#ifdef HAS_RGBTOYMATRIXROW_RVV
#ifdef LIBYUV_RVV_HAS_TUPLE_TYPE
void RGBToYMatrixRow_RVV(const uint8_t* src_rgb,
static void RGBToYMatrixRow_RVV(const uint8_t* src_rgb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {
@ -2289,7 +2289,7 @@ void RGBToYMatrixRow_RVV(const uint8_t* src_rgb,
} while (w > 0);
}
#else
void RGBToYMatrixRow_RVV(const uint8_t* src_rgb,
static void RGBToYMatrixRow_RVV(const uint8_t* src_rgb,
uint8_t* dst_y,
int width,
const struct RgbConstants* rgbconstants) {

View File

@ -588,7 +588,7 @@ static const int16_t kABGRToUVJCoefficients[] = {
-21, 63, -42, 0, 63, -10, -53, 0,
};
void ARGBToUVMatrixRow_SVE2(const uint8_t* src_argb,
static void ARGBToUVMatrixRow_SVE2(const uint8_t* src_argb,
int src_stride_argb,
uint8_t* dst_u,
uint8_t* dst_v,

View File

@ -1080,91 +1080,6 @@ void ScaleFilterCols_NEON(uint8_t* dst_ptr,
#undef LOAD2_DATA8_LANE
// 16x2 -> 16x1
void ScaleFilterRows_NEON(uint8_t* dst_ptr,
const uint8_t* src_ptr,
ptrdiff_t src_stride,
int dst_width,
int source_y_fraction) {
asm volatile (
"cmp %4, #0 \n"
"beq 100f \n"
"add %2, %1 \n"
"cmp %4, #64 \n"
"beq 75f \n"
"cmp %4, #128 \n"
"beq 50f \n"
"cmp %4, #192 \n"
"beq 25f \n"
"vdup.8 d5, %4 \n"
"rsb %4, #256 \n"
"vdup.8 d4, %4 \n"
// General purpose row blend.
"1: \n"
"vld1.8 {q0}, [%1]! \n"
"vld1.8 {q1}, [%2]! \n"
"subs %3, %3, #16 \n"
"vmull.u8 q13, d0, d4 \n"
"vmull.u8 q14, d1, d4 \n"
"vmlal.u8 q13, d2, d5 \n"
"vmlal.u8 q14, d3, d5 \n"
"vrshrn.u16 d0, q13, #8 \n"
"vrshrn.u16 d1, q14, #8 \n"
"vst1.8 {q0}, [%0]! \n"
"bgt 1b \n"
"b 99f \n"
// Blend 25 / 75.
"25: \n"
"vld1.8 {q0}, [%1]! \n"
"vld1.8 {q1}, [%2]! \n"
"subs %3, %3, #16 \n"
"vrhadd.u8 q0, q1 \n"
"vrhadd.u8 q0, q1 \n"
"vst1.8 {q0}, [%0]! \n"
"bgt 25b \n"
"b 99f \n"
// Blend 50 / 50.
"50: \n"
"vld1.8 {q0}, [%1]! \n"
"vld1.8 {q1}, [%2]! \n"
"subs %3, %3, #16 \n"
"vrhadd.u8 q0, q1 \n"
"vst1.8 {q0}, [%0]! \n"
"bgt 50b \n"
"b 99f \n"
// Blend 75 / 25.
"75: \n"
"vld1.8 {q1}, [%1]! \n"
"vld1.8 {q0}, [%2]! \n"
"subs %3, %3, #16 \n"
"vrhadd.u8 q0, q1 \n"
"vrhadd.u8 q0, q1 \n"
"vst1.8 {q0}, [%0]! \n"
"bgt 75b \n"
"b 99f \n"
// Blend 100 / 0 - Copy row unchanged.
"100: \n"
"vld1.8 {q0}, [%1]! \n"
"subs %3, %3, #16 \n"
"vst1.8 {q0}, [%0]! \n"
"bgt 100b \n"
"99: \n"
"vst1.8 {d1[7]}, [%0] \n"
: "+r"(dst_ptr), // %0
"+r"(src_ptr), // %1
"+r"(src_stride), // %2
"+r"(dst_width), // %3
"+r"(source_y_fraction) // %4
:
: "q0", "q1", "d4", "d5", "q13", "q14", "memory", "cc");
}
void ScaleARGBRowDown2_NEON(const uint8_t* src_ptr,
ptrdiff_t src_stride,
uint8_t* dst,

View File

@ -1458,58 +1458,6 @@ void ScaleRowDown2Box_16_NEON(const uint16_t* src_ptr,
);
}
// Read 8x2 upsample with filtering and write 16x1.
// Actually reads an extra pixel, so 9x2.
void ScaleRowUp2_16_NEON(const uint16_t* src_ptr,
ptrdiff_t src_stride,
uint16_t* dst,
int dst_width) {
asm volatile (
"add %1, %0, %1, lsl #1 \n" // ptr + stide * 2
"movi v0.8h, #9 \n" // constants
"movi v1.4s, #3 \n"
"1: \n"
"ld1 {v3.8h}, [%0], %4 \n" // TL read first 8
"ld1 {v4.8h}, [%0], %5 \n" // TR read 8 offset by 1
"ld1 {v5.8h}, [%1], %4 \n" // BL read 8 from next row
"ld1 {v6.8h}, [%1], %5 \n" // BR offset by 1
"subs %w3, %w3, #16 \n" // 16 dst pixels per loop
"umull v16.4s, v3.4h, v0.4h \n"
"umull2 v7.4s, v3.8h, v0.8h \n"
"umull v18.4s, v4.4h, v0.4h \n"
"umull2 v17.4s, v4.8h, v0.8h \n"
"prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead
"uaddw v16.4s, v16.4s, v6.4h \n"
"uaddl2 v19.4s, v6.8h, v3.8h \n"
"uaddl v3.4s, v6.4h, v3.4h \n"
"uaddw2 v6.4s, v7.4s, v6.8h \n"
"uaddl2 v7.4s, v5.8h, v4.8h \n"
"uaddl v4.4s, v5.4h, v4.4h \n"
"uaddw v18.4s, v18.4s, v5.4h \n"
"prfm pldl1keep, [%1, 448] \n"
"mla v16.4s, v4.4s, v1.4s \n"
"mla v18.4s, v3.4s, v1.4s \n"
"mla v6.4s, v7.4s, v1.4s \n"
"uaddw2 v4.4s, v17.4s, v5.8h \n"
"uqrshrn v16.4h, v16.4s, #4 \n"
"mla v4.4s, v19.4s, v1.4s \n"
"uqrshrn2 v16.8h, v6.4s, #4 \n"
"uqrshrn v17.4h, v18.4s, #4 \n"
"uqrshrn2 v17.8h, v4.4s, #4 \n"
"st2 {v16.8h-v17.8h}, [%2], #32 \n"
"b.gt 1b \n"
: "+r"(src_ptr), // %0
"+r"(src_stride), // %1
"+r"(dst), // %2
"+r"(dst_width) // %3
: "r"(2LL), // %4
"r"(14LL) // %5
: "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16",
"v17", "v18", "v19" // Clobber List
);
}
void ScaleUVRowDown2_NEON(const uint8_t* src_ptr,
ptrdiff_t src_stride,
uint8_t* dst,

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "libyuv/scale.h"
#include "libyuv/scale_uv.h"
#include <assert.h>
#include <string.h>

View File

@ -326,7 +326,7 @@ TESTAPLANARTOP(Android420, NV21, 2, 1, 0, 2, 2, I420, 2, 2)
#undef TESTAPLANARTOPI
// wrapper to keep API the same
int I400ToNV21(const uint8_t* src_y,
static int I400ToNV21(const uint8_t* src_y,
int src_stride_y,
const uint8_t* /* src_u */,
int /* src_stride_u */,

View File

@ -27,7 +27,7 @@
namespace libyuv {
#ifdef LIBYUV_HAVE_PTHREAD
void* ThreadMain(void* arg) {
static void* ThreadMain(void* arg) {
int* flags = static_cast<int*>(arg);
*flags = TestCpuFlag(kCpuInitialized);

View File

@ -2496,7 +2496,7 @@ TEST_F(LibYUVPlanarTest, DISABLED_ARM(TestARGBPolynomial)) {
}
}
int TestHalfFloatPlane(int benchmark_width,
static int TestHalfFloatPlane(int benchmark_width,
int benchmark_height,
int benchmark_iterations,
int disable_cpu_flags,
@ -2631,7 +2631,7 @@ TEST_F(LibYUVPlanarTest, TestHalfFloatPlane_12bit_One) {
EXPECT_LE(diff, 1);
}
float TestByteToFloat(int benchmark_width,
static float TestByteToFloat(int benchmark_width,
int benchmark_height,
int benchmark_iterations,
int disable_cpu_flags,

View File

@ -16,7 +16,7 @@
namespace libyuv {
void TestRotateBpp(int src_width,
static void TestRotateBpp(int src_width,
int src_height,
int dst_width,
int dst_height,

View File

@ -369,8 +369,7 @@ TEST_SCALESWAPXY1(ARGBScale, Bilinear, 0)
// Scale with YUV conversion to ARGB and clipping.
// TODO(fbarchard): Add fourcc support. All 4 ARGB formats is easy to support.
LIBYUV_API
int YUVToARGBScaleReference2(const uint8_t* src_y,
static int YUVToARGBScaleReference2(const uint8_t* src_y,
int src_stride_y,
const uint8_t* src_u,
int src_stride_u,

View File

@ -128,11 +128,6 @@ TEST_F(LibYUVScaleTest, TestScaleRowDown2Box_Odd_SSSE3) {
}
#endif // HAS_SCALEROWDOWN2_SSSE3
extern "C" void ScaleRowDown2Box_16_NEON(const uint16_t* src_ptr,
ptrdiff_t src_stride,
uint16_t* dst,
int dst_width);
TEST_F(LibYUVScaleTest, TestScaleRowDown2Box_16) {
SIMD_ALIGNED(uint16_t orig_pixels[2560 * 2]);
SIMD_ALIGNED(uint16_t dst_pixels_c[1280]);

View File

@ -67,7 +67,7 @@ static LIBYUV_BOOL TestEnv(const char*) {
}
#endif
int TestCpuEnv(int cpu_info) {
static int TestCpuEnv(int cpu_info) {
#if defined(__arm__) || defined(__aarch64__)
if (TestEnv("LIBYUV_DISABLE_NEON")) {
cpu_info &= ~libyuv::kCpuHasNEON;

View File

@ -65,7 +65,7 @@ int num_threads = 0;
#endif
// Parse PYUV format. ie name.1920x800_24Hz_P420.yuv
bool ExtractResolutionFromFilename(const char* name,
static bool ExtractResolutionFromFilename(const char* name,
int* width_ptr,
int* height_ptr) {
// Isolate the .width_height. section of the filename by searching for a
@ -105,25 +105,12 @@ bool ExtractResolutionFromFilename(const char* name,
return false;
}
// Scale Y channel from 16..240 to 0..255.
// This can be useful when comparing codecs that are inconsistant about Y
uint8_t ScaleY(uint8_t y) {
int ny = (y - 16) * 256 / 224;
if (ny < 0) {
ny = 0;
}
if (ny > 255) {
ny = 255;
}
return static_cast<uint8_t>(ny);
}
// MSE = Mean Square Error
double GetMSE(double sse, double size) {
static double GetMSE(double sse, double size) {
return sse / size;
}
void PrintHelp(const char* program) {
static void PrintHelp(const char* program) {
printf("%s [-options] org_seq rec_seq [rec_seq2.. etc]\n", program);
#ifdef HAVE_JPEG
printf("jpeg or raw YUV 420 supported.\n");
@ -151,7 +138,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]);
}
@ -240,7 +227,7 @@ void ParseOptions(int argc, const char* argv[]) {
}
}
bool UpdateMetrics(uint8_t* ch_org,
static bool UpdateMetrics(uint8_t* ch_org,
uint8_t* ch_rec,
const int y_size,
const int uv_size,