blob: 58775e8547dc185d3b80742df0af27cad3502142 [file] [log] [blame]
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +00001;
2; jdcolmmx.asm - colorspace conversion (MMX)
3;
Pierre Ossman5eb84ff2009-03-09 13:25:30 +00004; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
DRCf25c0712009-04-03 12:00:51 +00005; Copyright 2009 D. R. Commander
Pierre Ossman5eb84ff2009-03-09 13:25:30 +00006;
7; Based on
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +00008; 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;
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +000018; [TAB8]
19
Pierre Ossman3a65ef42009-03-16 13:34:18 +000020%include "jsimdext.inc"
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +000021
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_mmx)
39
40EXTN(jconst_ycc_rgb_convert_mmx):
41
42PW_F0402 times 4 dw F_0_402
43PW_MF0228 times 4 dw -F_0_228
44PW_MF0344_F0285 times 2 dw -F_0_344, F_0_285
45PW_ONE times 4 dw 1
46PD_ONEHALF times 2 dd 1 << (SCALEBITS-1)
47
48 alignz 16
49
50; --------------------------------------------------------------------------
DRCf25c0712009-04-03 12:00:51 +000051%include "jdclrmmx.asm"
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +000052
DRCf25c0712009-04-03 12:00:51 +000053%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_mmx jsimd_ycc_extrgb_convert_mmx
62%include "jdclrmmx.asm"
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +000063
DRCf25c0712009-04-03 12:00:51 +000064%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_mmx jsimd_ycc_extrgbx_convert_mmx
73%include "jdclrmmx.asm"
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +000074
DRCf25c0712009-04-03 12:00:51 +000075%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_mmx jsimd_ycc_extbgr_convert_mmx
84%include "jdclrmmx.asm"
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +000085
DRCf25c0712009-04-03 12:00:51 +000086%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_mmx jsimd_ycc_extbgrx_convert_mmx
95%include "jdclrmmx.asm"
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +000096
DRCf25c0712009-04-03 12:00:51 +000097%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_mmx jsimd_ycc_extxbgr_convert_mmx
106%include "jdclrmmx.asm"
MIYASAKA Masarua2e6a9d2006-02-04 00:00:00 +0000107
DRCf25c0712009-04-03 12:00:51 +0000108%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_mmx jsimd_ycc_extxrgb_convert_mmx
117%include "jdclrmmx.asm"