blob: 2e97d5930838c7bedc851004fbd7ee581c792847 [file] [log] [blame]
DRC246c3d92009-06-25 20:38:31 +00001;
DRC243447d2010-04-23 15:49:46 +00002; jdcolss2-64.asm - colorspace conversion (64-bit SSE2)
DRC246c3d92009-06-25 20:38:31 +00003;
4; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
5; Copyright 2009 D. R. Commander
6;
7; Based on
8; x86 SIMD extension for IJG JPEG library
9; Copyright (C) 1999-2006, MIYASAKA Masaru.
10; For conditions of distribution and use, see copyright notice in jsimdext.inc
11;
12; This file should be assembled with NASM (Netwide Assembler),
13; can *not* be assembled with Microsoft's MASM or any compatible
14; assembler (including Borland's Turbo Assembler).
15; NASM is available from http://nasm.sourceforge.net/ or
16; http://sourceforge.net/project/showfiles.php?group_id=6208
17;
18; [TAB8]
19
20%include "jsimdext.inc"
21
22; --------------------------------------------------------------------------
23
24%define SCALEBITS 16
25
26F_0_344 equ 22554 ; FIX(0.34414)
27F_0_714 equ 46802 ; FIX(0.71414)
28F_1_402 equ 91881 ; FIX(1.40200)
29F_1_772 equ 116130 ; FIX(1.77200)
30F_0_402 equ (F_1_402 - 65536) ; FIX(1.40200) - FIX(1)
31F_0_285 equ ( 65536 - F_0_714) ; FIX(1) - FIX(0.71414)
32F_0_228 equ (131072 - F_1_772) ; FIX(2) - FIX(1.77200)
33
34; --------------------------------------------------------------------------
35 SECTION SEG_CONST
36
37 alignz 16
38 global EXTN(jconst_ycc_rgb_convert_sse2)
39
40EXTN(jconst_ycc_rgb_convert_sse2):
41
42PW_F0402 times 8 dw F_0_402
43PW_MF0228 times 8 dw -F_0_228
44PW_MF0344_F0285 times 4 dw -F_0_344, F_0_285
45PW_ONE times 8 dw 1
46PD_ONEHALF times 4 dd 1 << (SCALEBITS-1)
47
48 alignz 16
49
50; --------------------------------------------------------------------------
51%include "jdclrss2-64.asm"
52
53%undef RGB_RED
54%undef RGB_GREEN
55%undef RGB_BLUE
56%undef RGB_PIXELSIZE
57%define RGB_RED 0
58%define RGB_GREEN 1
59%define RGB_BLUE 2
60%define RGB_PIXELSIZE 3
61%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgb_convert_sse2
62%include "jdclrss2-64.asm"
63
64%undef RGB_RED
65%undef RGB_GREEN
66%undef RGB_BLUE
67%undef RGB_PIXELSIZE
68%define RGB_RED 0
69%define RGB_GREEN 1
70%define RGB_BLUE 2
71%define RGB_PIXELSIZE 4
72%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgbx_convert_sse2
73%include "jdclrss2-64.asm"
74
75%undef RGB_RED
76%undef RGB_GREEN
77%undef RGB_BLUE
78%undef RGB_PIXELSIZE
79%define RGB_RED 2
80%define RGB_GREEN 1
81%define RGB_BLUE 0
82%define RGB_PIXELSIZE 3
83%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgr_convert_sse2
84%include "jdclrss2-64.asm"
85
86%undef RGB_RED
87%undef RGB_GREEN
88%undef RGB_BLUE
89%undef RGB_PIXELSIZE
90%define RGB_RED 2
91%define RGB_GREEN 1
92%define RGB_BLUE 0
93%define RGB_PIXELSIZE 4
94%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgrx_convert_sse2
95%include "jdclrss2-64.asm"
96
97%undef RGB_RED
98%undef RGB_GREEN
99%undef RGB_BLUE
100%undef RGB_PIXELSIZE
101%define RGB_RED 3
102%define RGB_GREEN 2
103%define RGB_BLUE 1
104%define RGB_PIXELSIZE 4
105%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxbgr_convert_sse2
106%include "jdclrss2-64.asm"
107
108%undef RGB_RED
109%undef RGB_GREEN
110%undef RGB_BLUE
111%undef RGB_PIXELSIZE
112%define RGB_RED 1
113%define RGB_GREEN 2
114%define RGB_BLUE 3
115%define RGB_PIXELSIZE 4
116%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxrgb_convert_sse2
117%include "jdclrss2-64.asm"