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 |
35 | 36 |
36 PROLOGUE 6, 7, 3, Y, U, V, ARGB, WIDTH, SOURCE_DX, COMP | 37 PROLOGUE 7, 7, 3, Y, U, V, ARGB, WIDTH, SOURCE_DX, R1 |
37 | 38 |
38 %define TABLEq r10 | 39 %define TABLEq r10 |
39 %define Xq r11 | 40 %define Xq r11 |
40 %define INDEXq r12 | 41 %define INDEXq r12 |
| 42 %define COMPq R1q |
| 43 %define COMPd R1d |
| 44 |
41 PUSH r10 | 45 PUSH r10 |
42 PUSH r11 | 46 PUSH r11 |
43 PUSH r12 | 47 PUSH r12 |
44 | 48 |
45 LOAD_SYM TABLEq, mangle(kCoefficientsRgbY) | 49 mov TABLEq, R1q |
46 | 50 |
47 ; Set Xq index to 0. | 51 ; Set Xq index to 0. |
48 xor Xq, Xq | 52 xor Xq, Xq |
49 jmp .scaleend | 53 jmp .scaleend |
50 | 54 |
51 .scaleloop: | 55 .scaleloop: |
52 ; Read UV pixels. | 56 ; Read UV pixels. |
53 mov INDEXq, Xq | 57 mov INDEXq, Xq |
54 sar INDEXq, 17 | 58 sar INDEXq, 17 |
55 movzx COMPd, BYTE [Uq + INDEXq] | 59 movzx COMPd, BYTE [Uq + INDEXq] |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 paddsw xmm1, xmm0 | 105 paddsw xmm1, xmm0 |
102 psraw xmm1, 6 | 106 psraw xmm1, 6 |
103 packuswb xmm1, xmm1 | 107 packuswb xmm1, xmm1 |
104 movd DWORD [ARGBq], xmm1 | 108 movd DWORD [ARGBq], xmm1 |
105 | 109 |
106 .scaledone: | 110 .scaledone: |
107 POP r12 | 111 POP r12 |
108 POP r11 | 112 POP r11 |
109 POP r10 | 113 POP r10 |
110 RET | 114 RET |
OLD | NEW |