| 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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 LIBYUV_API | 836 LIBYUV_API |
| 837 int I422ToRGBA(const uint8* src_y, int src_stride_y, | 837 int I422ToRGBA(const uint8* src_y, int src_stride_y, |
| 838 const uint8* src_u, int src_stride_u, | 838 const uint8* src_u, int src_stride_u, |
| 839 const uint8* src_v, int src_stride_v, | 839 const uint8* src_v, int src_stride_v, |
| 840 uint8* dst_rgba, int dst_stride_rgba, | 840 uint8* dst_rgba, int dst_stride_rgba, |
| 841 int width, int height) { | 841 int width, int height) { |
| 842 return I422ToRGBAMatrix(src_y, src_stride_y, | 842 return I422ToRGBAMatrix(src_y, src_stride_y, |
| 843 src_u, src_stride_u, | 843 src_u, src_stride_u, |
| 844 src_v, src_stride_v, | 844 src_v, src_stride_v, |
| 845 dst_rgba, dst_stride_rgba, | 845 dst_rgba, dst_stride_rgba, |
| 846 &kYuvIConstants, | 846 &kYuvI601Constants, |
| 847 width, height); | 847 width, height); |
| 848 } | 848 } |
| 849 | 849 |
| 850 // Convert I422 to BGRA. | 850 // Convert I422 to BGRA. |
| 851 LIBYUV_API | 851 LIBYUV_API |
| 852 int I422ToBGRA(const uint8* src_y, int src_stride_y, | 852 int I422ToBGRA(const uint8* src_y, int src_stride_y, |
| 853 const uint8* src_u, int src_stride_u, | 853 const uint8* src_u, int src_stride_u, |
| 854 const uint8* src_v, int src_stride_v, | 854 const uint8* src_v, int src_stride_v, |
| 855 uint8* dst_bgra, int dst_stride_bgra, | 855 uint8* dst_bgra, int dst_stride_bgra, |
| 856 int width, int height) { | 856 int width, int height) { |
| 857 return I422ToRGBAMatrix(src_y, src_stride_y, | 857 return I422ToRGBAMatrix(src_y, src_stride_y, |
| 858 src_v, src_stride_v, // Swap U and V | 858 src_v, src_stride_v, // Swap U and V |
| 859 src_u, src_stride_u, | 859 src_u, src_stride_u, |
| 860 dst_bgra, dst_stride_bgra, | 860 dst_bgra, dst_stride_bgra, |
| 861 &kYvuIConstants, // Use Yvu matrix | 861 &kYvuI601Constants, // Use Yvu matrix |
| 862 width, height); | 862 width, height); |
| 863 } | 863 } |
| 864 | 864 |
| 865 // Convert NV12 to RGB565. | 865 // Convert NV12 to RGB565. |
| 866 LIBYUV_API | 866 LIBYUV_API |
| 867 int NV12ToRGB565(const uint8* src_y, int src_stride_y, | 867 int NV12ToRGB565(const uint8* src_y, int src_stride_y, |
| 868 const uint8* src_uv, int src_stride_uv, | 868 const uint8* src_uv, int src_stride_uv, |
| 869 uint8* dst_rgb565, int dst_stride_rgb565, | 869 uint8* dst_rgb565, int dst_stride_rgb565, |
| 870 int width, int height) { | 870 int width, int height) { |
| 871 int y; | 871 int y; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 #if defined(HAS_NV12TORGB565ROW_NEON) | 903 #if defined(HAS_NV12TORGB565ROW_NEON) |
| 904 if (TestCpuFlag(kCpuHasNEON)) { | 904 if (TestCpuFlag(kCpuHasNEON)) { |
| 905 NV12ToRGB565Row = NV12ToRGB565Row_Any_NEON; | 905 NV12ToRGB565Row = NV12ToRGB565Row_Any_NEON; |
| 906 if (IS_ALIGNED(width, 8)) { | 906 if (IS_ALIGNED(width, 8)) { |
| 907 NV12ToRGB565Row = NV12ToRGB565Row_NEON; | 907 NV12ToRGB565Row = NV12ToRGB565Row_NEON; |
| 908 } | 908 } |
| 909 } | 909 } |
| 910 #endif | 910 #endif |
| 911 | 911 |
| 912 for (y = 0; y < height; ++y) { | 912 for (y = 0; y < height; ++y) { |
| 913 NV12ToRGB565Row(src_y, src_uv, dst_rgb565, &kYuvIConstants, width); | 913 NV12ToRGB565Row(src_y, src_uv, dst_rgb565, &kYuvI601Constants, width); |
| 914 dst_rgb565 += dst_stride_rgb565; | 914 dst_rgb565 += dst_stride_rgb565; |
| 915 src_y += src_stride_y; | 915 src_y += src_stride_y; |
| 916 if (y & 1) { | 916 if (y & 1) { |
| 917 src_uv += src_stride_uv; | 917 src_uv += src_stride_uv; |
| 918 } | 918 } |
| 919 } | 919 } |
| 920 return 0; | 920 return 0; |
| 921 } | 921 } |
| 922 | 922 |
| 923 // Convert RAW to RGB24. | 923 // Convert RAW to RGB24. |
| (...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2415 } | 2415 } |
| 2416 free_aligned_buffer_64(rows); | 2416 free_aligned_buffer_64(rows); |
| 2417 } | 2417 } |
| 2418 return 0; | 2418 return 0; |
| 2419 } | 2419 } |
| 2420 | 2420 |
| 2421 #ifdef __cplusplus | 2421 #ifdef __cplusplus |
| 2422 } // extern "C" | 2422 } // extern "C" |
| 2423 } // namespace libyuv | 2423 } // namespace libyuv |
| 2424 #endif | 2424 #endif |
| OLD | NEW |