; ; jdmrgext.asm - merged upsampling/color conversion (SSE2) ; ; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB ; Copyright (C) 2012, 2016, 2024, D. R. Commander. ; ; Based on the x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include"jcolsamp.inc"
; -------------------------------------------------------------------------- ; ; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. ; ; GLOBAL(void) ; jsimd_h2v1_merged_upsample_sse2(JDIMENSION output_width, ; JSAMPIMAGE input_buf, ; JDIMENSION in_row_group_ctr, ; JSAMPARRAY output_buf); ;
.column_st32: leaecx, [ecx+ecx*2] ; imul ecx, RGB_PIXELSIZE cmpecx, byte 2*SIZEOF_XMMWORD
jb short .column_st16
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD addedi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmF subecx, byte 2*SIZEOF_XMMWORD jmpshort .column_st15
.column_st16: cmpecx, byte SIZEOF_XMMWORD
jb short .column_st15
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA addedi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmD subecx, byte SIZEOF_XMMWORD
.column_st15: ; Store the lower 8 bytes of xmmA to the output when it has enough ; space. cmpecx, byte SIZEOF_MMWORD
jb short .column_st7
movq XMM_MMWORD [edi], xmmA addedi, byte SIZEOF_MMWORD subecx, byte SIZEOF_MMWORD
psrldq xmmA, SIZEOF_MMWORD
.column_st7: ; Store the lower 4 bytes of xmmA to the output when it has enough ; space. cmpecx, byte SIZEOF_DWORD
jb short .column_st3 movd XMM_DWORD [edi], xmmA addedi, byte SIZEOF_DWORD subecx, byte SIZEOF_DWORD
psrldq xmmA, SIZEOF_DWORD
.column_st3: ; Store the lower 2 bytes of eax to the output when it has enough ; space. movdeax, xmmA cmpecx, byte SIZEOF_WORD
jb short .column_st1 movword [edi], ax addedi, byte SIZEOF_WORD subecx, byte SIZEOF_WORD shreax, 16
.column_st1: ; Store the lower 1 byte of eax to the output when it has enough ; space.
test ecx, ecx jzshort .endcolumn movbyte [edi], al
.column_st32: cmpecx, byte SIZEOF_XMMWORD/2
jb short .column_st16
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD addedi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmC
movdqa xmmD, xmmH subecx, byte SIZEOF_XMMWORD/2
.column_st16: cmpecx, byte SIZEOF_XMMWORD/4
jb short .column_st15
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA addedi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmD subecx, byte SIZEOF_XMMWORD/4
.column_st15: ; Store two pixels (8 bytes) of xmmA to the output when it has enough ; space. cmpecx, byte SIZEOF_XMMWORD/8
jb short .column_st7
movq XMM_MMWORD [edi], xmmA addedi, byte SIZEOF_XMMWORD/8*4 subecx, byte SIZEOF_XMMWORD/8
psrldq xmmA, SIZEOF_XMMWORD/8*4
.column_st7: ; Store one pixel (4 bytes) of xmmA to the output when it has enough ; space.
test ecx, ecx jzshort .endcolumn movd XMM_DWORD [edi], xmmA
%endif ; RGB_PIXELSIZE ; ---------------
.endcolumn:
sfence ; flush the write buffer
.return: popedi popesi ; pop edx ; need not be preserved ; pop ecx ; need not be preserved pop ebx movesp, ebp; esp <- aligned ebp popesp; esp <- original ebp popebp ret
; -------------------------------------------------------------------------- ; ; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. ; ; GLOBAL(void) ; jsimd_h2v2_merged_upsample_sse2(JDIMENSION output_width, ; JSAMPIMAGE input_buf, ; JDIMENSION in_row_group_ctr, ; JSAMPARRAY output_buf); ;
EXTN(jsimd_h2v2_merged_upsample_sse2): pushebp movebp, esp push ebx ; push ecx ; need not be preserved ; push edx ; need not be preserved pushesi pushedi
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.