| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2009 uint32 bb = src_argb1[0]; | 2009 uint32 bb = src_argb1[0]; |
| 2010 uint32 bg = src_argb1[1]; | 2010 uint32 bg = src_argb1[1]; |
| 2011 uint32 br = src_argb1[2]; | 2011 uint32 br = src_argb1[2]; |
| 2012 dst_argb[0] = BLEND(fb, bb, a); | 2012 dst_argb[0] = BLEND(fb, bb, a); |
| 2013 dst_argb[1] = BLEND(fg, bg, a); | 2013 dst_argb[1] = BLEND(fg, bg, a); |
| 2014 dst_argb[2] = BLEND(fr, br, a); | 2014 dst_argb[2] = BLEND(fr, br, a); |
| 2015 dst_argb[3] = 255u; | 2015 dst_argb[3] = 255u; |
| 2016 } | 2016 } |
| 2017 } | 2017 } |
| 2018 #undef BLEND | 2018 #undef BLEND |
| 2019 |
| 2020 void BlendPlaneRow_C(const uint8* src0, const uint8* src1, |
| 2021 const uint8* alpha, uint8* dst, int width) { |
| 2022 int x; |
| 2023 for (x = 0; x < width; ++x) { |
| 2024 uint32 f = *src0++; |
| 2025 uint32 b = *src1++; |
| 2026 uint32 a = *alpha++; |
| 2027 *dst++ = (((a) * f) + ((255 - a) * b) + 255) >> 8; |
| 2028 } |
| 2029 } |
| 2030 |
| 2019 #define ATTENUATE(f, a) (a | (a << 8)) * (f | (f << 8)) >> 24 | 2031 #define ATTENUATE(f, a) (a | (a << 8)) * (f | (f << 8)) >> 24 |
| 2020 | 2032 |
| 2021 // Multiply source RGB by alpha and store to destination. | 2033 // Multiply source RGB by alpha and store to destination. |
| 2022 // This code mimics the SSSE3 version for better testability. | 2034 // This code mimics the SSSE3 version for better testability. |
| 2023 void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width) { | 2035 void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width) { |
| 2024 int i; | 2036 int i; |
| 2025 for (i = 0; i < width - 1; i += 2) { | 2037 for (i = 0; i < width - 1; i += 2) { |
| 2026 uint32 b = src_argb[0]; | 2038 uint32 b = src_argb[0]; |
| 2027 uint32 g = src_argb[1]; | 2039 uint32 g = src_argb[1]; |
| 2028 uint32 r = src_argb[2]; | 2040 uint32 r = src_argb[2]; |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2611 dst_rgb565 += twidth * 2; | 2623 dst_rgb565 += twidth * 2; |
| 2612 width -= twidth; | 2624 width -= twidth; |
| 2613 } | 2625 } |
| 2614 } | 2626 } |
| 2615 #endif | 2627 #endif |
| 2616 | 2628 |
| 2617 #ifdef __cplusplus | 2629 #ifdef __cplusplus |
| 2618 } // extern "C" | 2630 } // extern "C" |
| 2619 } // namespace libyuv | 2631 } // namespace libyuv |
| 2620 #endif | 2632 #endif |
| OLD | NEW |