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

Side by Side Diff: media/base/simd/yuv_row.asm

Issue 7003082: Implements RGB to YV12 conversion in YASM. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
OLDNEW
(Empty)
1 ; Copyright (c) 2011 The Chromium Authors. All rights reserved.
Alpha Left Google 2011/08/22 14:16:59 Rename this to media/base/yuv_row_sse2.asm
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 "yuv_row.inc"
6
7 ;
8 ; The numer of fractional bits used for fixed-point calculation.
9 ;
10 %define SHIFT_BITS 12
11 %define FIX(n) (n >> (12 - SHIFT_BITS))
12
13 ;
14 ; Tables used for RGB-to-YV12 conversion and YV12-to-RGB conversion. These
15 ; tables represent the conversion matrices used for the conversions as listed in
16 ; following C++ snippet. Unfortunately, we need to use precalculated constants
17 ; here since the yasm preprocessor cannot handle complicated floating-point
18 ; calculation.
19 ;
20 ; #define FIX(n) ((n) * (1 << SHIFT_BITS) + 0.5)
21 ;
22 ; int16 SIMD_ConvertRGBAToYUV_kTable[8 * 3] = {
23 ; FIX(0.098), FIX(0.504), FIX(0.257), 0,
24 ; FIX(0.098), FIX(0.504), FIX(0.257), 0,
25 ; FIX(0.5), 0, FIX(0.5), 0,
26 ; FIX(0.5), 0, FIX(0.5), 0,
27 ; FIX(0.439), -FIX(0.291), -FIX(0.148), 0,
28 ; -FIX(0.071), -FIX(0.368), FIX(0.439), 0,
29 ; };
30 ;
31 ; int16 SIMD_ConvertYUVtoRGBA_kTable[8 * 2] = {
32 ; -16, -128, -128, FIX(0.5),
33 ; FIX(1.164), 0, FIX(1.596), 1,
34 ; FIX(1.164), -FIX(0.391), -FIX(0.813), 1,
35 ; FIX(1.164), FIX(2.018), 0, 1,
36 ; };
37 ;
38 SECTION SEG_CONST
39
40 SIMD_ConvertARGBToYUVRow_kTable:
Alpha Left Google 2011/08/22 14:16:59 SSE2_XXX, there may be a different NEON version.
41 dw FIX(401), FIX(2064), FIX(1053), 0
42 dw FIX(401), FIX(2064), FIX(1053), 0
43 dw FIX(2048), 0, FIX(2048), 0
44 dw FIX(2048), 0, FIX(2048), 0
45 dw FIX(1798), FIX(-1191), FIX(-605), 0
46 dw FIX(-290), FIX(-1506), FIX(1798), 0
47
48 SIMD_ConvertYUVtoARGB_kTable:
Alpha Left Google 2011/08/22 14:16:59 SSE2_XXX, there may be a different NEON version.
49 dw -16, -128, -128, FIX(2048)
50 dw FIX(4768), FIX(0), FIX(6537), 1
51 dw FIX(4768), FIX(-1601), FIX(-3329), 1
52 dw FIX(4768), FIX(8266), FIX(0), 1
53
54 SECTION SEG_TEXT
55 CPU PENTIUM4
56 ;
57 ; void media::simd::ConvertARGBToYUVRow(const uint8* rgba,
58 ; uint8* y,
59 ; uint8* u,
60 ; uint8* v,
61 ; int width);
62 ;
63 %ifdef MACHO
64 %define SYMBOL_NAME __ZN5media4simd19ConvertARGBtoYUVRowEPKhPhS3_S3_i
65 %elifdef ELF
66 %define SYMBOL_NAME _ZN5media4simd19ConvertARGBtoYUVRowEPKhPhS3_S3_i
67 %elifdef MSVC
68 %define SYMBOL_NAME ?ConvertARGBtoYUVRow@simd@media@@YAXPBEPAE11H@Z
69 %endif
70
71 %define PIXELSIZE 4
72 %include "yuv_row_rgb.inc"
73
74 ;
75 ; void media::simd::ConvertRGBToYUVRow(const uint8* rgba,
76 ; uint8* y,
77 ; uint8* u,
78 ; uint8* v,
79 ; int width);
80 ;
81 %ifdef MACHO
82 %define SYMBOL_NAME __ZN5media4simd18ConvertRGBtoYUVRowEPKhPhS3_S3_i
83 %elifdef ELF
84 %define SYMBOL_NAME _ZN5media4simd18ConvertRGBtoYUVRowEPKhPhS3_S3_i
85 %elifdef MSVC
86 %define SYMBOL_NAME ?ConvertRGBtoYUVRow@simd@media@@YAXPBEPAE11H@Z
87 %endif
88
89 %define PIXELSIZE 3
90 %include "yuv_row_rgb.inc"
91
92 ;
93 ; void media::simd::ConvertYUVtoRGBARow(const uint8* y,
94 ; const uint8* u,
95 ; const uint8* v,
96 ; const uint8* rgba,
97 ; int width);
98 ;
99 %ifdef MACHO
100 %define SYMBOL_NAME __ZN5media4simd19ConvertYUVtoARGBRowEPKhS2_S2_Phi
101 %elifdef ELF
102 %define SYMBOL_NAME _ZN5media4simd19ConvertYUVtoARGBRowEPKhS2_S2_Phi
103 %elifdef MSVC
104 %define SYMBOL_NAME ?ConvertYUVtoARGBRow@simd@media@@YAXPBE00PAEH@Z
105 %endif
106
107 %define PIXELSIZE 4
108 %define ALPHA 255
109 %include "yuv_row_yuv.inc"
110
111 ;
112 ; void media::simd::ConvertYUVtoRGBRow(const uint8* y,
113 ; const uint8* u,
114 ; const uint8* v,
115 ; const uint8* rgb,
116 ; int width);
117 ;
118 %ifdef MACHO
119 %define SYMBOL_NAME __ZN5media4simd18ConvertYUVtoRGBRowEPKhS2_S2_Phi
120 %elifdef ELF
121 %define SYMBOL_NAME _ZN5media4simd18ConvertYUVtoRGBRowEPKhS2_S2_Phi
122 %elifdef MSVC
123 %define SYMBOL_NAME ?ConvertYUVtoRGBRow@simd@media@@YAXPBE00PAEH@Z
124 %endif
125
126 %define PIXELSIZE 3
127 %define ALPHA 0
128 %include "yuv_row_yuv.inc"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698