mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-08 01:36:47 +08:00
Some minor fixes for yuy2, r12 register, mask on any function.
BUG=none TEST=none Review URL: https://webrtc-codereview.appspot.com/936023 git-svn-id: http://libyuv.googlecode.com/svn/trunk@489 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
3e46444727
commit
752cb9e057
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 488
|
||||
Version: 489
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 488
|
||||
#define LIBYUV_VERSION 489
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -579,59 +579,6 @@ int Q420ToI420(const uint8* src_y, int src_stride_y,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Test if over reading on source is safe.
|
||||
// TODO(fbarchard): Find more efficient solution to safely do odd sizes.
|
||||
// Macros to control read policy, from slowest to fastest:
|
||||
// READSAFE_NEVER - disables read ahead on systems with strict memory reads
|
||||
// READSAFE_ODDHEIGHT - last row of odd height done with C.
|
||||
// This policy assumes that the caller handles the last row of an odd height
|
||||
// image using C.
|
||||
// READSAFE_PAGE - enable read ahead within same page.
|
||||
// A page is 4096 bytes. When reading ahead, if the last pixel is near the
|
||||
// end the page, and a read spans the page into the next page, a memory
|
||||
// exception can occur if that page has not been allocated, or is a guard
|
||||
// page. This setting ensures the overread is within the same page.
|
||||
// READSAFE_ALWAYS - enables read ahead on systems without memory exceptions
|
||||
// or where buffers are padded by 64 bytes.
|
||||
|
||||
#if defined(HAS_RGB24TOARGBROW_SSSE3) || \
|
||||
defined(HAS_RGB24TOARGBROW_SSSE3) || \
|
||||
defined(HAS_RAWTOARGBROW_SSSE3) || \
|
||||
defined(HAS_RGB565TOARGBROW_SSE2) || \
|
||||
defined(HAS_ARGB1555TOARGBROW_SSE2) || \
|
||||
defined(HAS_ARGB4444TOARGBROW_SSE2)
|
||||
|
||||
#define READSAFE_ODDHEIGHT
|
||||
|
||||
static bool TestReadSafe(const uint8* src_yuy2, int src_stride_yuy2,
|
||||
int width, int height, int bpp, int overread) {
|
||||
if (width > kMaxStride) {
|
||||
return false;
|
||||
}
|
||||
#if defined(READSAFE_ALWAYS)
|
||||
return true;
|
||||
#elif defined(READSAFE_NEVER)
|
||||
return false;
|
||||
#elif defined(READSAFE_ODDHEIGHT)
|
||||
if (!(width & 15) ||
|
||||
(src_stride_yuy2 >= 0 && (height & 1) && width * bpp >= overread)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#elif defined(READSAFE_PAGE)
|
||||
if (src_stride_yuy2 >= 0) {
|
||||
src_yuy2 += (height - 1) * src_stride_yuy2;
|
||||
}
|
||||
uintptr_t last_adr = (uintptr_t)(src_yuy2) + width * bpp - 1;
|
||||
uintptr_t last_read_adr = last_adr + overread - 1;
|
||||
if (((last_adr ^ last_read_adr) & ~4095) == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// Convert YUY2 to I420.
|
||||
LIBYUV_API
|
||||
int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2,
|
||||
|
||||
@ -282,7 +282,7 @@ UV422ANY(UYVYToUV422Row_Any_SSE2, UYVYToUV422Row_Unaligned_SSE2,
|
||||
#endif
|
||||
#ifdef HAS_YUY2TOUV422ROW_NEON
|
||||
UV422ANY(ARGBToUV444Row_Any_NEON, ARGBToUV444Row_NEON,
|
||||
ARGBToUV444Row_C, 4, 8, 0)
|
||||
ARGBToUV444Row_C, 4, 7, 0)
|
||||
UV422ANY(ARGBToUV422Row_Any_NEON, ARGBToUV422Row_NEON,
|
||||
ARGBToUV422Row_C, 4, 15, 1)
|
||||
UV422ANY(ARGBToUV411Row_Any_NEON, ARGBToUV411Row_NEON,
|
||||
|
||||
@ -517,7 +517,7 @@ void ARGBToUV422Row_C(const uint8* src_argb,
|
||||
dst_u += 1;
|
||||
dst_v += 1;
|
||||
}
|
||||
if ((width & 3) == 1) {
|
||||
if (width & 1) {
|
||||
uint8 ab = src_argb[0];
|
||||
uint8 ag = src_argb[1];
|
||||
uint8 ar = src_argb[2];
|
||||
|
||||
@ -906,16 +906,17 @@ void MirrorRow_NEON(const uint8* src, uint8* dst, int width) {
|
||||
#endif // HAS_MIRRORROW_NEON
|
||||
|
||||
#ifdef HAS_MIRRORUVROW_NEON
|
||||
void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width) {
|
||||
void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
|
||||
int width) {
|
||||
asm volatile (
|
||||
// Start at end of source row.
|
||||
"mov r3, #-16 \n"
|
||||
"mov r12, #-16 \n"
|
||||
"add %0, %0, %3, lsl #1 \n"
|
||||
"sub %0, #16 \n"
|
||||
|
||||
".p2align 2 \n"
|
||||
"1: \n"
|
||||
"vld2.8 {d0, d1}, [%0], r3 \n" // src -= 16
|
||||
"vld2.8 {d0, d1}, [%0], r12 \n" // src -= 16
|
||||
"subs %3, #8 \n" // 8 pixels per loop.
|
||||
"vrev64.8 q0, q0 \n"
|
||||
"vst1.8 {d0}, [%1]! \n" // dst += 8
|
||||
@ -926,7 +927,7 @@ void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width
|
||||
"+r"(dst_v), // %2
|
||||
"+r"(width) // %3
|
||||
:
|
||||
: "memory", "cc", "r3", "q0"
|
||||
: "memory", "cc", "r12", "q0"
|
||||
);
|
||||
}
|
||||
#endif // HAS_MIRRORUVROW_NEON
|
||||
|
||||
@ -710,7 +710,6 @@ void ScaleARGBFilterRows_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
|
||||
, "xmm0", "xmm1", "xmm2", "xmm5"
|
||||
#endif
|
||||
);
|
||||
|
||||
}
|
||||
#endif // defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
|
||||
@ -823,8 +823,8 @@ TESTATOB(RGB24, 3, 3, 1, ARGB, 4, 4, 1, 0)
|
||||
TESTATOB(RGB565, 2, 2, 1, ARGB, 4, 4, 1, 0)
|
||||
TESTATOB(ARGB1555, 2, 2, 1, ARGB, 4, 4, 1, 0)
|
||||
TESTATOB(ARGB4444, 2, 2, 1, ARGB, 4, 4, 1, 0)
|
||||
TESTATOB(YUY2, 2, 4, 1, ARGB, 4, 4, 1, 14)
|
||||
TESTATOB(UYVY, 2, 4, 1, ARGB, 4, 4, 1, 14)
|
||||
TESTATOB(YUY2, 2, 4, 1, ARGB, 4, 4, 1, 4)
|
||||
TESTATOB(UYVY, 2, 4, 1, ARGB, 4, 4, 1, 4)
|
||||
TESTATOB(BayerBGGR, 1, 2, 2, ARGB, 4, 4, 1, 0)
|
||||
TESTATOB(BayerRGGB, 1, 2, 2, ARGB, 4, 4, 1, 0)
|
||||
TESTATOB(BayerGBRG, 1, 2, 2, ARGB, 4, 4, 1, 0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user