OLD | NEW |
1 ; Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 ; Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 ; Use of this source code is governed by a BSD-style license that can be | 2 ; Use of this source code is governed by a BSD-style license that can be |
3 ; found in the LICENSE file. | 3 ; found in the LICENSE file. |
4 | 4 |
5 %include "media/base/simd/media_export.asm" | 5 %include "media/base/simd/media_export.asm" |
6 %include "third_party/x86inc/x86inc.asm" | 6 %include "third_party/x86inc/x86inc.asm" |
7 | 7 |
8 ; | 8 ; |
9 ; This file uses MMX, SSE2 and instructions. | 9 ; This file uses MMX, SSE2 and instructions. |
10 ; | 10 ; |
(...skipping 14 matching lines...) Expand all Loading... |
25 %assign stack_offset 0 | 25 %assign stack_offset 0 |
26 extern mangle(kCoefficientsRgbY) | 26 extern mangle(kCoefficientsRgbY) |
27 | 27 |
28 ; Parameters are in the following order: | 28 ; Parameters are in the following order: |
29 ; 1. Y plane | 29 ; 1. Y plane |
30 ; 2. U plane | 30 ; 2. U plane |
31 ; 3. V plane | 31 ; 3. V plane |
32 ; 4. ARGB frame | 32 ; 4. ARGB frame |
33 ; 5. Width | 33 ; 5. Width |
34 ; 6. Source dx | 34 ; 6. Source dx |
35 ; 7. Convert table | |
36 | 35 |
37 PROLOGUE 7, 7, 3, Y, U, V, ARGB, WIDTH, SOURCE_DX, R1 | 36 PROLOGUE 6, 7, 3, Y, U, V, ARGB, WIDTH, SOURCE_DX, COMP |
38 | 37 |
39 %define TABLEq r10 | 38 %define TABLEq r10 |
40 %define Xq r11 | 39 %define Xq r11 |
41 %define INDEXq r12 | 40 %define INDEXq r12 |
42 %define COMPq R1q | |
43 %define COMPd R1d | |
44 | |
45 PUSH r10 | 41 PUSH r10 |
46 PUSH r11 | 42 PUSH r11 |
47 PUSH r12 | 43 PUSH r12 |
48 | 44 |
49 mov TABLEq, R1q | 45 LOAD_SYM TABLEq, mangle(kCoefficientsRgbY) |
50 | 46 |
51 ; Set Xq index to 0. | 47 ; Set Xq index to 0. |
52 xor Xq, Xq | 48 xor Xq, Xq |
53 jmp .scaleend | 49 jmp .scaleend |
54 | 50 |
55 .scaleloop: | 51 .scaleloop: |
56 ; Read UV pixels. | 52 ; Read UV pixels. |
57 mov INDEXq, Xq | 53 mov INDEXq, Xq |
58 sar INDEXq, 17 | 54 sar INDEXq, 17 |
59 movzx COMPd, BYTE [Uq + INDEXq] | 55 movzx COMPd, BYTE [Uq + INDEXq] |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 paddsw xmm1, xmm0 | 101 paddsw xmm1, xmm0 |
106 psraw xmm1, 6 | 102 psraw xmm1, 6 |
107 packuswb xmm1, xmm1 | 103 packuswb xmm1, xmm1 |
108 movd DWORD [ARGBq], xmm1 | 104 movd DWORD [ARGBq], xmm1 |
109 | 105 |
110 .scaledone: | 106 .scaledone: |
111 POP r12 | 107 POP r12 |
112 POP r11 | 108 POP r11 |
113 POP r10 | 109 POP r10 |
114 RET | 110 RET |
OLD | NEW |