media/libjpeg/simd/jcgrass2.asm

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 ;
michael@0 2 ; jcgrass2.asm - grayscale colorspace conversion (SSE2)
michael@0 3 ;
michael@0 4 ; x86 SIMD extension for IJG JPEG library
michael@0 5 ; Copyright (C) 1999-2006, MIYASAKA Masaru.
michael@0 6 ; Copyright (C) 2011, D. R. Commander.
michael@0 7 ; For conditions of distribution and use, see copyright notice in jsimdext.inc
michael@0 8 ;
michael@0 9 ; This file should be assembled with NASM (Netwide Assembler),
michael@0 10 ; can *not* be assembled with Microsoft's MASM or any compatible
michael@0 11 ; assembler (including Borland's Turbo Assembler).
michael@0 12 ; NASM is available from http://nasm.sourceforge.net/ or
michael@0 13 ; http://sourceforge.net/project/showfiles.php?group_id=6208
michael@0 14 ;
michael@0 15 ; [TAB8]
michael@0 16
michael@0 17 %include "jsimdext.inc"
michael@0 18
michael@0 19 ; --------------------------------------------------------------------------
michael@0 20
michael@0 21 %define SCALEBITS 16
michael@0 22
michael@0 23 F_0_114 equ 7471 ; FIX(0.11400)
michael@0 24 F_0_250 equ 16384 ; FIX(0.25000)
michael@0 25 F_0_299 equ 19595 ; FIX(0.29900)
michael@0 26 F_0_587 equ 38470 ; FIX(0.58700)
michael@0 27 F_0_337 equ (F_0_587 - F_0_250) ; FIX(0.58700) - FIX(0.25000)
michael@0 28
michael@0 29 ; --------------------------------------------------------------------------
michael@0 30 SECTION SEG_CONST
michael@0 31
michael@0 32 alignz 16
michael@0 33 global EXTN(jconst_rgb_gray_convert_sse2)
michael@0 34
michael@0 35 EXTN(jconst_rgb_gray_convert_sse2):
michael@0 36
michael@0 37 PW_F0299_F0337 times 4 dw F_0_299, F_0_337
michael@0 38 PW_F0114_F0250 times 4 dw F_0_114, F_0_250
michael@0 39 PD_ONEHALF times 4 dd (1 << (SCALEBITS-1))
michael@0 40
michael@0 41 alignz 16
michael@0 42
michael@0 43 ; --------------------------------------------------------------------------
michael@0 44 SECTION SEG_TEXT
michael@0 45 BITS 32
michael@0 46
michael@0 47 %include "jcgryss2.asm"
michael@0 48
michael@0 49 %undef RGB_RED
michael@0 50 %undef RGB_GREEN
michael@0 51 %undef RGB_BLUE
michael@0 52 %undef RGB_PIXELSIZE
michael@0 53 %define RGB_RED EXT_RGB_RED
michael@0 54 %define RGB_GREEN EXT_RGB_GREEN
michael@0 55 %define RGB_BLUE EXT_RGB_BLUE
michael@0 56 %define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
michael@0 57 %define jsimd_rgb_gray_convert_sse2 jsimd_extrgb_gray_convert_sse2
michael@0 58 %include "jcgryss2.asm"
michael@0 59
michael@0 60 %undef RGB_RED
michael@0 61 %undef RGB_GREEN
michael@0 62 %undef RGB_BLUE
michael@0 63 %undef RGB_PIXELSIZE
michael@0 64 %define RGB_RED EXT_RGBX_RED
michael@0 65 %define RGB_GREEN EXT_RGBX_GREEN
michael@0 66 %define RGB_BLUE EXT_RGBX_BLUE
michael@0 67 %define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
michael@0 68 %define jsimd_rgb_gray_convert_sse2 jsimd_extrgbx_gray_convert_sse2
michael@0 69 %include "jcgryss2.asm"
michael@0 70
michael@0 71 %undef RGB_RED
michael@0 72 %undef RGB_GREEN
michael@0 73 %undef RGB_BLUE
michael@0 74 %undef RGB_PIXELSIZE
michael@0 75 %define RGB_RED EXT_BGR_RED
michael@0 76 %define RGB_GREEN EXT_BGR_GREEN
michael@0 77 %define RGB_BLUE EXT_BGR_BLUE
michael@0 78 %define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
michael@0 79 %define jsimd_rgb_gray_convert_sse2 jsimd_extbgr_gray_convert_sse2
michael@0 80 %include "jcgryss2.asm"
michael@0 81
michael@0 82 %undef RGB_RED
michael@0 83 %undef RGB_GREEN
michael@0 84 %undef RGB_BLUE
michael@0 85 %undef RGB_PIXELSIZE
michael@0 86 %define RGB_RED EXT_BGRX_RED
michael@0 87 %define RGB_GREEN EXT_BGRX_GREEN
michael@0 88 %define RGB_BLUE EXT_BGRX_BLUE
michael@0 89 %define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
michael@0 90 %define jsimd_rgb_gray_convert_sse2 jsimd_extbgrx_gray_convert_sse2
michael@0 91 %include "jcgryss2.asm"
michael@0 92
michael@0 93 %undef RGB_RED
michael@0 94 %undef RGB_GREEN
michael@0 95 %undef RGB_BLUE
michael@0 96 %undef RGB_PIXELSIZE
michael@0 97 %define RGB_RED EXT_XBGR_RED
michael@0 98 %define RGB_GREEN EXT_XBGR_GREEN
michael@0 99 %define RGB_BLUE EXT_XBGR_BLUE
michael@0 100 %define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
michael@0 101 %define jsimd_rgb_gray_convert_sse2 jsimd_extxbgr_gray_convert_sse2
michael@0 102 %include "jcgryss2.asm"
michael@0 103
michael@0 104 %undef RGB_RED
michael@0 105 %undef RGB_GREEN
michael@0 106 %undef RGB_BLUE
michael@0 107 %undef RGB_PIXELSIZE
michael@0 108 %define RGB_RED EXT_XRGB_RED
michael@0 109 %define RGB_GREEN EXT_XRGB_GREEN
michael@0 110 %define RGB_BLUE EXT_XRGB_BLUE
michael@0 111 %define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
michael@0 112 %define jsimd_rgb_gray_convert_sse2 jsimd_extxrgb_gray_convert_sse2
michael@0 113 %include "jcgryss2.asm"

mercurial