| 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 | 6 |
| 7 EXPORT SYMBOL | 7 EXPORT SYMBOL |
| 8 align function_align | 8 align function_align |
| 9 | 9 |
| 10 mangle(SYMBOL): | 10 mangle(SYMBOL): |
| 11 %assign stack_offset 0 | 11 %assign stack_offset 0 |
| 12 | 12 |
| 13 extern mangle(kCoefficientsRgbY) | 13 extern mangle(kCoefficientsRgbY) |
| 14 | 14 |
| 15 ; Parameters are in the following order: | 15 ; Parameters are in the following order: |
| 16 ; 1. Y plane | 16 ; 1. Y plane |
| 17 ; 2. U plane | 17 ; 2. U plane |
| 18 ; 3. V plane | 18 ; 3. V plane |
| 19 ; 4. ARGB frame | 19 ; 4. ARGB frame |
| 20 ; 5. Width | 20 ; 5. Width |
| 21 ; 6. Source dx | 21 ; 6. Source dx |
| 22 ; 7. Lookup table address |
| 22 | 23 |
| 23 PROLOGUE 6, 7, 3, Y, U, V, ARGB, R1, R2, TEMP | 24 PROLOGUE 7, 7, 3, Y, U, V, ARGB, R1, R2, TEMP |
| 24 | 25 |
| 25 %ifdef ARCH_X86_64 | 26 %ifdef ARCH_X86_64 |
| 26 %define WORD_SIZE QWORD | 27 %define WORD_SIZE QWORD |
| 27 %else | 28 %else |
| 28 %define WORD_SIZE DWORD | 29 %define WORD_SIZE DWORD |
| 29 %endif | 30 %endif |
| 30 | 31 |
| 31 PUSH R1q ; Width | 32 PUSH R1q ; Width |
| 32 PUSH R2q ; Source dx | 33 PUSH R2q ; Source dx |
| 33 | 34 |
| 34 %define SOURCE_DX WORD_SIZE [rsp] | 35 %define SOURCE_DX WORD_SIZE [rsp] |
| 35 | 36 |
| 36 LOAD_SYM R1q, mangle(kCoefficientsRgbY) | 37 mov R1q, TEMPq |
| 38 |
| 37 %define WIDTH WORD_SIZE [rsp + gprsize] | 39 %define WIDTH WORD_SIZE [rsp + gprsize] |
| 38 %define TABLE R1q | 40 %define TABLE R1q |
| 39 %define Xq R2q | 41 %define Xq R2q |
| 40 | 42 |
| 41 ; Set Xq index to 0. | 43 ; Set Xq index to 0. |
| 42 xor Xq, Xq | 44 xor Xq, Xq |
| 43 jmp .scaleend | 45 jmp .scaleend |
| 44 | 46 |
| 45 .scaleloop: | 47 .scaleloop: |
| 46 mov TEMPq, Xq | 48 mov TEMPq, Xq |
| 47 sar TEMPq, 17 | 49 sar TEMPq, 17 |
| 48 movzx TEMPd, BYTE [Uq + TEMPq] | 50 movzx TEMPd, BYTE [Uq + TEMPq] |
| 49 movq mm0, [TABLE + 2048 + 8 * TEMPq] | 51 movq mm0, [TABLE + 2048 + 8 * TEMPq] |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 movzx TEMPd, BYTE [Yq + TEMPq] | 91 movzx TEMPd, BYTE [Yq + TEMPq] |
| 90 movq mm1, [TABLE + 8 * TEMPq] | 92 movq mm1, [TABLE + 8 * TEMPq] |
| 91 paddsw mm1, mm0 | 93 paddsw mm1, mm0 |
| 92 psraw mm1, 6 | 94 psraw mm1, 6 |
| 93 packuswb mm1, mm1 | 95 packuswb mm1, mm1 |
| 94 movd DWORD [ARGBq], mm1 | 96 movd DWORD [ARGBq], mm1 |
| 95 | 97 |
| 96 .scaledone: | 98 .scaledone: |
| 97 ADD rsp, 2 * gprsize | 99 ADD rsp, 2 * gprsize |
| 98 RET | 100 RET |
| OLD | NEW |