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

Side by Side Diff: media/base/simd/scale_yuv_to_rgb_mmx.inc

Issue 7891039: Resubmit - Rewrite color space conversions suite using YASM" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « media/base/simd/scale_yuv_to_rgb_mmx.asm ('k') | media/base/simd/scale_yuv_to_rgb_sse.asm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 global mangle(SYMBOL) PRIVATE
6 align function_align
7
8 mangle(SYMBOL):
9 %assign stack_offset 0
10
11 extern mangle(kCoefficientsRgbY)
12
13 ; Parameters are in the following order:
14 ; 1. Y plane
15 ; 2. U plane
16 ; 3. V plane
17 ; 4. ARGB frame
18 ; 5. Width
19 ; 6. Source dx
20
21 PROLOGUE 6, 7, 3, Y, U, V, ARGB, R1, R2, TEMP
22
23 %ifdef ARCH_X86_64
24 %define WORD_SIZE QWORD
25 %else
26 %define WORD_SIZE DWORD
27 %endif
28
29 %ifdef PIC
30 PUSH R1q ; Width
31 %endif
32 PUSH R2q ; Source dx
33
34 %define SOURCE_DX WORD_SIZE [rsp]
35
36 ; PIC code.
37 %ifdef PIC
38 LOAD_SYM R1q, mangle(kCoefficientsRgbY)
39 %define WIDTH WORD_SIZE [rsp + gprsize]
40 %define TABLE R1q
41 %define Xq R2q
42
43 ; Non-PIC code.
44 %else
45 %define WIDTH R1q
46 %define TABLE mangle(kCoefficientsRgbY)
47 %define Xq R2q
48 %endif
49
50 ; Set Xq index to 0.
51 xor Xq, Xq
52 jmp .scaleend
53
54 .scaleloop:
55 ; TABLE can either be a register or a symbol depending on this is
56 ; PIC or not.
57 mov TEMPq, Xq
58 sar TEMPq, 17
59 movzx TEMPd, BYTE [Uq + TEMPq]
60 movq mm0, [TABLE + 2048 + 8 * TEMPq]
61 mov TEMPq, Xq
62 sar TEMPq, 17
63 movzx TEMPd, BYTE [Vq + TEMPq]
64 paddsw mm0, [TABLE + 4096 + 8 * TEMPq]
65 mov TEMPq, Xq
66 add Xq, SOURCE_DX
67 sar TEMPq, 16
68 movzx TEMPd, BYTE [Yq + TEMPq]
69 movq mm1, [TABLE + 8 * TEMPq]
70 mov TEMPq, Xq
71 add Xq, SOURCE_DX
72 sar TEMPq, 16
73 movzx TEMPd, BYTE [Yq + TEMPq]
74 movq mm2, [TABLE + 8 * TEMPq]
75 paddsw mm1, mm0
76 paddsw mm2, mm0
77 psraw mm1, 6
78 psraw mm2, 6
79 packuswb mm1, mm2
80 MOVQ QWORD [ARGBq], mm1
81 add ARGBq, 8
82
83 .scaleend:
84 ; WIDTH can either be a register or memory depending on this is
85 ; PIC or not.
86 sub WIDTH, 2
87 jns .scaleloop
88
89 and WIDTH, 1 ; odd number of pixels?
90 jz .scaledone
91
92 mov TEMPq, Xq
93 sar TEMPq, 17
94 movzx TEMPd, BYTE [Uq + TEMPq]
95 movq mm0, [TABLE + 2048 + 8 * TEMPq]
96 mov TEMPq, Xq
97 sar TEMPq, 17
98 movzx TEMPd, BYTE [Vq + TEMPq]
99 paddsw mm0, [TABLE + 4096 + 8 * TEMPq]
100 mov TEMPq, Xq
101 sar TEMPq, 16
102 movzx TEMPd, BYTE [Yq + TEMPq]
103 movq mm1, [TABLE + 8 * TEMPq]
104 paddsw mm1, mm0
105 psraw mm1, 6
106 packuswb mm1, mm1
107 movd DWORD [ARGBq], mm1
108
109 .scaledone:
110 %ifdef PIC
111 ADD rsp, 2 * gprsize
112 %else
113 ADD rsp, gprsize
114 %endif
115 RET
OLDNEW
« no previous file with comments | « media/base/simd/scale_yuv_to_rgb_mmx.asm ('k') | media/base/simd/scale_yuv_to_rgb_sse.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698