jccolor-avx2.asm (3518B)
1 ; 2 ; jccolor.asm - colorspace conversion (64-bit AVX2) 3 ; 4 ; Copyright (C) 2009, 2016, 2024, D. R. Commander. 5 ; Copyright (C) 2015, Intel Corporation. 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_081 equ 5329 ; FIX(0.08131) 20 F_0_114 equ 7471 ; FIX(0.11400) 21 F_0_168 equ 11059 ; FIX(0.16874) 22 F_0_250 equ 16384 ; FIX(0.25000) 23 F_0_299 equ 19595 ; FIX(0.29900) 24 F_0_331 equ 21709 ; FIX(0.33126) 25 F_0_418 equ 27439 ; FIX(0.41869) 26 F_0_587 equ 38470 ; FIX(0.58700) 27 F_0_337 equ (F_0_587 - F_0_250) ; FIX(0.58700) - FIX(0.25000) 28 29 ; -------------------------------------------------------------------------- 30 SECTION SEG_CONST 31 32 ALIGNZ 32 33 GLOBAL_DATA(jconst_rgb_ycc_convert_avx2) 34 35 EXTN(jconst_rgb_ycc_convert_avx2): 36 37 PW_F0299_F0337 times 8 dw F_0_299, F_0_337 38 PW_F0114_F0250 times 8 dw F_0_114, F_0_250 39 PW_MF016_MF033 times 8 dw -F_0_168, -F_0_331 40 PW_MF008_MF041 times 8 dw -F_0_081, -F_0_418 41 PD_ONEHALFM1_CJ times 8 dd (1 << (SCALEBITS - 1)) - 1 + \ 42 (CENTERJSAMPLE << SCALEBITS) 43 PD_ONEHALF times 8 dd (1 << (SCALEBITS - 1)) 44 45 ALIGNZ 32 46 47 ; -------------------------------------------------------------------------- 48 SECTION SEG_TEXT 49 BITS 64 50 51 %include "jccolext-avx2.asm" 52 53 %undef RGB_RED 54 %undef RGB_GREEN 55 %undef RGB_BLUE 56 %undef RGB_PIXELSIZE 57 %define RGB_RED EXT_RGB_RED 58 %define RGB_GREEN EXT_RGB_GREEN 59 %define RGB_BLUE EXT_RGB_BLUE 60 %define RGB_PIXELSIZE EXT_RGB_PIXELSIZE 61 %define jsimd_rgb_ycc_convert_avx2 jsimd_extrgb_ycc_convert_avx2 62 %include "jccolext-avx2.asm" 63 64 %undef RGB_RED 65 %undef RGB_GREEN 66 %undef RGB_BLUE 67 %undef RGB_PIXELSIZE 68 %define RGB_RED EXT_RGBX_RED 69 %define RGB_GREEN EXT_RGBX_GREEN 70 %define RGB_BLUE EXT_RGBX_BLUE 71 %define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE 72 %define jsimd_rgb_ycc_convert_avx2 jsimd_extrgbx_ycc_convert_avx2 73 %include "jccolext-avx2.asm" 74 75 %undef RGB_RED 76 %undef RGB_GREEN 77 %undef RGB_BLUE 78 %undef RGB_PIXELSIZE 79 %define RGB_RED EXT_BGR_RED 80 %define RGB_GREEN EXT_BGR_GREEN 81 %define RGB_BLUE EXT_BGR_BLUE 82 %define RGB_PIXELSIZE EXT_BGR_PIXELSIZE 83 %define jsimd_rgb_ycc_convert_avx2 jsimd_extbgr_ycc_convert_avx2 84 %include "jccolext-avx2.asm" 85 86 %undef RGB_RED 87 %undef RGB_GREEN 88 %undef RGB_BLUE 89 %undef RGB_PIXELSIZE 90 %define RGB_RED EXT_BGRX_RED 91 %define RGB_GREEN EXT_BGRX_GREEN 92 %define RGB_BLUE EXT_BGRX_BLUE 93 %define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE 94 %define jsimd_rgb_ycc_convert_avx2 jsimd_extbgrx_ycc_convert_avx2 95 %include "jccolext-avx2.asm" 96 97 %undef RGB_RED 98 %undef RGB_GREEN 99 %undef RGB_BLUE 100 %undef RGB_PIXELSIZE 101 %define RGB_RED EXT_XBGR_RED 102 %define RGB_GREEN EXT_XBGR_GREEN 103 %define RGB_BLUE EXT_XBGR_BLUE 104 %define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE 105 %define jsimd_rgb_ycc_convert_avx2 jsimd_extxbgr_ycc_convert_avx2 106 %include "jccolext-avx2.asm" 107 108 %undef RGB_RED 109 %undef RGB_GREEN 110 %undef RGB_BLUE 111 %undef RGB_PIXELSIZE 112 %define RGB_RED EXT_XRGB_RED 113 %define RGB_GREEN EXT_XRGB_GREEN 114 %define RGB_BLUE EXT_XRGB_BLUE 115 %define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE 116 %define jsimd_rgb_ycc_convert_avx2 jsimd_extxrgb_ycc_convert_avx2 117 %include "jccolext-avx2.asm"