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

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

Issue 2694113002: Delete media/base/yuv_convert and dependents. Prefer libyuv. (Closed)
Patch Set: Fix media_unittests. Created 3 years, 10 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
« 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 %include "media/base/simd/media_export.asm"
6
7 EXPORT SYMBOL
8 align function_align
9
10 mangle(SYMBOL):
11 %assign stack_offset 0
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 ; 7. Lookup table address
21
22 PROLOGUE 7, 7, 3, Y, U, V, ARGB, R1, R2, TEMP
23
24 %ifdef ARCH_X86_64
25 %define WORD_SIZE QWORD
26 %else
27 %define WORD_SIZE DWORD
28 %endif
29
30 PUSH R1q ; Width
31 PUSH R2q ; Source dx
32
33 %define SOURCE_DX WORD_SIZE [rsp]
34
35 mov R1q, TEMPq
36
37 %define WIDTH WORD_SIZE [rsp + gprsize]
38 %define TABLE R1q
39 %define Xq R2q
40
41 ; Set Xq index to 0.
42 xor Xq, Xq
43 jmp .scaleend
44
45 .scaleloop:
46 mov TEMPq, Xq
47 sar TEMPq, 17
48 movzx TEMPd, BYTE [Uq + TEMPq]
49 movq mm0, [TABLE + 2048 + 8 * TEMPq]
50 mov TEMPq, Xq
51 sar TEMPq, 17
52 movzx TEMPd, BYTE [Vq + TEMPq]
53 paddsw mm0, [TABLE + 4096 + 8 * TEMPq]
54 mov TEMPq, Xq
55 add Xq, SOURCE_DX
56 sar TEMPq, 16
57 movzx TEMPd, BYTE [Yq + TEMPq]
58 movq mm1, [TABLE + 8 * TEMPq]
59 mov TEMPq, Xq
60 add Xq, SOURCE_DX
61 sar TEMPq, 16
62 movzx TEMPd, BYTE [Yq + TEMPq]
63 movq mm2, [TABLE + 8 * TEMPq]
64 paddsw mm1, mm0
65 paddsw mm2, mm0
66 psraw mm1, 6
67 psraw mm2, 6
68 packuswb mm1, mm2
69 MOVQ QWORD [ARGBq], mm1
70 add ARGBq, 8
71
72 .scaleend:
73 sub WIDTH, 2
74 jns .scaleloop
75
76 and WIDTH, 1 ; odd number of pixels?
77 jz .scaledone
78
79 mov TEMPq, Xq
80 sar TEMPq, 17
81 movzx TEMPd, BYTE [Uq + TEMPq]
82 movq mm0, [TABLE + 2048 + 8 * TEMPq]
83 mov TEMPq, Xq
84 sar TEMPq, 17
85 movzx TEMPd, BYTE [Vq + TEMPq]
86 paddsw mm0, [TABLE + 4096 + 8 * TEMPq]
87 mov TEMPq, Xq
88 sar TEMPq, 16
89 movzx TEMPd, BYTE [Yq + TEMPq]
90 movq mm1, [TABLE + 8 * TEMPq]
91 paddsw mm1, mm0
92 psraw mm1, 6
93 packuswb mm1, mm1
94 movd DWORD [ARGBq], mm1
95
96 .scaledone:
97 ADD rsp, 2 * gprsize
98 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