Clean up code formatting in the SIMD interface functions

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1306 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2014-05-15 19:46:48 +00:00
parent 3b489c3af7
commit 64086281b3
4 changed files with 129 additions and 142 deletions

View File

@@ -292,22 +292,22 @@ jsimd_can_idct_float (void)
GLOBAL(void) GLOBAL(void)
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
} }

View File

@@ -9,10 +9,8 @@
* For conditions of distribution and use, see copyright notice in jsimdext.inc * For conditions of distribution and use, see copyright notice in jsimdext.inc
* *
* This file contains the interface between the "normal" portions * This file contains the interface between the "normal" portions
* of the library and the SIMD implementations when running on * of the library and the SIMD implementations when running on a
* ARM architecture. * 32-bit ARM architecture.
*
* Based on the stubs from 'jsimd_none.c'
*/ */
#define JPEG_INTERNALS #define JPEG_INTERNALS
@@ -170,6 +168,7 @@ jsimd_can_ycc_rgb (void)
return 0; return 0;
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
return 0; return 0;
if (simd_support & JSIMD_ARM_NEON) if (simd_support & JSIMD_ARM_NEON)
return 1; return 1;
@@ -183,8 +182,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
{ {
void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
switch(cinfo->in_color_space) switch(cinfo->in_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
neonfct=jsimd_extrgb_ycc_convert_neon; neonfct=jsimd_extrgb_ycc_convert_neon;
break; break;
@@ -213,8 +211,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
} }
if (simd_support & JSIMD_ARM_NEON) if (simd_support & JSIMD_ARM_NEON)
neonfct(cinfo->image_width, input_buf, neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
output_buf, output_row, num_rows);
} }
GLOBAL(void) GLOBAL(void)
@@ -231,8 +228,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
{ {
void (*neonfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); void (*neonfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
switch(cinfo->out_color_space) switch(cinfo->out_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
neonfct=jsimd_ycc_extrgb_convert_neon; neonfct=jsimd_ycc_extrgb_convert_neon;
break; break;
@@ -261,8 +257,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
} }
if (simd_support & JSIMD_ARM_NEON) if (simd_support & JSIMD_ARM_NEON)
neonfct(cinfo->output_width, input_buf, neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
input_row, output_buf, num_rows);
} }
GLOBAL(int) GLOBAL(int)
@@ -366,7 +361,8 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
{ {
if (simd_support & JSIMD_ARM_NEON) if (simd_support & JSIMD_ARM_NEON)
jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor, jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor,
compptr->downsampled_width, input_data, output_data_ptr); compptr->downsampled_width, input_data,
output_data_ptr);
} }
GLOBAL(int) GLOBAL(int)
@@ -552,7 +548,7 @@ jsimd_can_idct_2x2 (void)
if (sizeof(ISLOW_MULT_TYPE) != 2) if (sizeof(ISLOW_MULT_TYPE) != 2)
return 0; return 0;
if ((simd_support & JSIMD_ARM_NEON)) if (simd_support & JSIMD_ARM_NEON)
return 1; return 1;
return 0; return 0;
@@ -575,7 +571,7 @@ jsimd_can_idct_4x4 (void)
if (sizeof(ISLOW_MULT_TYPE) != 2) if (sizeof(ISLOW_MULT_TYPE) != 2)
return 0; return 0;
if ((simd_support & JSIMD_ARM_NEON)) if (simd_support & JSIMD_ARM_NEON)
return 1; return 1;
return 0; return 0;
@@ -586,8 +582,9 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_ARM_NEON)) if (simd_support & JSIMD_ARM_NEON)
jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(void) GLOBAL(void)
@@ -595,8 +592,9 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_ARM_NEON)) if (simd_support & JSIMD_ARM_NEON)
jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(int) GLOBAL(int)
@@ -641,7 +639,7 @@ jsimd_can_idct_ifast (void)
if (IFAST_SCALE_BITS != 2) if (IFAST_SCALE_BITS != 2)
return 0; return 0;
if ((simd_support & JSIMD_ARM_NEON)) if (simd_support & JSIMD_ARM_NEON)
return 1; return 1;
return 0; return 0;
@@ -657,26 +655,27 @@ jsimd_can_idct_float (void)
GLOBAL(void) GLOBAL(void)
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_ARM_NEON)) if (simd_support & JSIMD_ARM_NEON)
jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_ARM_NEON)) if (simd_support & JSIMD_ARM_NEON)
jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
} }

View File

@@ -135,8 +135,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
switch(cinfo->in_color_space) switch(cinfo->in_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_extrgb_ycc_convert_sse2; sse2fct=jsimd_extrgb_ycc_convert_sse2;
mmxfct=jsimd_extrgb_ycc_convert_mmx; mmxfct=jsimd_extrgb_ycc_convert_mmx;
@@ -173,11 +172,9 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
if ((simd_support & JSIMD_SSE2) && if ((simd_support & JSIMD_SSE2) &&
IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2)) IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))
sse2fct(cinfo->image_width, input_buf, sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
output_buf, output_row, num_rows);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
mmxfct(cinfo->image_width, input_buf, mmxfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
output_buf, output_row, num_rows);
} }
GLOBAL(void) GLOBAL(void)
@@ -188,8 +185,7 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
switch(cinfo->in_color_space) switch(cinfo->in_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_extrgb_gray_convert_sse2; sse2fct=jsimd_extrgb_gray_convert_sse2;
mmxfct=jsimd_extrgb_gray_convert_mmx; mmxfct=jsimd_extrgb_gray_convert_mmx;
@@ -226,11 +222,9 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
if ((simd_support & JSIMD_SSE2) && if ((simd_support & JSIMD_SSE2) &&
IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2)) IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))
sse2fct(cinfo->image_width, input_buf, sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
output_buf, output_row, num_rows);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
mmxfct(cinfo->image_width, input_buf, mmxfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
output_buf, output_row, num_rows);
} }
GLOBAL(void) GLOBAL(void)
@@ -241,8 +235,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
switch(cinfo->out_color_space) switch(cinfo->out_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_ycc_extrgb_convert_sse2; sse2fct=jsimd_ycc_extrgb_convert_sse2;
mmxfct=jsimd_ycc_extrgb_convert_mmx; mmxfct=jsimd_ycc_extrgb_convert_mmx;
@@ -279,11 +272,9 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
if ((simd_support & JSIMD_SSE2) && if ((simd_support & JSIMD_SSE2) &&
IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2)) IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))
sse2fct(cinfo->output_width, input_buf, sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
input_row, output_buf, num_rows);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
mmxfct(cinfo->output_width, input_buf, mmxfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
input_row, output_buf, num_rows);
} }
GLOBAL(int) GLOBAL(int)
@@ -330,12 +321,13 @@ jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
{ {
if (simd_support & JSIMD_SSE2) if (simd_support & JSIMD_SSE2)
jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor, jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,
compptr->v_samp_factor, compptr->width_in_blocks, compptr->v_samp_factor,
input_data, output_data); compptr->width_in_blocks, input_data,
output_data);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_h2v2_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor, jsimd_h2v2_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor,
compptr->v_samp_factor, compptr->width_in_blocks, compptr->v_samp_factor, compptr->width_in_blocks,
input_data, output_data); input_data, output_data);
} }
GLOBAL(void) GLOBAL(void)
@@ -344,12 +336,13 @@ jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
{ {
if (simd_support & JSIMD_SSE2) if (simd_support & JSIMD_SSE2)
jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor, jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,
compptr->v_samp_factor, compptr->width_in_blocks, compptr->v_samp_factor,
input_data, output_data); compptr->width_in_blocks, input_data,
output_data);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_h2v1_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor, jsimd_h2v1_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor,
compptr->v_samp_factor, compptr->width_in_blocks, compptr->v_samp_factor, compptr->width_in_blocks,
input_data, output_data); input_data, output_data);
} }
GLOBAL(int) GLOBAL(int)
@@ -397,11 +390,11 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo,
JSAMPARRAY * output_data_ptr) JSAMPARRAY * output_data_ptr)
{ {
if (simd_support & JSIMD_SSE2) if (simd_support & JSIMD_SSE2)
jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
cinfo->output_width, input_data, output_data_ptr); input_data, output_data_ptr);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_h2v2_upsample_mmx(cinfo->max_v_samp_factor, jsimd_h2v2_upsample_mmx(cinfo->max_v_samp_factor, cinfo->output_width,
cinfo->output_width, input_data, output_data_ptr); input_data, output_data_ptr);
} }
GLOBAL(void) GLOBAL(void)
@@ -411,11 +404,11 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo,
JSAMPARRAY * output_data_ptr) JSAMPARRAY * output_data_ptr)
{ {
if (simd_support & JSIMD_SSE2) if (simd_support & JSIMD_SSE2)
jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
cinfo->output_width, input_data, output_data_ptr); input_data, output_data_ptr);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_h2v1_upsample_mmx(cinfo->max_v_samp_factor, jsimd_h2v1_upsample_mmx(cinfo->max_v_samp_factor, cinfo->output_width,
cinfo->output_width, input_data, output_data_ptr); input_data, output_data_ptr);
} }
GLOBAL(int) GLOBAL(int)
@@ -467,10 +460,12 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
if ((simd_support & JSIMD_SSE2) && if ((simd_support & JSIMD_SSE2) &&
IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,
compptr->downsampled_width, input_data, output_data_ptr); compptr->downsampled_width, input_data,
output_data_ptr);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_h2v2_fancy_upsample_mmx(cinfo->max_v_samp_factor, jsimd_h2v2_fancy_upsample_mmx(cinfo->max_v_samp_factor,
compptr->downsampled_width, input_data, output_data_ptr); compptr->downsampled_width, input_data,
output_data_ptr);
} }
GLOBAL(void) GLOBAL(void)
@@ -482,10 +477,12 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
if ((simd_support & JSIMD_SSE2) && if ((simd_support & JSIMD_SSE2) &&
IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,
compptr->downsampled_width, input_data, output_data_ptr); compptr->downsampled_width, input_data,
output_data_ptr);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_h2v1_fancy_upsample_mmx(cinfo->max_v_samp_factor, jsimd_h2v1_fancy_upsample_mmx(cinfo->max_v_samp_factor,
compptr->downsampled_width, input_data, output_data_ptr); compptr->downsampled_width, input_data,
output_data_ptr);
} }
GLOBAL(int) GLOBAL(int)
@@ -537,8 +534,7 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
switch(cinfo->out_color_space) switch(cinfo->out_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2; sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extrgb_merged_upsample_mmx; mmxfct=jsimd_h2v2_extrgb_merged_upsample_mmx;
@@ -575,11 +571,9 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
if ((simd_support & JSIMD_SSE2) && if ((simd_support & JSIMD_SSE2) &&
IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
sse2fct(cinfo->output_width, input_buf, sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
in_row_group_ctr, output_buf);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
mmxfct(cinfo->output_width, input_buf, mmxfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
in_row_group_ctr, output_buf);
} }
GLOBAL(void) GLOBAL(void)
@@ -591,8 +585,7 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
switch(cinfo->out_color_space) switch(cinfo->out_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2; sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extrgb_merged_upsample_mmx; mmxfct=jsimd_h2v1_extrgb_merged_upsample_mmx;
@@ -629,11 +622,9 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
if ((simd_support & JSIMD_SSE2) && if ((simd_support & JSIMD_SSE2) &&
IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
sse2fct(cinfo->output_width, input_buf, sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
in_row_group_ctr, output_buf);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
mmxfct(cinfo->output_width, input_buf, mmxfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
in_row_group_ctr, output_buf);
} }
GLOBAL(int) GLOBAL(int)
@@ -912,7 +903,8 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))
jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf,
output_col);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_idct_2x2_mmx(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_2x2_mmx(compptr->dct_table, coef_block, output_buf, output_col);
} }
@@ -923,7 +915,8 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))
jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf,
output_col);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_idct_4x4_mmx(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_4x4_mmx(compptr->dct_table, coef_block, output_buf, output_col);
} }
@@ -1010,39 +1003,43 @@ jsimd_can_idct_float (void)
GLOBAL(void) GLOBAL(void)
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2)) if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))
jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf,
output_col);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_idct_islow_mmx(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_islow_mmx(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2)) if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))
jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf,
output_col);
else if (simd_support & JSIMD_MMX) else if (simd_support & JSIMD_MMX)
jsimd_idct_ifast_mmx(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_ifast_mmx(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2)) if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2))
jsimd_idct_float_sse2(compptr->dct_table, coef_block, jsimd_idct_float_sse2(compptr->dct_table, coef_block, output_buf,
output_buf, output_col); output_col);
else if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse)) else if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse))
jsimd_idct_float_sse(compptr->dct_table, coef_block, jsimd_idct_float_sse(compptr->dct_table, coef_block, output_buf,
output_buf, output_col); output_col);
else if (simd_support & JSIMD_3DNOW) else if (simd_support & JSIMD_3DNOW)
jsimd_idct_float_3dnow(compptr->dct_table, coef_block, jsimd_idct_float_3dnow(compptr->dct_table, coef_block, output_buf,
output_buf, output_col); output_col);
} }

View File

@@ -10,7 +10,7 @@
* *
* This file contains the interface between the "normal" portions * This file contains the interface between the "normal" portions
* of the library and the SIMD implementations when running on a * of the library and the SIMD implementations when running on a
* x86_64 architecture. * 64-bit x86 architecture.
*/ */
#define JPEG_INTERNALS #define JPEG_INTERNALS
@@ -87,8 +87,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
{ {
void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
switch(cinfo->in_color_space) switch(cinfo->in_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_extrgb_ycc_convert_sse2; sse2fct=jsimd_extrgb_ycc_convert_sse2;
break; break;
@@ -126,8 +125,7 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
{ {
void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
switch(cinfo->in_color_space) switch(cinfo->in_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_extrgb_gray_convert_sse2; sse2fct=jsimd_extrgb_gray_convert_sse2;
break; break;
@@ -165,8 +163,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
{ {
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
switch(cinfo->out_color_space) switch(cinfo->out_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_ycc_extrgb_convert_sse2; sse2fct=jsimd_ycc_extrgb_convert_sse2;
break; break;
@@ -225,10 +222,8 @@ GLOBAL(void)
jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data) JSAMPARRAY input_data, JSAMPARRAY output_data)
{ {
jsimd_h2v2_downsample_sse2(cinfo->image_width, jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,
cinfo->max_v_samp_factor, compptr->v_samp_factor, compptr->width_in_blocks,
compptr->v_samp_factor,
compptr->width_in_blocks,
input_data, output_data); input_data, output_data);
} }
@@ -236,10 +231,8 @@ GLOBAL(void)
jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data) JSAMPARRAY input_data, JSAMPARRAY output_data)
{ {
jsimd_h2v1_downsample_sse2(cinfo->image_width, jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,
cinfo->max_v_samp_factor, compptr->v_samp_factor, compptr->width_in_blocks,
compptr->v_samp_factor,
compptr->width_in_blocks,
input_data, output_data); input_data, output_data);
} }
@@ -273,8 +266,7 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo,
JSAMPARRAY input_data, JSAMPARRAY input_data,
JSAMPARRAY * output_data_ptr) JSAMPARRAY * output_data_ptr)
{ {
jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
cinfo->output_width,
input_data, output_data_ptr); input_data, output_data_ptr);
} }
@@ -284,8 +276,7 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo,
JSAMPARRAY input_data, JSAMPARRAY input_data,
JSAMPARRAY * output_data_ptr) JSAMPARRAY * output_data_ptr)
{ {
jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
cinfo->output_width,
input_data, output_data_ptr); input_data, output_data_ptr);
} }
@@ -326,8 +317,8 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
JSAMPARRAY * output_data_ptr) JSAMPARRAY * output_data_ptr)
{ {
jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,
compptr->downsampled_width, compptr->downsampled_width, input_data,
input_data, output_data_ptr); output_data_ptr);
} }
GLOBAL(void) GLOBAL(void)
@@ -337,8 +328,8 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
JSAMPARRAY * output_data_ptr) JSAMPARRAY * output_data_ptr)
{ {
jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor, jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,
compptr->downsampled_width, compptr->downsampled_width, input_data,
input_data, output_data_ptr); output_data_ptr);
} }
GLOBAL(int) GLOBAL(int)
@@ -379,8 +370,7 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
{ {
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
switch(cinfo->out_color_space) switch(cinfo->out_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2; sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;
break; break;
@@ -419,8 +409,7 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
{ {
void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
switch(cinfo->out_color_space) switch(cinfo->out_color_space) {
{
case JCS_EXT_RGB: case JCS_EXT_RGB:
sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2; sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;
break; break;
@@ -728,26 +717,28 @@ jsimd_can_idct_float (void)
GLOBAL(void) GLOBAL(void)
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf, output_col); jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf,
output_col);
} }
GLOBAL(void) GLOBAL(void)
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col) JDIMENSION output_col)
{ {
jsimd_idct_float_sse2(compptr->dct_table, coef_block, jsimd_idct_float_sse2(compptr->dct_table, coef_block, output_buf,
output_buf, output_col); output_col);
} }