casting for c89 compatibility and lint cleanup

Bug: libyuv:756
Test: CFLAGS="-m32 -static -std=gnu89 -mno-sse -O2" CXXFLAGS="-m32 -x c -static -std=gnu99 -mno-sse -O2" make -f linux.mk libyuv.a
Change-Id: Ic362f93e01ccbb0bea14f361a58585e79297e7d2
Reviewed-on: https://chromium-review.googlesource.com/759423
Reviewed-by: Frank Barchard <fbarchard@google.com>
Reviewed-by: Patrik Höglund <phoglund@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@google.com>
This commit is contained in:
Frank Barchard 2017-11-08 17:57:04 -08:00 committed by Commit Bot
parent 735ace2ed3
commit e26b0a7e0e
6 changed files with 19 additions and 23 deletions

View File

@ -24,7 +24,7 @@ static LIBYUV_BOOL ScanEOI(const uint8* sample, size_t sample_size) {
const uint8* it = sample; const uint8* it = sample;
while (it < end) { while (it < end) {
// TODO(fbarchard): scan for 0xd9 instead. // TODO(fbarchard): scan for 0xd9 instead.
it = static_cast<const uint8*>(memchr(it, 0xff, end - it)); it = (const uint8*)(memchr(it, 0xff, end - it));
if (it == NULL) { if (it == NULL) {
break; break;
} }

View File

@ -2758,9 +2758,11 @@ void MergeUV10Row_AVX2(const uint16* src_u,
const uint16* src_v, const uint16* src_v,
uint16* dst_uv, uint16* dst_uv,
int width) { int width) {
// clang-format off
asm volatile ( asm volatile (
"sub %0,%1 \n" "sub %0,%1 \n"
// 16 pixels per loop.
LABELALIGN LABELALIGN
"1: \n" "1: \n"
"vmovdqu (%0),%%ymm0 \n" "vmovdqu (%0),%%ymm0 \n"
@ -2768,14 +2770,8 @@ void MergeUV10Row_AVX2(const uint16* src_u,
"add $0x20,%0 \n" "add $0x20,%0 \n"
"vpsllw $0x6,%%ymm0,%%ymm0 \n" "vpsllw $0x6,%%ymm0,%%ymm0 \n"
"vpsllw $0x6,%%ymm1,%%ymm1 \n" "vpsllw $0x6,%%ymm1,%%ymm1 \n"
// "vpermq $0xd8,%%ymm0,%%ymm0 \n" "vpunpcklwd %%ymm1,%%ymm0,%%ymm2 \n" // mutates
// "vpermq $0xd8,%%ymm1,%%ymm1 \n"
"vpunpcklwd %%ymm1,%%ymm0,%%ymm2 \n"
"vpunpckhwd %%ymm1,%%ymm0,%%ymm0 \n" "vpunpckhwd %%ymm1,%%ymm0,%%ymm0 \n"
// "vmovdqu %%ymm2, (%2) \n"
// "vmovdqu %%ymm0, 0x20(%2) \n"
"vextractf128 $0x0,%%ymm2,(%2) \n" "vextractf128 $0x0,%%ymm2,(%2) \n"
"vextractf128 $0x0,%%ymm0,0x10(%2) \n" "vextractf128 $0x0,%%ymm0,0x10(%2) \n"
"vextractf128 $0x1,%%ymm2,0x20(%2) \n" "vextractf128 $0x1,%%ymm2,0x20(%2) \n"
@ -2789,12 +2785,11 @@ void MergeUV10Row_AVX2(const uint16* src_u,
"+r"(dst_uv), // %2 "+r"(dst_uv), // %2
"+r"(width) // %3 "+r"(width) // %3
: :
: "memory", "cc", "xmm0", "xmm1", "xmm2" : "memory", "cc", "xmm0", "xmm1", "xmm2");
); // clang-format on
} }
#endif // HAS_MERGEUVROW_AVX2 #endif // HAS_MERGEUVROW_AVX2
#ifdef HAS_SPLITRGBROW_SSSE3 #ifdef HAS_SPLITRGBROW_SSSE3
// Shuffle table for converting RGB to Planar. // Shuffle table for converting RGB to Planar.

View File

@ -822,11 +822,12 @@ static void ScaleAddCols2_16_C(int dst_width,
static void ScaleAddCols0_C(int dst_width, static void ScaleAddCols0_C(int dst_width,
int boxheight, int boxheight,
int x, int x,
int, int dx,
const uint16* src_ptr, const uint16* src_ptr,
uint8* dst_ptr) { uint8* dst_ptr) {
int scaleval = 65536 / boxheight; int scaleval = 65536 / boxheight;
int i; int i;
(void)dx;
src_ptr += (x >> 16); src_ptr += (x >> 16);
for (i = 0; i < dst_width; ++i) { for (i = 0; i < dst_width; ++i) {
*dst_ptr++ = src_ptr[i] * scaleval >> 16; *dst_ptr++ = src_ptr[i] * scaleval >> 16;