MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 1 | ; |
| 2 | ; jdcolmmx.asm - colorspace conversion (MMX) |
| 3 | ; |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 4 | ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 5 | ; Copyright 2009 D. R. Commander |
Pierre Ossman | 5eb84ff | 2009-03-09 13:25:30 +0000 | [diff] [blame] | 6 | ; |
| 7 | ; Based on |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 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 | ; |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 18 | ; [TAB8] |
| 19 | |
Pierre Ossman | 3a65ef4 | 2009-03-16 13:34:18 +0000 | [diff] [blame] | 20 | %include "jsimdext.inc" |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 21 | |
| 22 | ; -------------------------------------------------------------------------- |
| 23 | |
| 24 | %define SCALEBITS 16 |
| 25 | |
| 26 | F_0_344 equ 22554 ; FIX(0.34414) |
| 27 | F_0_714 equ 46802 ; FIX(0.71414) |
| 28 | F_1_402 equ 91881 ; FIX(1.40200) |
| 29 | F_1_772 equ 116130 ; FIX(1.77200) |
| 30 | F_0_402 equ (F_1_402 - 65536) ; FIX(1.40200) - FIX(1) |
| 31 | F_0_285 equ ( 65536 - F_0_714) ; FIX(1) - FIX(0.71414) |
| 32 | F_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 | |
| 40 | EXTN(jconst_ycc_rgb_convert_mmx): |
| 41 | |
| 42 | PW_F0402 times 4 dw F_0_402 |
| 43 | PW_MF0228 times 4 dw -F_0_228 |
| 44 | PW_MF0344_F0285 times 2 dw -F_0_344, F_0_285 |
| 45 | PW_ONE times 4 dw 1 |
| 46 | PD_ONEHALF times 2 dd 1 << (SCALEBITS-1) |
| 47 | |
| 48 | alignz 16 |
| 49 | |
| 50 | ; -------------------------------------------------------------------------- |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 51 | %include "jdclrmmx.asm" |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 52 | |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 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_mmx jsimd_ycc_extrgb_convert_mmx |
| 62 | %include "jdclrmmx.asm" |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 63 | |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 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_mmx jsimd_ycc_extrgbx_convert_mmx |
| 73 | %include "jdclrmmx.asm" |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 74 | |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 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_mmx jsimd_ycc_extbgr_convert_mmx |
| 84 | %include "jdclrmmx.asm" |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 85 | |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 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_mmx jsimd_ycc_extbgrx_convert_mmx |
| 95 | %include "jdclrmmx.asm" |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 96 | |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 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_mmx jsimd_ycc_extxbgr_convert_mmx |
| 106 | %include "jdclrmmx.asm" |
MIYASAKA Masaru | a2e6a9d | 2006-02-04 00:00:00 +0000 | [diff] [blame] | 107 | |
DRC | f25c071 | 2009-04-03 12:00:51 +0000 | [diff] [blame] | 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_mmx jsimd_ycc_extxrgb_convert_mmx |
| 117 | %include "jdclrmmx.asm" |