Commit 91ab1395 authored by fbarchard@google.com's avatar fbarchard@google.com

inline version of alpha blend

BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/446006

git-svn-id: http://libyuv.googlecode.com/svn/trunk@216 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent f620d2ae
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 214
Version: 216
License: BSD
License File: LICENSE
......
......@@ -11,7 +11,7 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 214
#define LIBYUV_VERSION 216
#endif // INCLUDE_LIBYUV_VERSION_H_
......@@ -170,6 +170,10 @@ int ARGBBlend(const uint8* src_argb, int src_stride_argb,
#if defined(HAS_ARGBBLENDROW_SSE2)
if (TestCpuFlag(kCpuHasSSE2)) {
ARGBBlendRow = ARGBBlendRow_SSE2;
if (IS_ALIGNED(width, 4) &&
IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) {
ARGBBlendRow = ARGBBlendRow_Aligned_SSE2;
}
}
#endif
......
......@@ -240,10 +240,13 @@ void YToARGBRow_SSE2(const uint8* y_buf,
uint8* rgb_buf,
int width);
// ARGB preattenuated alpha blend.
void ARGBBlendRow_Aligned_SSE2(const uint8* src_argb, uint8* dst_argb,
int width);
void ARGBBlendRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width);
void ARGBBlendRow_C(const uint8* src_argb, uint8* dst_argb, int width);
// 'Any' wrappers use memcpy()
// 'Any' functions handle any size and alignment.
void I420ToARGBRow_Any_SSSE3(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
......
......@@ -452,7 +452,7 @@ void UYVYToYRow_C(const uint8* src_yuy2, uint8* dst_y, int width) {
}
}
#define BLENDER(f, b, a) (f * a + b * (a ^ 0xff) + 0x80) >> 8
#define BLENDER(f, b, a) (((256 - a) * b) >> 8) + f
void ARGBBlendRow_C(const uint8* src_argb, uint8* dst_argb, int width) {
for (int x = 0; x < width - 1; x += 2) {
uint32 a = src_argb[3];
......
This diff is collapsed.
This diff is collapsed.
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