Commit d1f2ef31 authored by fbarchard@google.com's avatar fbarchard@google.com

Scale specialized for 50/50 vertically and check x is integer

BUG=260
TESTED=manual test with LIBYUV_HEIGHT=1440
R=wuwang@google.com

Review URL: https://webrtc-codereview.appspot.com/2116004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@772 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent eed5d8e9
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 771 Version: 772
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 771 #define LIBYUV_VERSION 772
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -1792,6 +1792,14 @@ void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, ...@@ -1792,6 +1792,14 @@ void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
} }
} }
// Blend 2 rows into 1 for conversions such as I422ToI420.
void HalfRow_C(const uint8* src_uv, int src_uv_stride,
uint8* dst_uv, int pix) {
for (int x = 0; x < pix; ++x) {
dst_uv[x] = (src_uv[x] + src_uv[src_uv_stride + x] + 1) >> 1;
}
}
// C version 2x2 -> 2x1. // C version 2x2 -> 2x1.
void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr, void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
ptrdiff_t src_stride, ptrdiff_t src_stride,
...@@ -1800,6 +1808,10 @@ void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr, ...@@ -1800,6 +1808,10 @@ void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
memcpy(dst_ptr, src_ptr, width); memcpy(dst_ptr, src_ptr, width);
return; return;
} }
if (source_y_fraction == 128) {
HalfRow_C(src_ptr, static_cast<int>(src_stride), dst_ptr, width);
return;
}
int y1_fraction = source_y_fraction; int y1_fraction = source_y_fraction;
int y0_fraction = 256 - y1_fraction; int y0_fraction = 256 - y1_fraction;
const uint8* src_ptr1 = src_ptr + src_stride; const uint8* src_ptr1 = src_ptr + src_stride;
...@@ -1816,14 +1828,6 @@ void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr, ...@@ -1816,14 +1828,6 @@ void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr,
} }
} }
// Blend 2 rows into 1 for conversions such as I422ToI420.
void HalfRow_C(const uint8* src_uv, int src_uv_stride,
uint8* dst_uv, int pix) {
for (int x = 0; x < pix; ++x) {
dst_uv[x] = (src_uv[x] + src_uv[src_uv_stride + x] + 1) >> 1;
}
}
// Select 2 channels from ARGB on alternating pixels. e.g. BGBGBGBG // Select 2 channels from ARGB on alternating pixels. e.g. BGBGBGBG
void ARGBToBayerRow_C(const uint8* src_argb, void ARGBToBayerRow_C(const uint8* src_argb,
uint8* dst_bayer, uint32 selector, int pix) { uint8* dst_bayer, uint32 selector, int pix) {
......
...@@ -1468,7 +1468,7 @@ static void ScaleARGB(const uint8* src, int src_stride, ...@@ -1468,7 +1468,7 @@ static void ScaleARGB(const uint8* src, int src_stride,
} }
} }
} }
if (dx == 0x10000 && (dx & 0xffff) == 0) { if (dx == 0x10000 && (x & 0xffff) == 0) {
// Arbitrary scale vertically, but unscaled vertically. // Arbitrary scale vertically, but unscaled vertically.
ScaleARGBBilinearVertical(src_height, ScaleARGBBilinearVertical(src_height,
clip_width, clip_height, clip_width, clip_height,
......
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