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
3 ; found in the LICENSE file.
5 %include "media/base/simd/media_export.asm"
11 %assign stack_offset 0
13 extern mangle(kCoefficientsRgbY)
15 ; Parameters are in the following order:
23 PROLOGUE 6, 7, 3, Y, U, V, ARGB, R1, R2, TEMP
26 %define WORD_SIZE QWORD
28 %define WORD_SIZE DWORD
36 %define SOURCE_DX WORD_SIZE [rsp]
40 LOAD_SYM R1q, mangle(kCoefficientsRgbY)
41 %define WIDTH WORD_SIZE [rsp + gprsize]
48 %define TABLE mangle(kCoefficientsRgbY)
57 ; TABLE can either be a register or a symbol depending on this is
61 movzx TEMPd, BYTE [Uq + TEMPq]
62 movq mm0, [TABLE + 2048 + 8 * TEMPq]
65 movzx TEMPd, BYTE [Vq + TEMPq]
66 paddsw mm0, [TABLE + 4096 + 8 * TEMPq]
70 movzx TEMPd, BYTE [Yq + TEMPq]
71 movq mm1, [TABLE + 8 * TEMPq]
75 movzx TEMPd, BYTE [Yq + TEMPq]
76 movq mm2, [TABLE + 8 * TEMPq]
82 MOVQ QWORD [ARGBq], mm1
86 ; WIDTH can either be a register or memory depending on this is
91 and WIDTH, 1 ; odd number of pixels?
96 movzx TEMPd, BYTE [Uq + TEMPq]
97 movq mm0, [TABLE + 2048 + 8 * TEMPq]
100 movzx TEMPd, BYTE [Vq + TEMPq]
101 paddsw mm0, [TABLE + 4096 + 8 * TEMPq]
104 movzx TEMPd, BYTE [Yq + TEMPq]
105 movq mm1, [TABLE + 8 * TEMPq]
109 movd DWORD [ARGBq], mm1