Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: source/row_neon.cc

Issue 1419103007: Raw 24 bit RGB to RGB24 (bgr) (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: st3 for neon 24 bit stores Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/row_gcc.cc ('k') | source/row_neon64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 "1: \n" 791 "1: \n"
792 MEMACCESS(0) 792 MEMACCESS(0)
793 "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW. 793 "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW.
794 "subs %2, %2, #8 \n" // 8 processed per loop. 794 "subs %2, %2, #8 \n" // 8 processed per loop.
795 "vswp.u8 d1, d3 \n" // swap R, B 795 "vswp.u8 d1, d3 \n" // swap R, B
796 MEMACCESS(1) 796 MEMACCESS(1)
797 "vst4.8 {d1, d2, d3, d4}, [%1]! \n" // store 8 pixels of ARGB. 797 "vst4.8 {d1, d2, d3, d4}, [%1]! \n" // store 8 pixels of ARGB.
798 "bgt 1b \n" 798 "bgt 1b \n"
799 : "+r"(src_raw), // %0 799 : "+r"(src_raw), // %0
800 "+r"(dst_argb), // %1 800 "+r"(dst_argb), // %1
801 "+r"(width) // %2 801 "+r"(width) // %2
802 : 802 :
803 : "cc", "memory", "d1", "d2", "d3", "d4" // Clobber List 803 : "cc", "memory", "d1", "d2", "d3", "d4" // Clobber List
804 ); 804 );
805 } 805 }
806 806
807 void RAWToRGB24Row_NEON(const uint8* src_raw, uint8* dst_rgb24, int width) {
808 asm volatile (
809 "1: \n"
810 MEMACCESS(0)
811 "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW.
812 "subs %2, %2, #8 \n" // 8 processed per loop.
813 "vswp.u8 d1, d3 \n" // swap R, B
814 MEMACCESS(1)
815 "vst3.8 {d1, d2, d3}, [%1]! \n" // store 8 pixels of RGB24.
816 "bgt 1b \n"
817 : "+r"(src_raw), // %0
818 "+r"(dst_rgb24), // %1
819 "+r"(width) // %2
820 :
821 : "cc", "memory", "d1", "d2", "d3" // Clobber List
822 );
823 }
824
807 #define RGB565TOARGB \ 825 #define RGB565TOARGB \
808 "vshrn.u16 d6, q0, #5 \n" /* G xxGGGGGG */ \ 826 "vshrn.u16 d6, q0, #5 \n" /* G xxGGGGGG */ \
809 "vuzp.u8 d0, d1 \n" /* d0 xxxBBBBB RRRRRxxx */ \ 827 "vuzp.u8 d0, d1 \n" /* d0 xxxBBBBB RRRRRxxx */ \
810 "vshl.u8 d6, d6, #2 \n" /* G GGGGGG00 upper 6 */ \ 828 "vshl.u8 d6, d6, #2 \n" /* G GGGGGG00 upper 6 */ \
811 "vshr.u8 d1, d1, #3 \n" /* R 000RRRRR lower 5 */ \ 829 "vshr.u8 d1, d1, #3 \n" /* R 000RRRRR lower 5 */ \
812 "vshl.u8 q0, q0, #3 \n" /* B,R BBBBB000 upper 5 */ \ 830 "vshl.u8 q0, q0, #3 \n" /* B,R BBBBB000 upper 5 */ \
813 "vshr.u8 q2, q0, #5 \n" /* B,R 00000BBB lower 3 */ \ 831 "vshr.u8 q2, q0, #5 \n" /* B,R 00000BBB lower 3 */ \
814 "vorr.u8 d0, d0, d4 \n" /* B */ \ 832 "vorr.u8 d0, d0, d4 \n" /* B */ \
815 "vshr.u8 d4, d6, #6 \n" /* G 000000GG lower 2 */ \ 833 "vshr.u8 d4, d6, #6 \n" /* G 000000GG lower 2 */ \
816 "vorr.u8 d2, d1, d5 \n" /* R */ \ 834 "vorr.u8 d2, d1, d5 \n" /* R */ \
(...skipping 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2859 "r"(6) // %5 2877 "r"(6) // %5
2860 : "cc", "memory", "q0", "q1" // Clobber List 2878 : "cc", "memory", "q0", "q1" // Clobber List
2861 ); 2879 );
2862 } 2880 }
2863 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) 2881 #endif // defined(__ARM_NEON__) && !defined(__aarch64__)
2864 2882
2865 #ifdef __cplusplus 2883 #ifdef __cplusplus
2866 } // extern "C" 2884 } // extern "C"
2867 } // namespace libyuv 2885 } // namespace libyuv
2868 #endif 2886 #endif
OLDNEW
« no previous file with comments | « source/row_gcc.cc ('k') | source/row_neon64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698