mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
f21bd429e5
--HG-- rename : jpeg/MOZCHANGES => media/libjpeg/MOZCHANGES rename : jpeg/Makefile.in => media/libjpeg/Makefile.in rename : jpeg/README => media/libjpeg/README rename : jpeg/README-turbo.txt => media/libjpeg/README-turbo.txt rename : jpeg/cderror.h => media/libjpeg/cderror.h rename : jpeg/cdjpeg.h => media/libjpeg/cdjpeg.h rename : jpeg/jaricom.c => media/libjpeg/jaricom.c rename : jpeg/jcapimin.c => media/libjpeg/jcapimin.c rename : jpeg/jcapistd.c => media/libjpeg/jcapistd.c rename : jpeg/jcarith.c => media/libjpeg/jcarith.c rename : jpeg/jccoefct.c => media/libjpeg/jccoefct.c rename : jpeg/jccolor.c => media/libjpeg/jccolor.c rename : jpeg/jcdctmgr.c => media/libjpeg/jcdctmgr.c rename : jpeg/jchuff.c => media/libjpeg/jchuff.c rename : jpeg/jchuff.h => media/libjpeg/jchuff.h rename : jpeg/jcinit.c => media/libjpeg/jcinit.c rename : jpeg/jcmainct.c => media/libjpeg/jcmainct.c rename : jpeg/jcmarker.c => media/libjpeg/jcmarker.c rename : jpeg/jcmaster.c => media/libjpeg/jcmaster.c rename : jpeg/jcomapi.c => media/libjpeg/jcomapi.c rename : jpeg/jconfig.h => media/libjpeg/jconfig.h rename : jpeg/jconfig.h.in => media/libjpeg/jconfig.h.in rename : jpeg/jcparam.c => media/libjpeg/jcparam.c rename : jpeg/jcphuff.c => media/libjpeg/jcphuff.c rename : jpeg/jcprepct.c => media/libjpeg/jcprepct.c rename : jpeg/jcsample.c => media/libjpeg/jcsample.c rename : jpeg/jdapimin.c => media/libjpeg/jdapimin.c rename : jpeg/jdapistd.c => media/libjpeg/jdapistd.c rename : jpeg/jdarith.c => media/libjpeg/jdarith.c rename : jpeg/jdatadst.c => media/libjpeg/jdatadst.c rename : jpeg/jdatasrc.c => media/libjpeg/jdatasrc.c rename : jpeg/jdcoefct.c => media/libjpeg/jdcoefct.c rename : jpeg/jdcolor.c => media/libjpeg/jdcolor.c rename : jpeg/jdct.h => media/libjpeg/jdct.h rename : jpeg/jddctmgr.c => media/libjpeg/jddctmgr.c rename : jpeg/jdhuff.c => media/libjpeg/jdhuff.c rename : jpeg/jdhuff.h => media/libjpeg/jdhuff.h rename : jpeg/jdinput.c => media/libjpeg/jdinput.c rename : jpeg/jdmainct.c => media/libjpeg/jdmainct.c rename : jpeg/jdmarker.c => media/libjpeg/jdmarker.c rename : jpeg/jdmaster.c => media/libjpeg/jdmaster.c rename : jpeg/jdmerge.c => media/libjpeg/jdmerge.c rename : jpeg/jdphuff.c => media/libjpeg/jdphuff.c rename : jpeg/jdpostct.c => media/libjpeg/jdpostct.c rename : jpeg/jdsample.c => media/libjpeg/jdsample.c rename : jpeg/jdtrans.c => media/libjpeg/jdtrans.c rename : jpeg/jerror.c => media/libjpeg/jerror.c rename : jpeg/jerror.h => media/libjpeg/jerror.h rename : jpeg/jfdctflt.c => media/libjpeg/jfdctflt.c rename : jpeg/jfdctfst.c => media/libjpeg/jfdctfst.c rename : jpeg/jfdctint.c => media/libjpeg/jfdctint.c rename : jpeg/jidctflt.c => media/libjpeg/jidctflt.c rename : jpeg/jidctfst.c => media/libjpeg/jidctfst.c rename : jpeg/jidctint.c => media/libjpeg/jidctint.c rename : jpeg/jidctred.c => media/libjpeg/jidctred.c rename : jpeg/jinclude.h => media/libjpeg/jinclude.h rename : jpeg/jmemmgr.c => media/libjpeg/jmemmgr.c rename : jpeg/jmemnobs.c => media/libjpeg/jmemnobs.c rename : jpeg/jmemsys.h => media/libjpeg/jmemsys.h rename : jpeg/jmorecfg.h => media/libjpeg/jmorecfg.h rename : jpeg/jpegcomp.h => media/libjpeg/jpegcomp.h rename : jpeg/jpegint.h => media/libjpeg/jpegint.h rename : jpeg/jpeglib.h => media/libjpeg/jpeglib.h rename : jpeg/jquant1.c => media/libjpeg/jquant1.c rename : jpeg/jquant2.c => media/libjpeg/jquant2.c rename : jpeg/jsimd.h => media/libjpeg/jsimd.h rename : jpeg/jsimd_none.c => media/libjpeg/jsimd_none.c rename : jpeg/jsimddct.h => media/libjpeg/jsimddct.h rename : jpeg/jutils.c => media/libjpeg/jutils.c rename : jpeg/jversion.h => media/libjpeg/jversion.h rename : jpeg/simd/Makefile.in => media/libjpeg/simd/Makefile.in rename : jpeg/simd/jcclrmmx.asm => media/libjpeg/simd/jcclrmmx.asm rename : jpeg/simd/jcclrss2-64.asm => media/libjpeg/simd/jcclrss2-64.asm rename : jpeg/simd/jcclrss2.asm => media/libjpeg/simd/jcclrss2.asm rename : jpeg/simd/jccolmmx.asm => media/libjpeg/simd/jccolmmx.asm rename : jpeg/simd/jccolss2-64.asm => media/libjpeg/simd/jccolss2-64.asm rename : jpeg/simd/jccolss2.asm => media/libjpeg/simd/jccolss2.asm rename : jpeg/simd/jcolsamp.inc => media/libjpeg/simd/jcolsamp.inc rename : jpeg/simd/jcqnt3dn.asm => media/libjpeg/simd/jcqnt3dn.asm rename : jpeg/simd/jcqntmmx.asm => media/libjpeg/simd/jcqntmmx.asm rename : jpeg/simd/jcqnts2f-64.asm => media/libjpeg/simd/jcqnts2f-64.asm rename : jpeg/simd/jcqnts2f.asm => media/libjpeg/simd/jcqnts2f.asm rename : jpeg/simd/jcqnts2i-64.asm => media/libjpeg/simd/jcqnts2i-64.asm rename : jpeg/simd/jcqnts2i.asm => media/libjpeg/simd/jcqnts2i.asm rename : jpeg/simd/jcqntsse.asm => media/libjpeg/simd/jcqntsse.asm rename : jpeg/simd/jcsammmx.asm => media/libjpeg/simd/jcsammmx.asm rename : jpeg/simd/jcsamss2-64.asm => media/libjpeg/simd/jcsamss2-64.asm rename : jpeg/simd/jcsamss2.asm => media/libjpeg/simd/jcsamss2.asm rename : jpeg/simd/jdclrmmx.asm => media/libjpeg/simd/jdclrmmx.asm rename : jpeg/simd/jdclrss2-64.asm => media/libjpeg/simd/jdclrss2-64.asm rename : jpeg/simd/jdclrss2.asm => media/libjpeg/simd/jdclrss2.asm rename : jpeg/simd/jdcolmmx.asm => media/libjpeg/simd/jdcolmmx.asm rename : jpeg/simd/jdcolss2-64.asm => media/libjpeg/simd/jdcolss2-64.asm rename : jpeg/simd/jdcolss2.asm => media/libjpeg/simd/jdcolss2.asm rename : jpeg/simd/jdct.inc => media/libjpeg/simd/jdct.inc rename : jpeg/simd/jdmermmx.asm => media/libjpeg/simd/jdmermmx.asm rename : jpeg/simd/jdmerss2-64.asm => media/libjpeg/simd/jdmerss2-64.asm rename : jpeg/simd/jdmerss2.asm => media/libjpeg/simd/jdmerss2.asm rename : jpeg/simd/jdmrgmmx.asm => media/libjpeg/simd/jdmrgmmx.asm rename : jpeg/simd/jdmrgss2-64.asm => media/libjpeg/simd/jdmrgss2-64.asm rename : jpeg/simd/jdmrgss2.asm => media/libjpeg/simd/jdmrgss2.asm rename : jpeg/simd/jdsammmx.asm => media/libjpeg/simd/jdsammmx.asm rename : jpeg/simd/jdsamss2-64.asm => media/libjpeg/simd/jdsamss2-64.asm rename : jpeg/simd/jdsamss2.asm => media/libjpeg/simd/jdsamss2.asm rename : jpeg/simd/jf3dnflt.asm => media/libjpeg/simd/jf3dnflt.asm rename : jpeg/simd/jfmmxfst.asm => media/libjpeg/simd/jfmmxfst.asm rename : jpeg/simd/jfmmxint.asm => media/libjpeg/simd/jfmmxint.asm rename : jpeg/simd/jfss2fst-64.asm => media/libjpeg/simd/jfss2fst-64.asm rename : jpeg/simd/jfss2fst.asm => media/libjpeg/simd/jfss2fst.asm rename : jpeg/simd/jfss2int-64.asm => media/libjpeg/simd/jfss2int-64.asm rename : jpeg/simd/jfss2int.asm => media/libjpeg/simd/jfss2int.asm rename : jpeg/simd/jfsseflt-64.asm => media/libjpeg/simd/jfsseflt-64.asm rename : jpeg/simd/jfsseflt.asm => media/libjpeg/simd/jfsseflt.asm rename : jpeg/simd/ji3dnflt.asm => media/libjpeg/simd/ji3dnflt.asm rename : jpeg/simd/jimmxfst.asm => media/libjpeg/simd/jimmxfst.asm rename : jpeg/simd/jimmxint.asm => media/libjpeg/simd/jimmxint.asm rename : jpeg/simd/jimmxred.asm => media/libjpeg/simd/jimmxred.asm rename : jpeg/simd/jiss2flt-64.asm => media/libjpeg/simd/jiss2flt-64.asm rename : jpeg/simd/jiss2flt.asm => media/libjpeg/simd/jiss2flt.asm rename : jpeg/simd/jiss2fst-64.asm => media/libjpeg/simd/jiss2fst-64.asm rename : jpeg/simd/jiss2fst.asm => media/libjpeg/simd/jiss2fst.asm rename : jpeg/simd/jiss2int-64.asm => media/libjpeg/simd/jiss2int-64.asm rename : jpeg/simd/jiss2int.asm => media/libjpeg/simd/jiss2int.asm rename : jpeg/simd/jiss2red-64.asm => media/libjpeg/simd/jiss2red-64.asm rename : jpeg/simd/jiss2red.asm => media/libjpeg/simd/jiss2red.asm rename : jpeg/simd/jisseflt.asm => media/libjpeg/simd/jisseflt.asm rename : jpeg/simd/jsimd.h => media/libjpeg/simd/jsimd.h rename : jpeg/simd/jsimd_i386.c => media/libjpeg/simd/jsimd_i386.c rename : jpeg/simd/jsimd_x86_64.c => media/libjpeg/simd/jsimd_x86_64.c rename : jpeg/simd/jsimdcfg.inc => media/libjpeg/simd/jsimdcfg.inc rename : jpeg/simd/jsimdcfg.inc.h => media/libjpeg/simd/jsimdcfg.inc.h rename : jpeg/simd/jsimdcpu.asm => media/libjpeg/simd/jsimdcpu.asm rename : jpeg/simd/jsimdext.inc => media/libjpeg/simd/jsimdext.inc rename : jpeg/transupp.h => media/libjpeg/transupp.h
682 lines
16 KiB
C
682 lines
16 KiB
C
/*
|
|
* jsimd_x86_64.c
|
|
*
|
|
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
|
* Copyright 2009 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 contains the interface between the "normal" portions
|
|
* of the library and the SIMD implementations when running on a
|
|
* x86_64 architecture.
|
|
*/
|
|
|
|
#define JPEG_INTERNALS
|
|
#include "../jinclude.h"
|
|
#include "../jpeglib.h"
|
|
#include "../jsimd.h"
|
|
#include "../jdct.h"
|
|
#include "../jsimddct.h"
|
|
#include "jsimd.h"
|
|
|
|
/*
|
|
* In the PIC cases, we have no guarantee that constants will keep
|
|
* their alignment. This macro allows us to verify it at runtime.
|
|
*/
|
|
#define IS_ALIGNED(ptr, order) (((size_t)ptr & ((1 << order) - 1)) == 0)
|
|
|
|
#define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_rgb_ycc (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_ycc_rgb (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
|
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
|
JDIMENSION output_row, int num_rows)
|
|
{
|
|
void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
|
|
|
|
switch(cinfo->in_color_space)
|
|
{
|
|
case JCS_EXT_RGB:
|
|
sse2fct=jsimd_extrgb_ycc_convert_sse2;
|
|
break;
|
|
case JCS_EXT_RGBX:
|
|
sse2fct=jsimd_extrgbx_ycc_convert_sse2;
|
|
break;
|
|
case JCS_EXT_BGR:
|
|
sse2fct=jsimd_extbgr_ycc_convert_sse2;
|
|
break;
|
|
case JCS_EXT_BGRX:
|
|
sse2fct=jsimd_extbgrx_ycc_convert_sse2;
|
|
break;
|
|
case JCS_EXT_XBGR:
|
|
sse2fct=jsimd_extxbgr_ycc_convert_sse2;
|
|
break;
|
|
case JCS_EXT_XRGB:
|
|
sse2fct=jsimd_extxrgb_ycc_convert_sse2;
|
|
break;
|
|
default:
|
|
sse2fct=jsimd_rgb_ycc_convert_sse2;
|
|
break;
|
|
}
|
|
|
|
sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
|
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
|
JSAMPARRAY output_buf, int num_rows)
|
|
{
|
|
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
|
|
|
|
switch(cinfo->out_color_space)
|
|
{
|
|
case JCS_EXT_RGB:
|
|
sse2fct=jsimd_ycc_extrgb_convert_sse2;
|
|
break;
|
|
case JCS_EXT_RGBX:
|
|
sse2fct=jsimd_ycc_extrgbx_convert_sse2;
|
|
break;
|
|
case JCS_EXT_BGR:
|
|
sse2fct=jsimd_ycc_extbgr_convert_sse2;
|
|
break;
|
|
case JCS_EXT_BGRX:
|
|
sse2fct=jsimd_ycc_extbgrx_convert_sse2;
|
|
break;
|
|
case JCS_EXT_XBGR:
|
|
sse2fct=jsimd_ycc_extxbgr_convert_sse2;
|
|
break;
|
|
case JCS_EXT_XRGB:
|
|
sse2fct=jsimd_ycc_extxrgb_convert_sse2;
|
|
break;
|
|
default:
|
|
sse2fct=jsimd_ycc_rgb_convert_sse2;
|
|
break;
|
|
}
|
|
|
|
sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v2_downsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v1_downsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
|
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
|
{
|
|
jsimd_h2v2_downsample_sse2(cinfo->image_width,
|
|
cinfo->max_v_samp_factor,
|
|
compptr->v_samp_factor,
|
|
compptr->width_in_blocks,
|
|
input_data, output_data);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
|
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
|
{
|
|
jsimd_h2v1_downsample_sse2(cinfo->image_width,
|
|
cinfo->max_v_samp_factor,
|
|
compptr->v_samp_factor,
|
|
compptr->width_in_blocks,
|
|
input_data, output_data);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v2_upsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v1_upsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v2_upsample (j_decompress_ptr cinfo,
|
|
jpeg_component_info * compptr,
|
|
JSAMPARRAY input_data,
|
|
JSAMPARRAY * output_data_ptr)
|
|
{
|
|
jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor,
|
|
cinfo->output_width,
|
|
input_data, output_data_ptr);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v1_upsample (j_decompress_ptr cinfo,
|
|
jpeg_component_info * compptr,
|
|
JSAMPARRAY input_data,
|
|
JSAMPARRAY * output_data_ptr)
|
|
{
|
|
jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor,
|
|
cinfo->output_width,
|
|
input_data, output_data_ptr);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v2_fancy_upsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v1_fancy_upsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
|
|
jpeg_component_info * compptr,
|
|
JSAMPARRAY input_data,
|
|
JSAMPARRAY * output_data_ptr)
|
|
{
|
|
jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,
|
|
compptr->downsampled_width,
|
|
input_data, output_data_ptr);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
|
|
jpeg_component_info * compptr,
|
|
JSAMPARRAY input_data,
|
|
JSAMPARRAY * output_data_ptr)
|
|
{
|
|
jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,
|
|
compptr->downsampled_width,
|
|
input_data, output_data_ptr);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v2_merged_upsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_h2v1_merged_upsample (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
|
|
JSAMPIMAGE input_buf,
|
|
JDIMENSION in_row_group_ctr,
|
|
JSAMPARRAY output_buf)
|
|
{
|
|
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
|
|
|
|
switch(cinfo->out_color_space)
|
|
{
|
|
case JCS_EXT_RGB:
|
|
sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_RGBX:
|
|
sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_BGR:
|
|
sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_BGRX:
|
|
sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_XBGR:
|
|
sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_XRGB:
|
|
sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;
|
|
break;
|
|
default:
|
|
sse2fct=jsimd_h2v2_merged_upsample_sse2;
|
|
break;
|
|
}
|
|
|
|
sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
|
|
JSAMPIMAGE input_buf,
|
|
JDIMENSION in_row_group_ctr,
|
|
JSAMPARRAY output_buf)
|
|
{
|
|
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
|
|
|
|
switch(cinfo->out_color_space)
|
|
{
|
|
case JCS_EXT_RGB:
|
|
sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_RGBX:
|
|
sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_BGR:
|
|
sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_BGRX:
|
|
sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_XBGR:
|
|
sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;
|
|
break;
|
|
case JCS_EXT_XRGB:
|
|
sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;
|
|
break;
|
|
default:
|
|
sse2fct=jsimd_h2v1_merged_upsample_sse2;
|
|
break;
|
|
}
|
|
|
|
sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_convsamp (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if (sizeof(DCTELEM) != 2)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_convsamp_float (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if (sizeof(FAST_FLOAT) != 4)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,
|
|
DCTELEM * workspace)
|
|
{
|
|
jsimd_convsamp_sse2(sample_data, start_col, workspace);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,
|
|
FAST_FLOAT * workspace)
|
|
{
|
|
jsimd_convsamp_float_sse2(sample_data, start_col, workspace);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_fdct_islow (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(DCTELEM) != 2)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_fdct_islow_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_fdct_ifast (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(DCTELEM) != 2)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_fdct_ifast_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_fdct_float (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(FAST_FLOAT) != 4)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_fdct_float_sse))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_fdct_islow (DCTELEM * data)
|
|
{
|
|
jsimd_fdct_islow_sse2(data);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_fdct_ifast (DCTELEM * data)
|
|
{
|
|
jsimd_fdct_ifast_sse2(data);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_fdct_float (FAST_FLOAT * data)
|
|
{
|
|
jsimd_fdct_float_sse(data);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_quantize (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(JCOEF) != 2)
|
|
return 0;
|
|
if (sizeof(DCTELEM) != 2)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_quantize_float (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(JCOEF) != 2)
|
|
return 0;
|
|
if (sizeof(FAST_FLOAT) != 4)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,
|
|
DCTELEM * workspace)
|
|
{
|
|
jsimd_quantize_sse2(coef_block, divisors, workspace);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,
|
|
FAST_FLOAT * workspace)
|
|
{
|
|
jsimd_quantize_float_sse2(coef_block, divisors, workspace);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_idct_2x2 (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(JCOEF) != 2)
|
|
return 0;
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_idct_red_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_idct_4x4 (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(JCOEF) != 2)
|
|
return 0;
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_idct_red_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
|
JDIMENSION output_col)
|
|
{
|
|
jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf, output_col);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
|
JDIMENSION output_col)
|
|
{
|
|
jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col);
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_idct_islow (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(JCOEF) != 2)
|
|
return 0;
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_idct_islow_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_idct_ifast (void)
|
|
{
|
|
/* The code is optimised for these values only */
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(JCOEF) != 2)
|
|
return 0;
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if (sizeof(IFAST_MULT_TYPE) != 2)
|
|
return 0;
|
|
if (IFAST_SCALE_BITS != 2)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_idct_ifast_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(int)
|
|
jsimd_can_idct_float (void)
|
|
{
|
|
if (DCTSIZE != 8)
|
|
return 0;
|
|
if (sizeof(JCOEF) != 2)
|
|
return 0;
|
|
if (BITS_IN_JSAMPLE != 8)
|
|
return 0;
|
|
if (sizeof(JDIMENSION) != 4)
|
|
return 0;
|
|
if (sizeof(FAST_FLOAT) != 4)
|
|
return 0;
|
|
if (sizeof(FLOAT_MULT_TYPE) != 4)
|
|
return 0;
|
|
|
|
if (!IS_ALIGNED_SSE(jconst_idct_float_sse2))
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
|
JDIMENSION output_col)
|
|
{
|
|
jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf, output_col);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
|
JDIMENSION output_col)
|
|
{
|
|
jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf, output_col);
|
|
}
|
|
|
|
GLOBAL(void)
|
|
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
|
JDIMENSION output_col)
|
|
{
|
|
jsimd_idct_float_sse2(compptr->dct_table, coef_block,
|
|
output_buf, output_col);
|
|
}
|
|
|