RAWToJ400 require multiple of 16 pixels for NEON

- fix crash when width is not a multiple of 16
- apply clang format
- bump version

Bug: libyuv:940, b/240094327
Change-Id: Ic18e5b7b64f78f26e8b7d8440bf490a679bda200
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3812594
Reviewed-by: Wan-Teh Chang <wtc@google.com>
This commit is contained in:
Frank Barchard 2022-08-04 14:38:13 -07:00 committed by Frank Barchard
parent 394436b289
commit d53f1beecd
4 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1834
Version: 1837
License: BSD
License File: LICENSE

View File

@ -693,10 +693,10 @@ void ScaleRowUp2_Linear_16_Any_SSE2(const uint16_t* src_ptr,
uint16_t* dst_ptr,
int dst_width);
void ScaleRowUp2_Bilinear_16_Any_SSE2(const uint16_t* src_ptr,
ptrdiff_t src_stride,
uint16_t* dst_ptr,
ptrdiff_t dst_stride,
int dst_width);
ptrdiff_t src_stride,
uint16_t* dst_ptr,
ptrdiff_t dst_stride,
int dst_width);
void ScaleRowUp2_Linear_Any_SSSE3(const uint8_t* src_ptr,
uint8_t* dst_ptr,
int dst_width);

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1834
#define LIBYUV_VERSION 1837
#endif // INCLUDE_LIBYUV_VERSION_H_

View File

@ -1641,7 +1641,7 @@ int BGRAToI420(const uint8_t* src_bgra,
#if defined(HAS_BGRATOYROW_NEON)
if (TestCpuFlag(kCpuHasNEON)) {
BGRAToYRow = BGRAToYRow_Any_NEON;
if (IS_ALIGNED(width, 8)) {
if (IS_ALIGNED(width, 16)) {
BGRAToYRow = BGRAToYRow_NEON;
}
}
@ -3190,6 +3190,7 @@ int RAWToJ400(const uint8_t* src_raw,
if (!src_raw || !dst_yj || width <= 0 || height == 0) {
return -1;
}
if (height < 0) {
height = -height;
src_raw = src_raw + (height - 1) * src_stride_raw;
@ -3201,6 +3202,7 @@ int RAWToJ400(const uint8_t* src_raw,
height = 1;
src_stride_raw = dst_stride_yj = 0;
}
#if defined(HAS_RAWTOYJROW_SSSE3)
if (TestCpuFlag(kCpuHasSSSE3)) {
RAWToYJRow = RAWToYJRow_Any_SSSE3;
@ -3220,7 +3222,7 @@ int RAWToJ400(const uint8_t* src_raw,
#if defined(HAS_RAWTOYJROW_NEON)
if (TestCpuFlag(kCpuHasNEON)) {
RAWToYJRow = RAWToYJRow_Any_NEON;
if (IS_ALIGNED(width, 8)) {
if (IS_ALIGNED(width, 16)) {
RAWToYJRow = RAWToYJRow_NEON;
}
}