OLD | NEW |
(Empty) | |
| 1 ; |
| 2 ; jdcolss2.asm - colorspace conversion (SSE2) |
| 3 ; |
| 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 |
| 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_sse2) |
| 39 |
| 40 EXTN(jconst_ycc_rgb_convert_sse2): |
| 41 |
| 42 PW_F0402 times 8 dw F_0_402 |
| 43 PW_MF0228 times 8 dw -F_0_228 |
| 44 PW_MF0344_F0285 times 4 dw -F_0_344, F_0_285 |
| 45 PW_ONE times 8 dw 1 |
| 46 PD_ONEHALF times 4 dd 1 << (SCALEBITS-1) |
| 47 |
| 48 alignz 16 |
| 49 |
| 50 ; -------------------------------------------------------------------------- |
| 51 %include "jdclrss2.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.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.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.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.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.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.asm" |
OLD | NEW |