OLD | NEW |
(Empty) | |
| 1 ; |
| 2 ; jdmerss2.asm - merged upsampling/color 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_merged_upsample_sse2) |
| 39 |
| 40 EXTN(jconst_merged_upsample_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 "jdmrgss2.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_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgb_merged_upsample_sse2 |
| 62 %define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgb_merged_upsample_sse2 |
| 63 %include "jdmrgss2.asm" |
| 64 |
| 65 %undef RGB_RED |
| 66 %undef RGB_GREEN |
| 67 %undef RGB_BLUE |
| 68 %undef RGB_PIXELSIZE |
| 69 %define RGB_RED 0 |
| 70 %define RGB_GREEN 1 |
| 71 %define RGB_BLUE 2 |
| 72 %define RGB_PIXELSIZE 4 |
| 73 %define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgbx_merged_upsample_sse2 |
| 74 %define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgbx_merged_upsample_sse2 |
| 75 %include "jdmrgss2.asm" |
| 76 |
| 77 %undef RGB_RED |
| 78 %undef RGB_GREEN |
| 79 %undef RGB_BLUE |
| 80 %undef RGB_PIXELSIZE |
| 81 %define RGB_RED 2 |
| 82 %define RGB_GREEN 1 |
| 83 %define RGB_BLUE 0 |
| 84 %define RGB_PIXELSIZE 3 |
| 85 %define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgr_merged_upsample_sse2 |
| 86 %define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgr_merged_upsample_sse2 |
| 87 %include "jdmrgss2.asm" |
| 88 |
| 89 %undef RGB_RED |
| 90 %undef RGB_GREEN |
| 91 %undef RGB_BLUE |
| 92 %undef RGB_PIXELSIZE |
| 93 %define RGB_RED 2 |
| 94 %define RGB_GREEN 1 |
| 95 %define RGB_BLUE 0 |
| 96 %define RGB_PIXELSIZE 4 |
| 97 %define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgrx_merged_upsample_sse2 |
| 98 %define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgrx_merged_upsample_sse2 |
| 99 %include "jdmrgss2.asm" |
| 100 |
| 101 %undef RGB_RED |
| 102 %undef RGB_GREEN |
| 103 %undef RGB_BLUE |
| 104 %undef RGB_PIXELSIZE |
| 105 %define RGB_RED 3 |
| 106 %define RGB_GREEN 2 |
| 107 %define RGB_BLUE 1 |
| 108 %define RGB_PIXELSIZE 4 |
| 109 %define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxbgr_merged_upsample_sse2 |
| 110 %define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxbgr_merged_upsample_sse2 |
| 111 %include "jdmrgss2.asm" |
| 112 |
| 113 %undef RGB_RED |
| 114 %undef RGB_GREEN |
| 115 %undef RGB_BLUE |
| 116 %undef RGB_PIXELSIZE |
| 117 %define RGB_RED 1 |
| 118 %define RGB_GREEN 2 |
| 119 %define RGB_BLUE 3 |
| 120 %define RGB_PIXELSIZE 4 |
| 121 %define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxrgb_merged_upsample_sse2 |
| 122 %define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxrgb_merged_upsample_sse2 |
| 123 %include "jdmrgss2.asm" |
OLD | NEW |