jdcolor-mmx.asm (3266B)
1 ; 2 ; jdcolor.asm - colorspace conversion (MMX) 3 ; 4 ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB 5 ; Copyright (C) 2009, 2016, 2024, D. R. Commander. 6 ; 7 ; Based on the x86 SIMD extension for IJG JPEG library 8 ; Copyright (C) 1999-2006, MIYASAKA Masaru. 9 ; For conditions of distribution and use, see copyright notice in jsimdext.inc 10 ; 11 ; This file should be assembled with NASM (Netwide Assembler) or Yasm. 12 13 %include "jsimdext.inc" 14 15 ; -------------------------------------------------------------------------- 16 17 %define SCALEBITS 16 18 19 F_0_344 equ 22554 ; FIX(0.34414) 20 F_0_714 equ 46802 ; FIX(0.71414) 21 F_1_402 equ 91881 ; FIX(1.40200) 22 F_1_772 equ 116130 ; FIX(1.77200) 23 F_0_402 equ (F_1_402 - 65536) ; FIX(1.40200) - FIX(1) 24 F_0_285 equ ( 65536 - F_0_714) ; FIX(1) - FIX(0.71414) 25 F_0_228 equ (131072 - F_1_772) ; FIX(2) - FIX(1.77200) 26 27 ; -------------------------------------------------------------------------- 28 SECTION SEG_CONST 29 30 ALIGNZ 32 31 GLOBAL_DATA(jconst_ycc_rgb_convert_mmx) 32 33 EXTN(jconst_ycc_rgb_convert_mmx): 34 35 PW_F0402 times 4 dw F_0_402 36 PW_MF0228 times 4 dw -F_0_228 37 PW_MF0344_F0285 times 2 dw -F_0_344, F_0_285 38 PW_ONE times 4 dw 1 39 PD_ONEHALF times 2 dd 1 << (SCALEBITS - 1) 40 41 ALIGNZ 32 42 43 ; -------------------------------------------------------------------------- 44 SECTION SEG_TEXT 45 BITS 32 46 47 %include "jdcolext-mmx.asm" 48 49 %undef RGB_RED 50 %undef RGB_GREEN 51 %undef RGB_BLUE 52 %undef RGB_PIXELSIZE 53 %define RGB_RED EXT_RGB_RED 54 %define RGB_GREEN EXT_RGB_GREEN 55 %define RGB_BLUE EXT_RGB_BLUE 56 %define RGB_PIXELSIZE EXT_RGB_PIXELSIZE 57 %define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extrgb_convert_mmx 58 %include "jdcolext-mmx.asm" 59 60 %undef RGB_RED 61 %undef RGB_GREEN 62 %undef RGB_BLUE 63 %undef RGB_PIXELSIZE 64 %define RGB_RED EXT_RGBX_RED 65 %define RGB_GREEN EXT_RGBX_GREEN 66 %define RGB_BLUE EXT_RGBX_BLUE 67 %define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE 68 %define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extrgbx_convert_mmx 69 %include "jdcolext-mmx.asm" 70 71 %undef RGB_RED 72 %undef RGB_GREEN 73 %undef RGB_BLUE 74 %undef RGB_PIXELSIZE 75 %define RGB_RED EXT_BGR_RED 76 %define RGB_GREEN EXT_BGR_GREEN 77 %define RGB_BLUE EXT_BGR_BLUE 78 %define RGB_PIXELSIZE EXT_BGR_PIXELSIZE 79 %define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extbgr_convert_mmx 80 %include "jdcolext-mmx.asm" 81 82 %undef RGB_RED 83 %undef RGB_GREEN 84 %undef RGB_BLUE 85 %undef RGB_PIXELSIZE 86 %define RGB_RED EXT_BGRX_RED 87 %define RGB_GREEN EXT_BGRX_GREEN 88 %define RGB_BLUE EXT_BGRX_BLUE 89 %define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE 90 %define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extbgrx_convert_mmx 91 %include "jdcolext-mmx.asm" 92 93 %undef RGB_RED 94 %undef RGB_GREEN 95 %undef RGB_BLUE 96 %undef RGB_PIXELSIZE 97 %define RGB_RED EXT_XBGR_RED 98 %define RGB_GREEN EXT_XBGR_GREEN 99 %define RGB_BLUE EXT_XBGR_BLUE 100 %define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE 101 %define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extxbgr_convert_mmx 102 %include "jdcolext-mmx.asm" 103 104 %undef RGB_RED 105 %undef RGB_GREEN 106 %undef RGB_BLUE 107 %undef RGB_PIXELSIZE 108 %define RGB_RED EXT_XRGB_RED 109 %define RGB_GREEN EXT_XRGB_GREEN 110 %define RGB_BLUE EXT_XRGB_BLUE 111 %define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE 112 %define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extxrgb_convert_mmx 113 %include "jdcolext-mmx.asm"