From: DRC Date: Wed, 28 Feb 2018 22:24:03 +0000 (-0600) Subject: SIMD: Formatting tweaks + remove unnecessary code X-Git-Tag: 1.5.90~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35ed3c97b28927a2e4a09a2d0b86d1dc96afa2aa;p=libjpeg-turbo SIMD: Formatting tweaks + remove unnecessary code + "JSIMD_ARM_NEON" = "JSIMD_NEON" + "JSIMD_MIPS_DSPR2" = "JSIMD_DSPR2" + "*_mips_dspr2" = "*_dspr2" It's obvious that "NEON" refers to Arm and "DSPr2" refers to MIPS, and this naming convention is consistent with the other SIMD extensions. --- diff --git a/simd/arm/jsimd.c b/simd/arm/jsimd.c index 1963349..a154987 100644 --- a/simd/arm/jsimd.c +++ b/simd/arm/jsimd.c @@ -82,7 +82,7 @@ parse_proc_cpuinfo (int bufsize) return 0; } if (check_feature(buffer, "neon")) - simd_support |= JSIMD_ARM_NEON; + simd_support |= JSIMD_NEON; } fclose(fd); } @@ -111,7 +111,7 @@ init_simd (void) simd_support = 0; #if defined(__ARM_NEON__) - simd_support |= JSIMD_ARM_NEON; + simd_support |= JSIMD_NEON; #elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) /* We still have a chance to use NEON regardless of globally used * -mcpu/-mfpu options passed to gcc by performing runtime detection via @@ -126,7 +126,7 @@ init_simd (void) /* Force different settings through environment variables */ env = getenv("JSIMD_FORCENEON"); if ((env != NULL) && (strcmp(env, "1") == 0)) - simd_support = JSIMD_ARM_NEON; + simd_support = JSIMD_NEON; env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; @@ -148,7 +148,7 @@ jsimd_can_rgb_ycc (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -157,8 +157,6 @@ jsimd_can_rgb_ycc (void) GLOBAL(int) jsimd_can_rgb_gray (void) { - init_simd(); - return 0; } @@ -175,7 +173,7 @@ jsimd_can_ycc_rgb (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -192,7 +190,7 @@ jsimd_can_ycc_rgb565 (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -293,16 +291,12 @@ jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_downsample (void) { - init_simd(); - return 0; } GLOBAL(int) jsimd_can_h2v1_downsample (void) { - init_simd(); - return 0; } @@ -321,16 +315,12 @@ jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, GLOBAL(int) jsimd_can_h2v2_upsample (void) { - init_simd(); - return 0; } GLOBAL(int) jsimd_can_h2v1_upsample (void) { - init_simd(); - return 0; } @@ -353,8 +343,6 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_fancy_upsample (void) { - init_simd(); - return 0; } @@ -369,7 +357,7 @@ jsimd_can_h2v1_fancy_upsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -397,16 +385,12 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_merged_upsample (void) { - init_simd(); - return 0; } GLOBAL(int) jsimd_can_h2v1_merged_upsample (void) { - init_simd(); - return 0; } @@ -441,7 +425,7 @@ jsimd_can_convsamp (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -450,8 +434,6 @@ jsimd_can_convsamp (void) GLOBAL(int) jsimd_can_convsamp_float (void) { - init_simd(); - return 0; } @@ -471,8 +453,6 @@ jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, GLOBAL(int) jsimd_can_fdct_islow (void) { - init_simd(); - return 0; } @@ -487,7 +467,7 @@ jsimd_can_fdct_ifast (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -496,8 +476,6 @@ jsimd_can_fdct_ifast (void) GLOBAL(int) jsimd_can_fdct_float (void) { - init_simd(); - return 0; } @@ -530,7 +508,7 @@ jsimd_can_quantize (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -539,8 +517,6 @@ jsimd_can_quantize (void) GLOBAL(int) jsimd_can_quantize_float (void) { - init_simd(); - return 0; } @@ -574,7 +550,7 @@ jsimd_can_idct_2x2 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -597,7 +573,7 @@ jsimd_can_idct_4x4 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -638,7 +614,7 @@ jsimd_can_idct_islow (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -663,7 +639,7 @@ jsimd_can_idct_ifast (void) if (IFAST_SCALE_BITS != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -672,8 +648,6 @@ jsimd_can_idct_ifast (void) GLOBAL(int) jsimd_can_idct_float (void) { - init_simd(); - return 0; } @@ -712,7 +686,7 @@ jsimd_can_huff_encode_one_block (void) if (sizeof(JCOEF) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON && simd_huffman) + if (simd_support & JSIMD_NEON && simd_huffman) return 1; return 0; diff --git a/simd/arm/jsimd_neon.S b/simd/arm/jsimd_neon.S index b01958e..f9e6380 100644 --- a/simd/arm/jsimd_neon.S +++ b/simd/arm/jsimd_neon.S @@ -2,8 +2,8 @@ * ARMv7 NEON optimizations for libjpeg-turbo * * Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). - * All Rights Reserved. - * Author: Siarhei Siamashka + * All Rights Reserved. + * Author: Siarhei Siamashka * Copyright (C) 2014, Siarhei Siamashka. All Rights Reserved. * Copyright (C) 2014, Linaro Limited. All Rights Reserved. * Copyright (C) 2015, D. R. Commander. All Rights Reserved. diff --git a/simd/arm64/jsimd.c b/simd/arm64/jsimd.c index 12a7822..ec3aed1 100644 --- a/simd/arm64/jsimd.c +++ b/simd/arm64/jsimd.c @@ -131,7 +131,7 @@ init_simd (void) simd_support = 0; - simd_support |= JSIMD_ARM_NEON; + simd_support |= JSIMD_NEON; #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) while (!parse_proc_cpuinfo(bufsize)) { bufsize *= 2; @@ -143,7 +143,7 @@ init_simd (void) /* Force different settings through environment variables */ env = getenv("JSIMD_FORCENEON"); if ((env != NULL) && (strcmp(env, "1") == 0)) - simd_support = JSIMD_ARM_NEON; + simd_support = JSIMD_NEON; env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; @@ -175,7 +175,7 @@ jsimd_can_rgb_ycc (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -184,8 +184,6 @@ jsimd_can_rgb_ycc (void) GLOBAL(int) jsimd_can_rgb_gray (void) { - init_simd(); - return 0; } @@ -202,7 +200,7 @@ jsimd_can_ycc_rgb (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -219,7 +217,7 @@ jsimd_can_ycc_rgb565 (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -348,7 +346,7 @@ jsimd_can_h2v2_downsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -367,7 +365,7 @@ jsimd_can_h2v1_downsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -394,16 +392,12 @@ jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, GLOBAL(int) jsimd_can_h2v2_upsample (void) { - init_simd(); - return 0; } GLOBAL(int) jsimd_can_h2v1_upsample (void) { - init_simd(); - return 0; } @@ -426,16 +420,12 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_fancy_upsample (void) { - init_simd(); - return 0; } GLOBAL(int) jsimd_can_h2v1_fancy_upsample (void) { - init_simd(); - return 0; } @@ -458,16 +448,12 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_merged_upsample (void) { - init_simd(); - return 0; } GLOBAL(int) jsimd_can_h2v1_merged_upsample (void) { - init_simd(); - return 0; } @@ -502,7 +488,7 @@ jsimd_can_convsamp (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -511,8 +497,6 @@ jsimd_can_convsamp (void) GLOBAL(int) jsimd_can_convsamp_float (void) { - init_simd(); - return 0; } @@ -540,7 +524,7 @@ jsimd_can_fdct_islow (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -557,7 +541,7 @@ jsimd_can_fdct_ifast (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -566,8 +550,6 @@ jsimd_can_fdct_ifast (void) GLOBAL(int) jsimd_can_fdct_float (void) { - init_simd(); - return 0; } @@ -601,7 +583,7 @@ jsimd_can_quantize (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -610,8 +592,6 @@ jsimd_can_quantize (void) GLOBAL(int) jsimd_can_quantize_float (void) { - init_simd(); - return 0; } @@ -645,7 +625,7 @@ jsimd_can_idct_2x2 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -668,7 +648,7 @@ jsimd_can_idct_4x4 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -709,7 +689,7 @@ jsimd_can_idct_islow (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -734,7 +714,7 @@ jsimd_can_idct_ifast (void) if (IFAST_SCALE_BITS != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_NEON) return 1; return 0; @@ -743,8 +723,6 @@ jsimd_can_idct_ifast (void) GLOBAL(int) jsimd_can_idct_float (void) { - init_simd(); - return 0; } @@ -783,7 +761,7 @@ jsimd_can_huff_encode_one_block (void) if (sizeof(JCOEF) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON && simd_huffman) + if (simd_support & JSIMD_NEON && simd_huffman) return 1; return 0; diff --git a/simd/arm64/jsimd_neon.S b/simd/arm64/jsimd_neon.S index 87e3009..9b60303 100644 --- a/simd/arm64/jsimd_neon.S +++ b/simd/arm64/jsimd_neon.S @@ -2,10 +2,10 @@ * ARMv8 NEON optimizations for libjpeg-turbo * * Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). - * All Rights Reserved. - * Author: Siarhei Siamashka + * All Rights Reserved. + * Author: Siarhei Siamashka * Copyright (C) 2013-2014, Linaro Limited. All Rights Reserved. - * Author: Ragesh Radhakrishnan + * Author: Ragesh Radhakrishnan * Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. * Copyright (C) 2015-2016, 2018, Matthieu Darbois. All Rights Reserved. * Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. @@ -2771,8 +2771,8 @@ asm_function jsimd_quantize_neon * GLOBAL(void) * jsimd_h2v1_downsample_neon (JDIMENSION image_width, int max_v_samp_factor, * JDIMENSION v_samp_factor, - * JDIMENSION width_blocks, JSAMPARRAY input_data, - * JSAMPARRAY output_data); + * JDIMENSION width_in_blocks, + * JSAMPARRAY input_data, JSAMPARRAY output_data); */ .balign 16 @@ -2881,7 +2881,8 @@ asm_function jsimd_h2v1_downsample_neon * * GLOBAL(void) * jsimd_h2v2_downsample_neon (JDIMENSION image_width, int max_v_samp_factor, - * JDIMENSION v_samp_factor, JDIMENSION width_blocks, + * JDIMENSION v_samp_factor, + * JDIMENSION width_in_blocks, * JSAMPARRAY input_data, JSAMPARRAY output_data); */ diff --git a/simd/i386/jcsample-avx2.asm b/simd/i386/jcsample-avx2.asm index 8e9080c..3ea4194 100644 --- a/simd/i386/jcsample-avx2.asm +++ b/simd/i386/jcsample-avx2.asm @@ -29,14 +29,15 @@ ; ; GLOBAL(void) ; jsimd_h2v1_downsample_avx2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; %define img_width(b) (b)+8 ; JDIMENSION image_width %define max_v_samp(b) (b)+12 ; int max_v_samp_factor %define v_samp(b) (b)+16 ; JDIMENSION v_samp_factor -%define width_blks(b) (b)+20 ; JDIMENSION width_blocks +%define width_blks(b) (b)+20 ; JDIMENSION width_in_blocks %define input_data(b) (b)+24 ; JSAMPARRAY input_data %define output_data(b) (b)+28 ; JSAMPARRAY output_data @@ -201,14 +202,15 @@ EXTN(jsimd_h2v1_downsample_avx2): ; ; GLOBAL(void) ; jsimd_h2v2_downsample_avx2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; %define img_width(b) (b)+8 ; JDIMENSION image_width %define max_v_samp(b) (b)+12 ; int max_v_samp_factor %define v_samp(b) (b)+16 ; JDIMENSION v_samp_factor -%define width_blks(b) (b)+20 ; JDIMENSION width_blocks +%define width_blks(b) (b)+20 ; JDIMENSION width_in_blocks %define input_data(b) (b)+24 ; JSAMPARRAY input_data %define output_data(b) (b)+28 ; JSAMPARRAY output_data diff --git a/simd/i386/jcsample-mmx.asm b/simd/i386/jcsample-mmx.asm index 1bb4314..e03026f 100644 --- a/simd/i386/jcsample-mmx.asm +++ b/simd/i386/jcsample-mmx.asm @@ -28,14 +28,15 @@ ; ; GLOBAL(void) ; jsimd_h2v1_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, -; JSAMPARRAY input_data, JSAMPARRAY output_data); +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, JSAMPARRAY input_data, +; JSAMPARRAY output_data); ; %define img_width(b) (b)+8 ; JDIMENSION image_width %define max_v_samp(b) (b)+12 ; int max_v_samp_factor %define v_samp(b) (b)+16 ; JDIMENSION v_samp_factor -%define width_blks(b) (b)+20 ; JDIMENSION width_blocks +%define width_blks(b) (b)+20 ; JDIMENSION width_in_blocks %define input_data(b) (b)+24 ; JSAMPARRAY input_data %define output_data(b) (b)+28 ; JSAMPARRAY output_data @@ -170,14 +171,15 @@ EXTN(jsimd_h2v1_downsample_mmx): ; ; GLOBAL(void) ; jsimd_h2v2_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, -; JSAMPARRAY input_data, JSAMPARRAY output_data); +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, JSAMPARRAY input_data, +; JSAMPARRAY output_data); ; %define img_width(b) (b)+8 ; JDIMENSION image_width %define max_v_samp(b) (b)+12 ; int max_v_samp_factor %define v_samp(b) (b)+16 ; JDIMENSION v_samp_factor -%define width_blks(b) (b)+20 ; JDIMENSION width_blocks +%define width_blks(b) (b)+20 ; JDIMENSION width_in_blocks %define input_data(b) (b)+24 ; JSAMPARRAY input_data %define output_data(b) (b)+28 ; JSAMPARRAY output_data diff --git a/simd/i386/jcsample-sse2.asm b/simd/i386/jcsample-sse2.asm index 13772ee..8528d16 100644 --- a/simd/i386/jcsample-sse2.asm +++ b/simd/i386/jcsample-sse2.asm @@ -28,14 +28,15 @@ ; ; GLOBAL(void) ; jsimd_h2v1_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; %define img_width(b) (b)+8 ; JDIMENSION image_width %define max_v_samp(b) (b)+12 ; int max_v_samp_factor %define v_samp(b) (b)+16 ; JDIMENSION v_samp_factor -%define width_blks(b) (b)+20 ; JDIMENSION width_blocks +%define width_blks(b) (b)+20 ; JDIMENSION width_in_blocks %define input_data(b) (b)+24 ; JSAMPARRAY input_data %define output_data(b) (b)+28 ; JSAMPARRAY output_data @@ -183,14 +184,15 @@ EXTN(jsimd_h2v1_downsample_sse2): ; ; GLOBAL(void) ; jsimd_h2v2_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; %define img_width(b) (b)+8 ; JDIMENSION image_width %define max_v_samp(b) (b)+12 ; int max_v_samp_factor %define v_samp(b) (b)+16 ; JDIMENSION v_samp_factor -%define width_blks(b) (b)+20 ; JDIMENSION width_blocks +%define width_blks(b) (b)+20 ; JDIMENSION width_in_blocks %define input_data(b) (b)+24 ; JSAMPARRAY input_data %define output_data(b) (b)+28 ; JSAMPARRAY output_data diff --git a/simd/i386/jsimd.c b/simd/i386/jsimd.c index d120863..fb69a8d 100644 --- a/simd/i386/jsimd.c +++ b/simd/i386/jsimd.c @@ -209,7 +209,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo, avx2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); else if (simd_support & JSIMD_SSE2) sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); - else if (simd_support & JSIMD_MMX) + else mmxfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } @@ -268,7 +268,7 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo, avx2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); else if (simd_support & JSIMD_SSE2) sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); - else if (simd_support & JSIMD_MMX) + else mmxfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } @@ -327,7 +327,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, avx2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); else if (simd_support & JSIMD_SSE2) sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); - else if (simd_support & JSIMD_MMX) + else mmxfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); } @@ -394,7 +394,7 @@ jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, compptr->v_samp_factor, compptr->width_in_blocks, input_data, output_data); - else if (simd_support & JSIMD_MMX) + else jsimd_h2v2_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor, compptr->v_samp_factor, compptr->width_in_blocks, input_data, output_data); @@ -414,7 +414,7 @@ jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, compptr->v_samp_factor, compptr->width_in_blocks, input_data, output_data); - else if (simd_support & JSIMD_MMX) + else jsimd_h2v1_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor, compptr->v_samp_factor, compptr->width_in_blocks, input_data, output_data); @@ -474,7 +474,7 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo, else if (simd_support & JSIMD_SSE2) jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); - else if (simd_support & JSIMD_MMX) + else jsimd_h2v2_upsample_mmx(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); } @@ -491,7 +491,7 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, else if (simd_support & JSIMD_SSE2) jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); - else if (simd_support & JSIMD_MMX) + else jsimd_h2v1_upsample_mmx(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); } @@ -556,7 +556,7 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, output_data_ptr); - else if (simd_support & JSIMD_MMX) + else jsimd_h2v2_fancy_upsample_mmx(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, output_data_ptr); @@ -576,7 +576,7 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, output_data_ptr); - else if (simd_support & JSIMD_MMX) + else jsimd_h2v1_fancy_upsample_mmx(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, output_data_ptr); @@ -684,7 +684,7 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo, avx2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); else if (simd_support & JSIMD_SSE2) sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); - else if (simd_support & JSIMD_MMX) + else mmxfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); } @@ -744,7 +744,7 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, avx2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); else if (simd_support & JSIMD_SSE2) sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); - else if (simd_support & JSIMD_MMX) + else mmxfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); } @@ -806,7 +806,7 @@ jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, jsimd_convsamp_avx2(sample_data, start_col, workspace); else if (simd_support & JSIMD_SSE2) jsimd_convsamp_sse2(sample_data, start_col, workspace); - else if (simd_support & JSIMD_MMX) + else jsimd_convsamp_mmx(sample_data, start_col, workspace); } @@ -818,7 +818,7 @@ jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, jsimd_convsamp_float_sse2(sample_data, start_col, workspace); else if (simd_support & JSIMD_SSE) jsimd_convsamp_float_sse(sample_data, start_col, workspace); - else if (simd_support & JSIMD_3DNOW) + else jsimd_convsamp_float_3dnow(sample_data, start_col, workspace); } @@ -888,7 +888,7 @@ jsimd_fdct_islow (DCTELEM *data) jsimd_fdct_islow_avx2(data); else if (simd_support & JSIMD_SSE2) jsimd_fdct_islow_sse2(data); - else if (simd_support & JSIMD_MMX) + else jsimd_fdct_islow_mmx(data); } @@ -897,7 +897,7 @@ jsimd_fdct_ifast (DCTELEM *data) { if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) jsimd_fdct_ifast_sse2(data); - else if (simd_support & JSIMD_MMX) + else jsimd_fdct_ifast_mmx(data); } @@ -964,7 +964,7 @@ jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, jsimd_quantize_avx2(coef_block, divisors, workspace); else if (simd_support & JSIMD_SSE2) jsimd_quantize_sse2(coef_block, divisors, workspace); - else if (simd_support & JSIMD_MMX) + else jsimd_quantize_mmx(coef_block, divisors, workspace); } @@ -976,7 +976,7 @@ jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, jsimd_quantize_float_sse2(coef_block, divisors, workspace); else if (simd_support & JSIMD_SSE) jsimd_quantize_float_sse(coef_block, divisors, workspace); - else if (simd_support & JSIMD_3DNOW) + else jsimd_quantize_float_3dnow(coef_block, divisors, workspace); } @@ -1038,7 +1038,7 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, 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); - else if (simd_support & JSIMD_MMX) + else jsimd_idct_2x2_mmx(compptr->dct_table, coef_block, output_buf, output_col); } @@ -1050,7 +1050,7 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, 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); - else if (simd_support & JSIMD_MMX) + else jsimd_idct_4x4_mmx(compptr->dct_table, coef_block, output_buf, output_col); } @@ -1147,7 +1147,7 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, else if (simd_support & JSIMD_SSE2) jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf, output_col); - else if (simd_support & JSIMD_MMX) + else jsimd_idct_islow_mmx(compptr->dct_table, coef_block, output_buf, output_col); } @@ -1160,7 +1160,7 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, 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); - else if (simd_support & JSIMD_MMX) + else jsimd_idct_ifast_mmx(compptr->dct_table, coef_block, output_buf, output_col); } @@ -1176,7 +1176,7 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, else if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse)) jsimd_idct_float_sse(compptr->dct_table, coef_block, output_buf, output_col); - else if (simd_support & JSIMD_3DNOW) + else jsimd_idct_float_3dnow(compptr->dct_table, coef_block, output_buf, output_col); } diff --git a/simd/jsimd.h b/simd/jsimd.h index da152eb..2fe13d8 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -15,15 +15,15 @@ /* Bitmask for supported acceleration methods */ -#define JSIMD_NONE 0x00 -#define JSIMD_MMX 0x01 -#define JSIMD_3DNOW 0x02 -#define JSIMD_SSE 0x04 -#define JSIMD_SSE2 0x08 -#define JSIMD_ARM_NEON 0x10 -#define JSIMD_MIPS_DSPR2 0x20 -#define JSIMD_ALTIVEC 0x40 -#define JSIMD_AVX2 0x80 +#define JSIMD_NONE 0x00 +#define JSIMD_MMX 0x01 +#define JSIMD_3DNOW 0x02 +#define JSIMD_SSE 0x04 +#define JSIMD_SSE2 0x08 +#define JSIMD_NEON 0x10 +#define JSIMD_DSPR2 0x20 +#define JSIMD_ALTIVEC 0x40 +#define JSIMD_AVX2 0x80 /* SIMD Ext: retrieve SIMD/CPU information */ EXTERN(unsigned int) jpeg_simd_cpu_support (void); @@ -126,25 +126,25 @@ EXTERN(void) jsimd_extbgr_ycc_convert_neon_slowld3 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_rgb_ycc_convert_mips_dspr2 +EXTERN(void) jsimd_rgb_ycc_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extrgb_ycc_convert_mips_dspr2 +EXTERN(void) jsimd_extrgb_ycc_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extrgbx_ycc_convert_mips_dspr2 +EXTERN(void) jsimd_extrgbx_ycc_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extbgr_ycc_convert_mips_dspr2 +EXTERN(void) jsimd_extbgr_ycc_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extbgrx_ycc_convert_mips_dspr2 +EXTERN(void) jsimd_extbgrx_ycc_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extxbgr_ycc_convert_mips_dspr2 +EXTERN(void) jsimd_extxbgr_ycc_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extxrgb_ycc_convert_mips_dspr2 +EXTERN(void) jsimd_extxrgb_ycc_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); @@ -239,25 +239,25 @@ EXTERN(void) jsimd_extxrgb_gray_convert_avx2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_rgb_gray_convert_mips_dspr2 +EXTERN(void) jsimd_rgb_gray_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extrgb_gray_convert_mips_dspr2 +EXTERN(void) jsimd_extrgb_gray_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extrgbx_gray_convert_mips_dspr2 +EXTERN(void) jsimd_extrgbx_gray_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extbgr_gray_convert_mips_dspr2 +EXTERN(void) jsimd_extbgr_gray_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extbgrx_gray_convert_mips_dspr2 +EXTERN(void) jsimd_extbgrx_gray_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extxbgr_gray_convert_mips_dspr2 +EXTERN(void) jsimd_extxbgr_gray_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); -EXTERN(void) jsimd_extxrgb_gray_convert_mips_dspr2 +EXTERN(void) jsimd_extxrgb_gray_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); @@ -384,25 +384,25 @@ EXTERN(void) jsimd_ycc_extbgr_convert_neon_slowst3 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); -EXTERN(void) jsimd_ycc_rgb_convert_mips_dspr2 +EXTERN(void) jsimd_ycc_rgb_convert_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); -EXTERN(void) jsimd_ycc_extrgb_convert_mips_dspr2 +EXTERN(void) jsimd_ycc_extrgb_convert_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); -EXTERN(void) jsimd_ycc_extrgbx_convert_mips_dspr2 +EXTERN(void) jsimd_ycc_extrgbx_convert_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); -EXTERN(void) jsimd_ycc_extbgr_convert_mips_dspr2 +EXTERN(void) jsimd_ycc_extbgr_convert_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); -EXTERN(void) jsimd_ycc_extbgrx_convert_mips_dspr2 +EXTERN(void) jsimd_ycc_extbgrx_convert_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); -EXTERN(void) jsimd_ycc_extxbgr_convert_mips_dspr2 +EXTERN(void) jsimd_ycc_extxbgr_convert_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); -EXTERN(void) jsimd_ycc_extxrgb_convert_mips_dspr2 +EXTERN(void) jsimd_ycc_extxrgb_convert_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); @@ -429,77 +429,77 @@ EXTERN(void) jsimd_ycc_extxrgb_convert_altivec JSAMPARRAY output_buf, int num_rows); /* NULL Colorspace Conversion */ -EXTERN(void) jsimd_c_null_convert_mips_dspr2 +EXTERN(void) jsimd_c_null_convert_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows, int num_components); /* h2v1 Downsampling */ EXTERN(void) jsimd_h2v1_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v1_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v1_downsample_avx2 (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v1_downsample_neon (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); -EXTERN(void) jsimd_h2v1_downsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_downsample_dspr2 (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); /* h2v2 Downsampling */ EXTERN(void) jsimd_h2v2_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v2_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v2_downsample_avx2 (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v2_downsample_neon (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); -EXTERN(void) jsimd_h2v2_downsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_downsample_dspr2 (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, - JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JDIMENSION v_samp_factor, JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); /* h2v2 Smooth Downsampling */ -EXTERN(void) jsimd_h2v2_smooth_downsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_smooth_downsample_dspr2 (JSAMPARRAY input_data, JSAMPARRAY output_data, JDIMENSION v_samp_factor, int max_v_samp_factor, - int smoothing_factor, JDIMENSION width_blocks, + int smoothing_factor, JDIMENSION width_in_blocks, JDIMENSION image_width); @@ -525,14 +525,14 @@ EXTERN(void) jsimd_h2v2_upsample_avx2 (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); -EXTERN(void) jsimd_h2v1_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_upsample_dspr2 (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); -EXTERN(void) jsimd_h2v2_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_upsample_dspr2 (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); -EXTERN(void) jsimd_int_upsample_mips_dspr2 +EXTERN(void) jsimd_int_upsample_dspr2 (UINT8 h_expand, UINT8 v_expand, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr, JDIMENSION output_width, int max_v_samp_factor); @@ -572,10 +572,10 @@ EXTERN(void) jsimd_h2v1_fancy_upsample_neon (int max_v_samp_factor, JDIMENSION downsampled_width, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); -EXTERN(void) jsimd_h2v1_fancy_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_fancy_upsample_dspr2 (int max_v_samp_factor, JDIMENSION downsampled_width, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); -EXTERN(void) jsimd_h2v2_fancy_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_fancy_upsample_dspr2 (int max_v_samp_factor, JDIMENSION downsampled_width, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); @@ -721,47 +721,47 @@ EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_avx2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); -EXTERN(void) jsimd_h2v1_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v2_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); -EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2 +EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); @@ -822,7 +822,7 @@ EXTERN(void) jsimd_convsamp_avx2 EXTERN(void) jsimd_convsamp_neon (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace); -EXTERN(void) jsimd_convsamp_mips_dspr2 +EXTERN(void) jsimd_convsamp_dspr2 (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace); EXTERN(void) jsimd_convsamp_altivec @@ -838,7 +838,7 @@ EXTERN(void) jsimd_convsamp_float_sse EXTERN(void) jsimd_convsamp_float_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace); -EXTERN(void) jsimd_convsamp_float_mips_dspr2 +EXTERN(void) jsimd_convsamp_float_dspr2 (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace); /* Slow Integer Forward DCT */ @@ -852,7 +852,7 @@ EXTERN(void) jsimd_fdct_islow_avx2 (DCTELEM *data); EXTERN(void) jsimd_fdct_islow_neon (DCTELEM *data); -EXTERN(void) jsimd_fdct_islow_mips_dspr2 (DCTELEM *data); +EXTERN(void) jsimd_fdct_islow_dspr2 (DCTELEM *data); EXTERN(void) jsimd_fdct_islow_altivec (DCTELEM *data); @@ -864,7 +864,7 @@ EXTERN(void) jsimd_fdct_ifast_sse2 (DCTELEM *data); EXTERN(void) jsimd_fdct_ifast_neon (DCTELEM *data); -EXTERN(void) jsimd_fdct_ifast_mips_dspr2 (DCTELEM *data); +EXTERN(void) jsimd_fdct_ifast_dspr2 (DCTELEM *data); EXTERN(void) jsimd_fdct_ifast_altivec (DCTELEM *data); @@ -887,7 +887,7 @@ EXTERN(void) jsimd_quantize_avx2 EXTERN(void) jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace); -EXTERN(void) jsimd_quantize_mips_dspr2 +EXTERN(void) jsimd_quantize_dspr2 (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace); EXTERN(void) jsimd_quantize_altivec @@ -903,7 +903,7 @@ EXTERN(void) jsimd_quantize_float_sse EXTERN(void) jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace); -EXTERN(void) jsimd_quantize_float_mips_dspr2 +EXTERN(void) jsimd_quantize_float_dspr2 (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace); /* Scaled Inverse DCT */ @@ -929,18 +929,18 @@ EXTERN(void) jsimd_idct_4x4_neon (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); -EXTERN(void) jsimd_idct_2x2_mips_dspr2 +EXTERN(void) jsimd_idct_2x2_dspr2 (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); -EXTERN(void) jsimd_idct_4x4_mips_dspr2 +EXTERN(void) jsimd_idct_4x4_dspr2 (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col, int *workspace); -EXTERN(void) jsimd_idct_6x6_mips_dspr2 +EXTERN(void) jsimd_idct_6x6_dspr2 (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); -EXTERN(void) jsimd_idct_12x12_pass1_mips_dspr2 +EXTERN(void) jsimd_idct_12x12_pass1_dspr2 (JCOEFPTR coef_block, void *dct_table, int *workspace); -EXTERN(void) jsimd_idct_12x12_pass2_mips_dspr2 +EXTERN(void) jsimd_idct_12x12_pass2_dspr2 (int *workspace, int *output); /* Slow Integer Inverse DCT */ @@ -962,7 +962,7 @@ EXTERN(void) jsimd_idct_islow_neon (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); -EXTERN(void) jsimd_idct_islow_mips_dspr2 +EXTERN(void) jsimd_idct_islow_dspr2 (void *dct_table, JCOEFPTR coef_block, int *output_buf, JSAMPLE *output_col); @@ -984,10 +984,10 @@ EXTERN(void) jsimd_idct_ifast_neon (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); -EXTERN(void) jsimd_idct_ifast_cols_mips_dspr2 +EXTERN(void) jsimd_idct_ifast_cols_dspr2 (JCOEF *inptr, IFAST_MULT_TYPE *quantptr, DCTELEM *wsptr, const int *idct_coefs); -EXTERN(void) jsimd_idct_ifast_rows_mips_dspr2 +EXTERN(void) jsimd_idct_ifast_rows_dspr2 (DCTELEM *wsptr, JSAMPARRAY output_buf, JDIMENSION output_col, const int *idct_coefs); diff --git a/simd/mips/jsimd.c b/simd/mips/jsimd.c index 05ab13a..79dcdf8 100644 --- a/simd/mips/jsimd.c +++ b/simd/mips/jsimd.c @@ -43,7 +43,7 @@ parse_proc_cpuinfo(const char* search_string) while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f) != NULL) { if (strstr(cpuinfo_line, search_string) != NULL) { fclose(f); - simd_support |= JSIMD_MIPS_DSPR2; + simd_support |= JSIMD_DSPR2; return 1; } } @@ -71,7 +71,7 @@ init_simd (void) simd_support = 0; #if defined(__MIPSEL__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2) - simd_support |= JSIMD_MIPS_DSPR2; + simd_support |= JSIMD_DSPR2; #elif defined(__linux__) /* We still have a chance to use MIPS DSPR2 regardless of globally used * -mdspr2 options passed to gcc by performing runtime detection via @@ -83,7 +83,7 @@ init_simd (void) /* Force different settings through environment variables */ env = getenv("JSIMD_FORCEDSPR2"); if ((env != NULL) && (strcmp(env, "1") == 0)) - simd_support = JSIMD_MIPS_DSPR2; + simd_support = JSIMD_DSPR2; env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; @@ -128,7 +128,7 @@ jsimd_can_rgb_ycc (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -147,7 +147,7 @@ jsimd_can_rgb_gray (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -166,7 +166,7 @@ jsimd_can_ycc_rgb (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -189,7 +189,7 @@ jsimd_c_can_null_convert (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -200,40 +200,37 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { - void (*mipsdspr2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); + void (*dspr2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); switch(cinfo->in_color_space) { case JCS_EXT_RGB: - mipsdspr2fct=jsimd_extrgb_ycc_convert_mips_dspr2; + dspr2fct=jsimd_extrgb_ycc_convert_dspr2; break; case JCS_EXT_RGBX: case JCS_EXT_RGBA: - mipsdspr2fct=jsimd_extrgbx_ycc_convert_mips_dspr2; + dspr2fct=jsimd_extrgbx_ycc_convert_dspr2; break; case JCS_EXT_BGR: - mipsdspr2fct=jsimd_extbgr_ycc_convert_mips_dspr2; + dspr2fct=jsimd_extbgr_ycc_convert_dspr2; break; case JCS_EXT_BGRX: case JCS_EXT_BGRA: - mipsdspr2fct=jsimd_extbgrx_ycc_convert_mips_dspr2; + dspr2fct=jsimd_extbgrx_ycc_convert_dspr2; break; case JCS_EXT_XBGR: case JCS_EXT_ABGR: - mipsdspr2fct=jsimd_extxbgr_ycc_convert_mips_dspr2; - + dspr2fct=jsimd_extxbgr_ycc_convert_dspr2; break; case JCS_EXT_XRGB: case JCS_EXT_ARGB: - mipsdspr2fct=jsimd_extxrgb_ycc_convert_mips_dspr2; + dspr2fct=jsimd_extxrgb_ycc_convert_dspr2; break; default: - mipsdspr2fct=jsimd_extrgb_ycc_convert_mips_dspr2; + dspr2fct=jsimd_extrgb_ycc_convert_dspr2; break; } - if (simd_support & JSIMD_MIPS_DSPR2) - mipsdspr2fct(cinfo->image_width, input_buf, output_buf, output_row, - num_rows); + dspr2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } GLOBAL(void) @@ -241,39 +238,37 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { - void (*mipsdspr2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); + void (*dspr2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); switch(cinfo->in_color_space) { case JCS_EXT_RGB: - mipsdspr2fct=jsimd_extrgb_gray_convert_mips_dspr2; + dspr2fct=jsimd_extrgb_gray_convert_dspr2; break; case JCS_EXT_RGBX: case JCS_EXT_RGBA: - mipsdspr2fct=jsimd_extrgbx_gray_convert_mips_dspr2; + dspr2fct=jsimd_extrgbx_gray_convert_dspr2; break; case JCS_EXT_BGR: - mipsdspr2fct=jsimd_extbgr_gray_convert_mips_dspr2; + dspr2fct=jsimd_extbgr_gray_convert_dspr2; break; case JCS_EXT_BGRX: case JCS_EXT_BGRA: - mipsdspr2fct=jsimd_extbgrx_gray_convert_mips_dspr2; + dspr2fct=jsimd_extbgrx_gray_convert_dspr2; break; case JCS_EXT_XBGR: case JCS_EXT_ABGR: - mipsdspr2fct=jsimd_extxbgr_gray_convert_mips_dspr2; + dspr2fct=jsimd_extxbgr_gray_convert_dspr2; break; case JCS_EXT_XRGB: case JCS_EXT_ARGB: - mipsdspr2fct=jsimd_extxrgb_gray_convert_mips_dspr2; + dspr2fct=jsimd_extxrgb_gray_convert_dspr2; break; default: - mipsdspr2fct=jsimd_extrgb_gray_convert_mips_dspr2; + dspr2fct=jsimd_extrgb_gray_convert_dspr2; break; } - if (simd_support & JSIMD_MIPS_DSPR2) - mipsdspr2fct(cinfo->image_width, input_buf, output_buf, output_row, - num_rows); + dspr2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } GLOBAL(void) @@ -281,39 +276,37 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) { - void (*mipsdspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); + void (*dspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); switch(cinfo->out_color_space) { case JCS_EXT_RGB: - mipsdspr2fct=jsimd_ycc_extrgb_convert_mips_dspr2; + dspr2fct=jsimd_ycc_extrgb_convert_dspr2; break; case JCS_EXT_RGBX: case JCS_EXT_RGBA: - mipsdspr2fct=jsimd_ycc_extrgbx_convert_mips_dspr2; + dspr2fct=jsimd_ycc_extrgbx_convert_dspr2; break; case JCS_EXT_BGR: - mipsdspr2fct=jsimd_ycc_extbgr_convert_mips_dspr2; + dspr2fct=jsimd_ycc_extbgr_convert_dspr2; break; case JCS_EXT_BGRX: case JCS_EXT_BGRA: - mipsdspr2fct=jsimd_ycc_extbgrx_convert_mips_dspr2; + dspr2fct=jsimd_ycc_extbgrx_convert_dspr2; break; case JCS_EXT_XBGR: case JCS_EXT_ABGR: - mipsdspr2fct=jsimd_ycc_extxbgr_convert_mips_dspr2; + dspr2fct=jsimd_ycc_extxbgr_convert_dspr2; break; case JCS_EXT_XRGB: case JCS_EXT_ARGB: - mipsdspr2fct=jsimd_ycc_extxrgb_convert_mips_dspr2; + dspr2fct=jsimd_ycc_extxrgb_convert_dspr2; break; - default: - mipsdspr2fct=jsimd_ycc_extrgb_convert_mips_dspr2; + default: + dspr2fct=jsimd_ycc_extrgb_convert_dspr2; break; } - if (simd_support & JSIMD_MIPS_DSPR2) - mipsdspr2fct(cinfo->output_width, input_buf, input_row, output_buf, - num_rows); + dspr2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); } GLOBAL(void) @@ -328,10 +321,8 @@ jsimd_c_null_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_c_null_convert_mips_dspr2(cinfo->image_width, input_buf, - output_buf, output_row, num_rows, - cinfo->num_components); + jsimd_c_null_convert_dspr2(cinfo->image_width, input_buf, output_buf, + output_row, num_rows, cinfo->num_components); } GLOBAL(int) @@ -345,7 +336,7 @@ jsimd_can_h2v2_downsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -364,7 +355,7 @@ jsimd_can_h2v2_smooth_downsample (void) if(DCTSIZE != 8) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -381,7 +372,7 @@ jsimd_can_h2v1_downsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -391,12 +382,9 @@ GLOBAL(void) jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_h2v2_downsample_mips_dspr2(cinfo->image_width, - cinfo->max_v_samp_factor, - compptr->v_samp_factor, - compptr->width_in_blocks, input_data, - output_data); + jsimd_h2v2_downsample_dspr2(cinfo->image_width, cinfo->max_v_samp_factor, + compptr->v_samp_factor, compptr->width_in_blocks, + input_data, output_data); } GLOBAL(void) @@ -404,24 +392,21 @@ jsimd_h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { - jsimd_h2v2_smooth_downsample_mips_dspr2(input_data, output_data, - compptr->v_samp_factor, - cinfo->max_v_samp_factor, - cinfo->smoothing_factor, - compptr->width_in_blocks, - cinfo->image_width); + jsimd_h2v2_smooth_downsample_dspr2(input_data, output_data, + compptr->v_samp_factor, + cinfo->max_v_samp_factor, + cinfo->smoothing_factor, + compptr->width_in_blocks, + cinfo->image_width); } GLOBAL(void) jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_h2v1_downsample_mips_dspr2(cinfo->image_width, - cinfo->max_v_samp_factor, - compptr->v_samp_factor, - compptr->width_in_blocks, - input_data, output_data); + jsimd_h2v1_downsample_dspr2(cinfo->image_width, cinfo->max_v_samp_factor, + compptr->v_samp_factor, compptr->width_in_blocks, + input_data, output_data); } GLOBAL(int) @@ -435,7 +420,7 @@ jsimd_can_h2v2_upsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -452,7 +437,7 @@ jsimd_can_h2v1_upsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -469,7 +454,7 @@ jsimd_can_int_upsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -481,10 +466,8 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_h2v2_upsample_mips_dspr2(cinfo->max_v_samp_factor, - cinfo->output_width, input_data, - output_data_ptr); + jsimd_h2v2_upsample_dspr2(cinfo->max_v_samp_factor, cinfo->output_width, + input_data, output_data_ptr); } GLOBAL(void) @@ -493,10 +476,8 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_h2v1_upsample_mips_dspr2(cinfo->max_v_samp_factor, - cinfo->output_width, input_data, - output_data_ptr); + jsimd_h2v1_upsample_dspr2(cinfo->max_v_samp_factor, cinfo->output_width, + input_data, output_data_ptr); } GLOBAL(void) @@ -505,11 +486,10 @@ jsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - jsimd_int_upsample_mips_dspr2(upsample->h_expand[compptr->component_index], - upsample->v_expand[compptr->component_index], - input_data, output_data_ptr, - cinfo->output_width, - cinfo->max_v_samp_factor); + jsimd_int_upsample_dspr2(upsample->h_expand[compptr->component_index], + upsample->v_expand[compptr->component_index], + input_data, output_data_ptr, cinfo->output_width, + cinfo->max_v_samp_factor); } GLOBAL(int) @@ -523,7 +503,7 @@ jsimd_can_h2v2_fancy_upsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -540,7 +520,7 @@ jsimd_can_h2v1_fancy_upsample (void) if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -552,10 +532,9 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_h2v2_fancy_upsample_mips_dspr2(cinfo->max_v_samp_factor, - compptr->downsampled_width, - input_data, output_data_ptr); + jsimd_h2v2_fancy_upsample_dspr2(cinfo->max_v_samp_factor, + compptr->downsampled_width, input_data, + output_data_ptr); } GLOBAL(void) @@ -564,10 +543,9 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_h2v1_fancy_upsample_mips_dspr2(cinfo->max_v_samp_factor, - compptr->downsampled_width, - input_data, output_data_ptr); + jsimd_h2v1_fancy_upsample_dspr2(cinfo->max_v_samp_factor, + compptr->downsampled_width, input_data, + output_data_ptr); } GLOBAL(int) @@ -575,12 +553,13 @@ jsimd_can_h2v2_merged_upsample (void) { init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -591,12 +570,13 @@ jsimd_can_h2v1_merged_upsample (void) { init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -608,39 +588,38 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf) { - void (*mipsdspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, - JSAMPLE *); + void (*dspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, JSAMPLE *); switch(cinfo->out_color_space) { case JCS_EXT_RGB: - mipsdspr2fct=jsimd_h2v2_extrgb_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v2_extrgb_merged_upsample_dspr2; break; case JCS_EXT_RGBX: case JCS_EXT_RGBA: - mipsdspr2fct=jsimd_h2v2_extrgbx_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v2_extrgbx_merged_upsample_dspr2; break; case JCS_EXT_BGR: - mipsdspr2fct=jsimd_h2v2_extbgr_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v2_extbgr_merged_upsample_dspr2; break; case JCS_EXT_BGRX: case JCS_EXT_BGRA: - mipsdspr2fct=jsimd_h2v2_extbgrx_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v2_extbgrx_merged_upsample_dspr2; break; case JCS_EXT_XBGR: case JCS_EXT_ABGR: - mipsdspr2fct=jsimd_h2v2_extxbgr_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v2_extxbgr_merged_upsample_dspr2; break; case JCS_EXT_XRGB: case JCS_EXT_ARGB: - mipsdspr2fct=jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v2_extxrgb_merged_upsample_dspr2; break; default: - mipsdspr2fct=jsimd_h2v2_extrgb_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v2_extrgb_merged_upsample_dspr2; break; } - mipsdspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf, - cinfo->sample_range_limit); + dspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf, + cinfo->sample_range_limit); } GLOBAL(void) @@ -649,39 +628,38 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf) { - void (*mipsdspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, - JSAMPLE *); + void (*dspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, JSAMPLE *); switch(cinfo->out_color_space) { case JCS_EXT_RGB: - mipsdspr2fct=jsimd_h2v1_extrgb_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v1_extrgb_merged_upsample_dspr2; break; case JCS_EXT_RGBX: case JCS_EXT_RGBA: - mipsdspr2fct=jsimd_h2v1_extrgbx_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v1_extrgbx_merged_upsample_dspr2; break; case JCS_EXT_BGR: - mipsdspr2fct=jsimd_h2v1_extbgr_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v1_extbgr_merged_upsample_dspr2; break; case JCS_EXT_BGRX: case JCS_EXT_BGRA: - mipsdspr2fct=jsimd_h2v1_extbgrx_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v1_extbgrx_merged_upsample_dspr2; break; case JCS_EXT_XBGR: case JCS_EXT_ABGR: - mipsdspr2fct=jsimd_h2v1_extxbgr_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v1_extxbgr_merged_upsample_dspr2; break; case JCS_EXT_XRGB: case JCS_EXT_ARGB: - mipsdspr2fct=jsimd_h2v1_extxrgb_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v1_extxrgb_merged_upsample_dspr2; break; default: - mipsdspr2fct=jsimd_h2v1_extrgb_merged_upsample_mips_dspr2; + dspr2fct=jsimd_h2v1_extrgb_merged_upsample_dspr2; break; } - mipsdspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf, - cinfo->sample_range_limit); + dspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf, + cinfo->sample_range_limit); } GLOBAL(int) @@ -699,7 +677,7 @@ jsimd_can_convsamp (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -722,7 +700,7 @@ jsimd_can_convsamp_float (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -732,16 +710,14 @@ GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_convsamp_mips_dspr2(sample_data, start_col, workspace); + jsimd_convsamp_dspr2(sample_data, start_col, workspace); } GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace) { - if ((simd_support & JSIMD_MIPS_DSPR2)) - jsimd_convsamp_float_mips_dspr2(sample_data, start_col, workspace); + jsimd_convsamp_float_dspr2(sample_data, start_col, workspace); } GLOBAL(int) @@ -755,7 +731,7 @@ jsimd_can_fdct_islow (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -772,7 +748,7 @@ jsimd_can_fdct_ifast (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -781,23 +757,19 @@ jsimd_can_fdct_ifast (void) GLOBAL(int) jsimd_can_fdct_float (void) { - init_simd(); - return 0; } GLOBAL(void) jsimd_fdct_islow (DCTELEM *data) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_fdct_islow_mips_dspr2(data); + jsimd_fdct_islow_dspr2(data); } GLOBAL(void) jsimd_fdct_ifast (DCTELEM *data) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_fdct_ifast_mips_dspr2(data); + jsimd_fdct_ifast_dspr2(data); } GLOBAL(void) @@ -818,7 +790,7 @@ jsimd_can_quantize (void) if (sizeof(DCTELEM) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -841,7 +813,7 @@ jsimd_can_quantize_float (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -851,16 +823,14 @@ GLOBAL(void) jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_quantize_mips_dspr2(coef_block, divisors, workspace); + jsimd_quantize_dspr2(coef_block, divisors, workspace); } GLOBAL(void) jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_quantize_float_mips_dspr2(coef_block, divisors, workspace); + jsimd_quantize_float_dspr2(coef_block, divisors, workspace); } GLOBAL(int) @@ -880,7 +850,7 @@ jsimd_can_idct_2x2 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -903,7 +873,7 @@ jsimd_can_idct_4x4 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -926,7 +896,7 @@ jsimd_can_idct_6x6 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -948,7 +918,7 @@ jsimd_can_idct_12x12 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -959,9 +929,7 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_idct_2x2_mips_dspr2(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_2x2_dspr2(compptr->dct_table, coef_block, output_buf, output_col); } GLOBAL(void) @@ -969,48 +937,43 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_MIPS_DSPR2) { - int workspace[DCTSIZE*4]; /* buffers data between passes */ - jsimd_idct_4x4_mips_dspr2(compptr->dct_table, coef_block, output_buf, - output_col, workspace); - } + int workspace[DCTSIZE*4]; /* buffers data between passes */ + + jsimd_idct_4x4_dspr2(compptr->dct_table, coef_block, output_buf, output_col, + workspace); } GLOBAL(void) jsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, - JDIMENSION output_col) + JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col) { - if (simd_support & JSIMD_MIPS_DSPR2) - jsimd_idct_6x6_mips_dspr2(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_6x6_dspr2(compptr->dct_table, coef_block, output_buf, output_col); } GLOBAL(void) jsimd_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) + JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col) { - if (simd_support & JSIMD_MIPS_DSPR2) { - int workspace[96]; - int output[12] = { - (int)(output_buf[0] + output_col), - (int)(output_buf[1] + output_col), - (int)(output_buf[2] + output_col), - (int)(output_buf[3] + output_col), - (int)(output_buf[4] + output_col), - (int)(output_buf[5] + output_col), - (int)(output_buf[6] + output_col), - (int)(output_buf[7] + output_col), - (int)(output_buf[8] + output_col), - (int)(output_buf[9] + output_col), - (int)(output_buf[10] + output_col), - (int)(output_buf[11] + output_col), - }; - jsimd_idct_12x12_pass1_mips_dspr2(coef_block, compptr->dct_table, - workspace); - jsimd_idct_12x12_pass2_mips_dspr2(workspace, output); - } + int workspace[96]; + int output[12] = { + (int)(output_buf[0] + output_col), + (int)(output_buf[1] + output_col), + (int)(output_buf[2] + output_col), + (int)(output_buf[3] + output_col), + (int)(output_buf[4] + output_col), + (int)(output_buf[5] + output_col), + (int)(output_buf[6] + output_col), + (int)(output_buf[7] + output_col), + (int)(output_buf[8] + output_col), + (int)(output_buf[9] + output_col), + (int)(output_buf[10] + output_col), + (int)(output_buf[11] + output_col) + }; + + jsimd_idct_12x12_pass1_dspr2(coef_block, compptr->dct_table, workspace); + jsimd_idct_12x12_pass2_dspr2(workspace, output); } GLOBAL(int) @@ -1030,7 +993,7 @@ jsimd_can_idct_islow (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -1055,7 +1018,7 @@ jsimd_can_idct_ifast (void) if (IFAST_SCALE_BITS != 2) return 0; - if (simd_support & JSIMD_MIPS_DSPR2) + if (simd_support & JSIMD_DSPR2) return 1; return 0; @@ -1064,8 +1027,6 @@ jsimd_can_idct_ifast (void) GLOBAL(int) jsimd_can_idct_float (void) { - init_simd(); - return 0; } @@ -1074,21 +1035,19 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_MIPS_DSPR2) { - int output[8] = { - (int)(output_buf[0] + output_col), - (int)(output_buf[1] + output_col), - (int)(output_buf[2] + output_col), - (int)(output_buf[3] + output_col), - (int)(output_buf[4] + output_col), - (int)(output_buf[5] + output_col), - (int)(output_buf[6] + output_col), - (int)(output_buf[7] + output_col), - }; - - jsimd_idct_islow_mips_dspr2(coef_block, compptr->dct_table, - output, IDCT_range_limit(cinfo)); - } + int output[8] = { + (int)(output_buf[0] + output_col), + (int)(output_buf[1] + output_col), + (int)(output_buf[2] + output_col), + (int)(output_buf[3] + output_col), + (int)(output_buf[4] + output_col), + (int)(output_buf[5] + output_col), + (int)(output_buf[6] + output_col), + (int)(output_buf[7] + output_col) + }; + + jsimd_idct_islow_dspr2(coef_block, compptr->dct_table, output, + IDCT_range_limit(cinfo)); } GLOBAL(void) @@ -1096,26 +1055,24 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_MIPS_DSPR2) { - JCOEFPTR inptr; - IFAST_MULT_TYPE *quantptr; - DCTELEM workspace[DCTSIZE2]; /* buffers data between passes */ + JCOEFPTR inptr; + IFAST_MULT_TYPE *quantptr; + DCTELEM workspace[DCTSIZE2]; /* buffers data between passes */ - /* Pass 1: process columns from input, store into work array. */ + /* Pass 1: process columns from input, store into work array. */ - inptr = coef_block; - quantptr = (IFAST_MULT_TYPE *) compptr->dct_table; + inptr = coef_block; + quantptr = (IFAST_MULT_TYPE *) compptr->dct_table; - jsimd_idct_ifast_cols_mips_dspr2(inptr, quantptr, - workspace, mips_idct_ifast_coefs); + jsimd_idct_ifast_cols_dspr2(inptr, quantptr, workspace, + mips_idct_ifast_coefs); - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ - jsimd_idct_ifast_rows_mips_dspr2(workspace, output_buf, - output_col, mips_idct_ifast_coefs); - } + jsimd_idct_ifast_rows_dspr2(workspace, output_buf, output_col, + mips_idct_ifast_coefs); } GLOBAL(void) diff --git a/simd/mips/jsimd_dspr2.S b/simd/mips/jsimd_dspr2.S index 60ff6f9..af2affe 100644 --- a/simd/mips/jsimd_dspr2.S +++ b/simd/mips/jsimd_dspr2.S @@ -2,10 +2,11 @@ * MIPS DSPr2 optimizations for libjpeg-turbo * * Copyright (C) 2013-2014, MIPS Technologies, Inc., California. - * All Rights Reserved. - * Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) - * Darko Laus (darko.laus@imgtec.com) + * All Rights Reserved. + * Authors: Teodora Novkovic + * Darko Laus * Copyright (C) 2015, D. R. Commander. All Rights Reserved. + * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. @@ -26,7 +27,7 @@ #include "jsimd_dspr2_asm.h" /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_c_null_convert_mips_dspr2) +LEAF_DSPR2(jsimd_c_null_convert_dspr2) /* * a0 - cinfo->image_width * a1 - input_buf @@ -127,21 +128,21 @@ LEAF_MIPS_DSPR2(jsimd_c_null_convert_mips_dspr2) j ra nop -END(jsimd_c_null_convert_mips_dspr2) +END(jsimd_c_null_convert_dspr2) /*****************************************************************************/ /* - * jsimd_extrgb_ycc_convert_mips_dspr2 - * jsimd_extbgr_ycc_convert_mips_dspr2 - * jsimd_extrgbx_ycc_convert_mips_dspr2 - * jsimd_extbgrx_ycc_convert_mips_dspr2 - * jsimd_extxbgr_ycc_convert_mips_dspr2 - * jsimd_extxrgb_ycc_convert_mips_dspr2 + * jsimd_extrgb_ycc_convert_dspr2 + * jsimd_extbgr_ycc_convert_dspr2 + * jsimd_extrgbx_ycc_convert_dspr2 + * jsimd_extbgrx_ycc_convert_dspr2 + * jsimd_extxbgr_ycc_convert_dspr2 + * jsimd_extxrgb_ycc_convert_dspr2 * * Colorspace conversion RGB -> YCbCr */ -.macro GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs +.macro GENERATE_JSIMD_RGB_YCC_CONVERT_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs .macro DO_RGB_TO_YCC r, \ g, \ @@ -153,7 +154,7 @@ END(jsimd_c_null_convert_mips_dspr2) addiu \inptr, \pixel_size .endm -LEAF_MIPS_DSPR2(jsimd_\colorid\()_ycc_convert_mips_dspr2) +LEAF_DSPR2(jsimd_\colorid\()_ycc_convert_dspr2) /* * a0 - cinfo->image_width * a1 - input_buf @@ -221,33 +222,33 @@ LEAF_MIPS_DSPR2(jsimd_\colorid\()_ycc_convert_mips_dspr2) j ra nop -END(jsimd_\colorid\()_ycc_convert_mips_dspr2) +END(jsimd_\colorid\()_ycc_convert_dspr2) .purgem DO_RGB_TO_YCC .endm -/*------------------------------------------id -- pix R G B */ -GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extrgb, 3, 0, 1, 2 -GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extbgr, 3, 2, 1, 0 -GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extrgbx, 4, 0, 1, 2 -GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extbgrx, 4, 2, 1, 0 -GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extxbgr, 4, 3, 2, 1 -GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3 +/*-------------------------------------id -- pix R G B */ +GENERATE_JSIMD_RGB_YCC_CONVERT_DSPR2 extrgb, 3, 0, 1, 2 +GENERATE_JSIMD_RGB_YCC_CONVERT_DSPR2 extbgr, 3, 2, 1, 0 +GENERATE_JSIMD_RGB_YCC_CONVERT_DSPR2 extrgbx, 4, 0, 1, 2 +GENERATE_JSIMD_RGB_YCC_CONVERT_DSPR2 extbgrx, 4, 2, 1, 0 +GENERATE_JSIMD_RGB_YCC_CONVERT_DSPR2 extxbgr, 4, 3, 2, 1 +GENERATE_JSIMD_RGB_YCC_CONVERT_DSPR2 extxrgb, 4, 1, 2, 3 /*****************************************************************************/ /* - * jsimd_ycc_extrgb_convert_mips_dspr2 - * jsimd_ycc_extbgr_convert_mips_dspr2 - * jsimd_ycc_extrgbx_convert_mips_dspr2 - * jsimd_ycc_extbgrx_convert_mips_dspr2 - * jsimd_ycc_extxbgr_convert_mips_dspr2 - * jsimd_ycc_extxrgb_convert_mips_dspr2 + * jsimd_ycc_extrgb_convert_dspr2 + * jsimd_ycc_extbgr_convert_dspr2 + * jsimd_ycc_extrgbx_convert_dspr2 + * jsimd_ycc_extbgrx_convert_dspr2 + * jsimd_ycc_extxbgr_convert_dspr2 + * jsimd_ycc_extxrgb_convert_dspr2 * * Colorspace conversion YCbCr -> RGB */ -.macro GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs, a_offs +.macro GENERATE_JSIMD_YCC_RGB_CONVERT_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs, a_offs .macro STORE_YCC_TO_RGB scratch0 \ scratch1 \ @@ -263,7 +264,7 @@ GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3 addiu \outptr, \pixel_size .endm -LEAF_MIPS_DSPR2(jsimd_ycc_\colorid\()_convert_mips_dspr2) +LEAF_DSPR2(jsimd_ycc_\colorid\()_convert_dspr2) /* * a0 - cinfo->image_width * a1 - input_buf @@ -338,33 +339,33 @@ LEAF_MIPS_DSPR2(jsimd_ycc_\colorid\()_convert_mips_dspr2) j ra nop -END(jsimd_ycc_\colorid\()_convert_mips_dspr2) +END(jsimd_ycc_\colorid\()_convert_dspr2) .purgem STORE_YCC_TO_RGB .endm -/*------------------------------------------id -- pix R G B A */ -GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extrgb, 3, 0, 1, 2, 3 -GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extbgr, 3, 2, 1, 0, 3 -GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extrgbx, 4, 0, 1, 2, 3 -GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extbgrx, 4, 2, 1, 0, 3 -GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extxbgr, 4, 3, 2, 1, 0 -GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3, 0 +/*-------------------------------------id -- pix R G B A */ +GENERATE_JSIMD_YCC_RGB_CONVERT_DSPR2 extrgb, 3, 0, 1, 2, 3 +GENERATE_JSIMD_YCC_RGB_CONVERT_DSPR2 extbgr, 3, 2, 1, 0, 3 +GENERATE_JSIMD_YCC_RGB_CONVERT_DSPR2 extrgbx, 4, 0, 1, 2, 3 +GENERATE_JSIMD_YCC_RGB_CONVERT_DSPR2 extbgrx, 4, 2, 1, 0, 3 +GENERATE_JSIMD_YCC_RGB_CONVERT_DSPR2 extxbgr, 4, 3, 2, 1, 0 +GENERATE_JSIMD_YCC_RGB_CONVERT_DSPR2 extxrgb, 4, 1, 2, 3, 0 /*****************************************************************************/ /* - * jsimd_extrgb_gray_convert_mips_dspr2 - * jsimd_extbgr_gray_convert_mips_dspr2 - * jsimd_extrgbx_gray_convert_mips_dspr2 - * jsimd_extbgrx_gray_convert_mips_dspr2 - * jsimd_extxbgr_gray_convert_mips_dspr2 - * jsimd_extxrgb_gray_convert_mips_dspr2 + * jsimd_extrgb_gray_convert_dspr2 + * jsimd_extbgr_gray_convert_dspr2 + * jsimd_extrgbx_gray_convert_dspr2 + * jsimd_extbgrx_gray_convert_dspr2 + * jsimd_extxbgr_gray_convert_dspr2 + * jsimd_extxrgb_gray_convert_dspr2 * * Colorspace conversion RGB -> GRAY */ -.macro GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs +.macro GENERATE_JSIMD_RGB_GRAY_CONVERT_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs .macro DO_RGB_TO_GRAY r, \ g, \ @@ -376,7 +377,7 @@ GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3, 0 addiu \inptr, \pixel_size .endm -LEAF_MIPS_DSPR2(jsimd_\colorid\()_gray_convert_mips_dspr2) +LEAF_DSPR2(jsimd_\colorid\()_gray_convert_dspr2) /* * a0 - cinfo->image_width * a1 - input_buf @@ -467,41 +468,41 @@ LEAF_MIPS_DSPR2(jsimd_\colorid\()_gray_convert_mips_dspr2) j ra nop -END(jsimd_\colorid\()_gray_convert_mips_dspr2) +END(jsimd_\colorid\()_gray_convert_dspr2) .purgem DO_RGB_TO_GRAY .endm -/*------------------------------------------id -- pix R G B */ -GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extrgb, 3, 0, 1, 2 -GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extbgr, 3, 2, 1, 0 -GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extrgbx, 4, 0, 1, 2 -GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extbgrx, 4, 2, 1, 0 -GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extxbgr, 4, 3, 2, 1 -GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3 +/*-------------------------------------id -- pix R G B */ +GENERATE_JSIMD_RGB_GRAY_CONVERT_DSPR2 extrgb, 3, 0, 1, 2 +GENERATE_JSIMD_RGB_GRAY_CONVERT_DSPR2 extbgr, 3, 2, 1, 0 +GENERATE_JSIMD_RGB_GRAY_CONVERT_DSPR2 extrgbx, 4, 0, 1, 2 +GENERATE_JSIMD_RGB_GRAY_CONVERT_DSPR2 extbgrx, 4, 2, 1, 0 +GENERATE_JSIMD_RGB_GRAY_CONVERT_DSPR2 extxbgr, 4, 3, 2, 1 +GENERATE_JSIMD_RGB_GRAY_CONVERT_DSPR2 extxrgb, 4, 1, 2, 3 /*****************************************************************************/ /* - * jsimd_h2v2_merged_upsample_mips_dspr2 - * jsimd_h2v2_extrgb_merged_upsample_mips_dspr2 - * jsimd_h2v2_extrgbx_merged_upsample_mips_dspr2 - * jsimd_h2v2_extbgr_merged_upsample_mips_dspr2 - * jsimd_h2v2_extbgrx_merged_upsample_mips_dspr2 - * jsimd_h2v2_extxbgr_merged_upsample_mips_dspr2 - * jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2 + * jsimd_h2v2_merged_upsample_dspr2 + * jsimd_h2v2_extrgb_merged_upsample_dspr2 + * jsimd_h2v2_extrgbx_merged_upsample_dspr2 + * jsimd_h2v2_extbgr_merged_upsample_dspr2 + * jsimd_h2v2_extbgrx_merged_upsample_dspr2 + * jsimd_h2v2_extxbgr_merged_upsample_dspr2 + * jsimd_h2v2_extxrgb_merged_upsample_dspr2 * * Merged h2v2 upsample routines */ -.macro GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 colorid, \ - pixel_size, \ - r1_offs, \ - g1_offs, \ - b1_offs, \ - a1_offs, \ - r2_offs, \ - g2_offs, \ - b2_offs, \ - a2_offs +.macro GENERATE_H2V2_MERGED_UPSAMPLE_DSPR2 colorid, \ + pixel_size, \ + r1_offs, \ + g1_offs, \ + b1_offs, \ + a1_offs, \ + r2_offs, \ + g2_offs, \ + b2_offs, \ + a2_offs .macro STORE_H2V2_2_PIXELS scratch0 \ scratch1 \ @@ -538,7 +539,7 @@ GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3 .endif .endm -LEAF_MIPS_DSPR2(jsimd_h2v2_\colorid\()_merged_upsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v2_\colorid\()_merged_upsample_dspr2) /* * a0 - cinfo->output_width * a1 - input_buf @@ -679,42 +680,42 @@ LEAF_MIPS_DSPR2(jsimd_h2v2_\colorid\()_merged_upsample_mips_dspr2) j ra nop -END(jsimd_h2v2_\colorid\()_merged_upsample_mips_dspr2) +END(jsimd_h2v2_\colorid\()_merged_upsample_dspr2) .purgem STORE_H2V2_1_PIXEL .purgem STORE_H2V2_2_PIXELS .endm -/*-----------------------------------------id -- pix R1 G1 B1 A1 R2 G2 B2 A2 */ -GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extrgb, 6, 0, 1, 2, 6, 3, 4, 5, 6 -GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extbgr, 6, 2, 1, 0, 3, 5, 4, 3, 6 -GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extrgbx, 8, 0, 1, 2, 3, 4, 5, 6, 7 -GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extbgrx, 8, 2, 1, 0, 3, 6, 5, 4, 7 -GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extxbgr, 8, 3, 2, 1, 0, 7, 6, 5, 4 -GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extxrgb, 8, 1, 2, 3, 0, 5, 6, 7, 4 +/*------------------------------------id -- pix R1 G1 B1 A1 R2 G2 B2 A2 */ +GENERATE_H2V2_MERGED_UPSAMPLE_DSPR2 extrgb, 6, 0, 1, 2, 6, 3, 4, 5, 6 +GENERATE_H2V2_MERGED_UPSAMPLE_DSPR2 extbgr, 6, 2, 1, 0, 3, 5, 4, 3, 6 +GENERATE_H2V2_MERGED_UPSAMPLE_DSPR2 extrgbx, 8, 0, 1, 2, 3, 4, 5, 6, 7 +GENERATE_H2V2_MERGED_UPSAMPLE_DSPR2 extbgrx, 8, 2, 1, 0, 3, 6, 5, 4, 7 +GENERATE_H2V2_MERGED_UPSAMPLE_DSPR2 extxbgr, 8, 3, 2, 1, 0, 7, 6, 5, 4 +GENERATE_H2V2_MERGED_UPSAMPLE_DSPR2 extxrgb, 8, 1, 2, 3, 0, 5, 6, 7, 4 /*****************************************************************************/ /* - * jsimd_h2v1_merged_upsample_mips_dspr2 - * jsimd_h2v1_extrgb_merged_upsample_mips_dspr2 - * jsimd_h2v1_extrgbx_merged_upsample_mips_dspr2 - * jsimd_h2v1_extbgr_merged_upsample_mips_dspr2 - * jsimd_h2v1_extbgrx_merged_upsample_mips_dspr2 - * jsimd_h2v1_extxbgr_merged_upsample_mips_dspr2 - * jsimd_h2v1_extxrgb_merged_upsample_mips_dspr2 + * jsimd_h2v1_merged_upsample_dspr2 + * jsimd_h2v1_extrgb_merged_upsample_dspr2 + * jsimd_h2v1_extrgbx_merged_upsample_dspr2 + * jsimd_h2v1_extbgr_merged_upsample_dspr2 + * jsimd_h2v1_extbgrx_merged_upsample_dspr2 + * jsimd_h2v1_extxbgr_merged_upsample_dspr2 + * jsimd_h2v1_extxrgb_merged_upsample_dspr2 * * Merged h2v1 upsample routines */ -.macro GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 colorid, \ - pixel_size, \ - r1_offs, \ - g1_offs, \ - b1_offs, \ - a1_offs, \ - r2_offs, \ - g2_offs, \ - b2_offs, \ - a2_offs +.macro GENERATE_H2V1_MERGED_UPSAMPLE_DSPR2 colorid, \ + pixel_size, \ + r1_offs, \ + g1_offs, \ + b1_offs, \ + a1_offs, \ + r2_offs, \ + g2_offs, \ + b2_offs, \ + a2_offs .macro STORE_H2V1_2_PIXELS scratch0 \ scratch1 \ @@ -750,7 +751,7 @@ GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extxrgb, 8, 1, 2, 3, 0, 5, 6, 7, 4 .endif .endm -LEAF_MIPS_DSPR2(jsimd_h2v1_\colorid\()_merged_upsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v1_\colorid\()_merged_upsample_dspr2) /* * a0 - cinfo->output_width * a1 - input_buf @@ -854,26 +855,26 @@ LEAF_MIPS_DSPR2(jsimd_h2v1_\colorid\()_merged_upsample_mips_dspr2) j ra nop -END(jsimd_h2v1_\colorid\()_merged_upsample_mips_dspr2) +END(jsimd_h2v1_\colorid\()_merged_upsample_dspr2) .purgem STORE_H2V1_1_PIXEL .purgem STORE_H2V1_2_PIXELS .endm -/*-----------------------------------------id -- pix R1 G1 B1 A1 R2 G2 B2 A2 */ -GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extrgb, 6, 0, 1, 2, 6, 3, 4, 5, 6 -GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extbgr, 6, 2, 1, 0, 3, 5, 4, 3, 6 -GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extrgbx, 8, 0, 1, 2, 3, 4, 5, 6, 7 -GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extbgrx, 8, 2, 1, 0, 3, 6, 5, 4, 7 -GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extxbgr, 8, 3, 2, 1, 0, 7, 6, 5, 4 -GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extxrgb, 8, 1, 2, 3, 0, 5, 6, 7, 4 +/*------------------------------------id -- pix R1 G1 B1 A1 R2 G2 B2 A2 */ +GENERATE_H2V1_MERGED_UPSAMPLE_DSPR2 extrgb, 6, 0, 1, 2, 6, 3, 4, 5, 6 +GENERATE_H2V1_MERGED_UPSAMPLE_DSPR2 extbgr, 6, 2, 1, 0, 3, 5, 4, 3, 6 +GENERATE_H2V1_MERGED_UPSAMPLE_DSPR2 extrgbx, 8, 0, 1, 2, 3, 4, 5, 6, 7 +GENERATE_H2V1_MERGED_UPSAMPLE_DSPR2 extbgrx, 8, 2, 1, 0, 3, 6, 5, 4, 7 +GENERATE_H2V1_MERGED_UPSAMPLE_DSPR2 extxbgr, 8, 3, 2, 1, 0, 7, 6, 5, 4 +GENERATE_H2V1_MERGED_UPSAMPLE_DSPR2 extxrgb, 8, 1, 2, 3, 0, 5, 6, 7, 4 /*****************************************************************************/ /* - * jsimd_h2v2_fancy_upsample_mips_dspr2 + * jsimd_h2v2_fancy_upsample_dspr2 * * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical. */ -LEAF_MIPS_DSPR2(jsimd_h2v2_fancy_upsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v2_fancy_upsample_dspr2) /* * a0 - cinfo->max_v_samp_factor * a1 - downsampled_width @@ -998,10 +999,10 @@ LEAF_MIPS_DSPR2(jsimd_h2v2_fancy_upsample_mips_dspr2) j ra nop -END(jsimd_h2v2_fancy_upsample_mips_dspr2) +END(jsimd_h2v2_fancy_upsample_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_h2v1_fancy_upsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v1_fancy_upsample_dspr2) /* * a0 - cinfo->max_v_samp_factor * a1 - downsampled_width @@ -1108,10 +1109,10 @@ LEAF_MIPS_DSPR2(jsimd_h2v1_fancy_upsample_mips_dspr2) j ra nop -END(jsimd_h2v1_fancy_upsample_mips_dspr2) +END(jsimd_h2v1_fancy_upsample_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_h2v1_downsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v1_downsample_dspr2) /* * a0 - cinfo->image_width * a1 - cinfo->max_v_samp_factor @@ -1203,10 +1204,10 @@ LEAF_MIPS_DSPR2(jsimd_h2v1_downsample_mips_dspr2) j ra nop -END(jsimd_h2v1_downsample_mips_dspr2) +END(jsimd_h2v1_downsample_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_h2v2_downsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v2_downsample_dspr2) /* * a0 - cinfo->image_width @@ -1315,9 +1316,10 @@ LEAF_MIPS_DSPR2(jsimd_h2v2_downsample_mips_dspr2) j ra nop -END(jsimd_h2v2_downsample_mips_dspr2) +END(jsimd_h2v2_downsample_dspr2) + /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_h2v2_smooth_downsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v2_smooth_downsample_dspr2) /* * a0 - input_data * a1 - output_data @@ -1615,10 +1617,10 @@ LEAF_MIPS_DSPR2(jsimd_h2v2_smooth_downsample_mips_dspr2) j ra nop -END(jsimd_h2v2_smooth_downsample_mips_dspr2) +END(jsimd_h2v2_smooth_downsample_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_int_upsample_mips_dspr2) +LEAF_DSPR2(jsimd_int_upsample_dspr2) /* * a0 - upsample->h_expand[compptr->component_index] * a1 - upsample->v_expand[compptr->component_index] @@ -1702,10 +1704,10 @@ LEAF_MIPS_DSPR2(jsimd_int_upsample_mips_dspr2) j ra nop -END(jsimd_int_upsample_mips_dspr2) +END(jsimd_int_upsample_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_h2v1_upsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v1_upsample_dspr2) /* * a0 - cinfo->max_v_samp_factor * a1 - cinfo->output_width @@ -1761,10 +1763,10 @@ LEAF_MIPS_DSPR2(jsimd_h2v1_upsample_mips_dspr2) 4: j ra nop -END(jsimd_h2v1_upsample_mips_dspr2) +END(jsimd_h2v1_upsample_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_h2v2_upsample_mips_dspr2) +LEAF_DSPR2(jsimd_h2v2_upsample_dspr2) /* * a0 - cinfo->max_v_samp_factor * a1 - cinfo->output_width @@ -1845,10 +1847,10 @@ LEAF_MIPS_DSPR2(jsimd_h2v2_upsample_mips_dspr2) 7: j ra nop -END(jsimd_h2v2_upsample_mips_dspr2) +END(jsimd_h2v2_upsample_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_islow_mips_dspr2) +LEAF_DSPR2(jsimd_idct_islow_dspr2) /* * a0 - coef_block * a1 - compptr->dcttable @@ -2125,10 +2127,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_islow_mips_dspr2) j ra nop -END(jsimd_idct_islow_mips_dspr2) +END(jsimd_idct_islow_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_ifast_cols_mips_dspr2) +LEAF_DSPR2(jsimd_idct_ifast_cols_dspr2) /* * a0 - inptr * a1 - quantptr @@ -2266,10 +2268,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_ifast_cols_mips_dspr2) j ra nop -END(jsimd_idct_ifast_cols_mips_dspr2) +END(jsimd_idct_ifast_cols_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_ifast_rows_mips_dspr2) +LEAF_DSPR2(jsimd_idct_ifast_rows_dspr2) /* * a0 - wsptr * a1 - output_buf @@ -2417,10 +2419,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_ifast_rows_mips_dspr2) j ra nop -END(jsimd_idct_ifast_rows_mips_dspr2) +END(jsimd_idct_ifast_rows_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_fdct_islow_mips_dspr2) +LEAF_DSPR2(jsimd_fdct_islow_dspr2) /* * a0 - data */ @@ -2581,10 +2583,10 @@ LEAF_MIPS_DSPR2(jsimd_fdct_islow_mips_dspr2) jr ra nop -END(jsimd_fdct_islow_mips_dspr2) +END(jsimd_fdct_islow_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_fdct_ifast_mips_dspr2) +LEAF_DSPR2(jsimd_fdct_ifast_dspr2) /* * a0 - data */ @@ -2726,10 +2728,10 @@ LEAF_MIPS_DSPR2(jsimd_fdct_ifast_mips_dspr2) j ra nop -END(jsimd_fdct_ifast_mips_dspr2) +END(jsimd_fdct_ifast_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_quantize_mips_dspr2) +LEAF_DSPR2(jsimd_quantize_dspr2) /* * a0 - coef_block * a1 - divisors @@ -2826,10 +2828,10 @@ LEAF_MIPS_DSPR2(jsimd_quantize_mips_dspr2) j ra nop -END(jsimd_quantize_mips_dspr2) +END(jsimd_quantize_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_quantize_float_mips_dspr2) +LEAF_DSPR2(jsimd_quantize_float_dspr2) /* * a0 - coef_block * a1 - divisors @@ -2907,9 +2909,10 @@ LEAF_MIPS_DSPR2(jsimd_quantize_float_mips_dspr2) j ra nop -END(jsimd_quantize_float_mips_dspr2) +END(jsimd_quantize_float_dspr2) + /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_2x2_mips_dspr2) +LEAF_DSPR2(jsimd_idct_2x2_dspr2) /* * a0 - compptr->dct_table * a1 - coef_block @@ -3125,10 +3128,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_2x2_mips_dspr2) j ra nop -END(jsimd_idct_2x2_mips_dspr2) +END(jsimd_idct_2x2_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) +LEAF_DSPR2(jsimd_idct_4x4_dspr2) /* * a0 - compptr->dct_table * a1 - coef_block @@ -3485,10 +3488,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) j ra nop -END(jsimd_idct_4x4_mips_dspr2) +END(jsimd_idct_4x4_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_6x6_mips_dspr2) +LEAF_DSPR2(jsimd_idct_6x6_dspr2) /* * a0 - compptr->dct_table * a1 - coef_block @@ -3640,10 +3643,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_6x6_mips_dspr2) j ra nop -END(jsimd_idct_6x6_mips_dspr2) +END(jsimd_idct_6x6_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_12x12_pass1_mips_dspr2) +LEAF_DSPR2(jsimd_idct_12x12_pass1_dspr2) /* * a0 - compptr->dct_table * a1 - coef_block @@ -3798,10 +3801,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_12x12_pass1_mips_dspr2) j ra nop -END(jsimd_idct_12x12_pass1_mips_dspr2) +END(jsimd_idct_12x12_pass1_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_idct_12x12_pass2_mips_dspr2) +LEAF_DSPR2(jsimd_idct_12x12_pass2_dspr2) /* * a0 - workspace * a1 - output @@ -3973,10 +3976,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_12x12_pass2_mips_dspr2) jr ra nop -END(jsimd_idct_12x12_pass2_mips_dspr2) +END(jsimd_idct_12x12_pass2_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_convsamp_mips_dspr2) +LEAF_DSPR2(jsimd_convsamp_dspr2) /* * a0 - sample_data * a1 - start_col @@ -4122,10 +4125,10 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_mips_dspr2) j ra nop -END(jsimd_convsamp_mips_dspr2) +END(jsimd_convsamp_dspr2) /*****************************************************************************/ -LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) +LEAF_DSPR2(jsimd_convsamp_float_dspr2) /* * a0 - sample_data * a1 - start_col @@ -4481,6 +4484,6 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) j ra nop -END(jsimd_convsamp_float_mips_dspr2) +END(jsimd_convsamp_float_dspr2) /*****************************************************************************/ diff --git a/simd/mips/jsimd_dspr2_asm.h b/simd/mips/jsimd_dspr2_asm.h index 8bff9d9..915df4d 100644 --- a/simd/mips/jsimd_dspr2_asm.h +++ b/simd/mips/jsimd_dspr2_asm.h @@ -112,9 +112,9 @@ symbol: .frame sp, 0, ra; \ .set noat; /* - * LEAF_MIPS_DSPR2 - declare leaf routine for MIPS DSPr2 + * LEAF_DSPR2 - declare leaf routine for MIPS DSPr2 */ -#define LEAF_MIPS_DSPR2(symbol) \ +#define LEAF_DSPR2(symbol) \ LEAF_MIPS32R2(symbol) \ .set dspr2; diff --git a/simd/powerpc/jccolext-altivec.c b/simd/powerpc/jccolext-altivec.c index 849825e..3bfb806 100644 --- a/simd/powerpc/jccolext-altivec.c +++ b/simd/powerpc/jccolext-altivec.c @@ -24,9 +24,10 @@ /* This file is included by jccolor-altivec.c */ -void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, - JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +void +jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, JDIMENSION output_row, + int num_rows) { JSAMPROW inptr, outptr0, outptr1, outptr2; int pitch = img_width * RGB_PIXELSIZE, num_cols; diff --git a/simd/powerpc/jcgryext-altivec.c b/simd/powerpc/jcgryext-altivec.c index 7f8232b..43fef3d 100644 --- a/simd/powerpc/jcgryext-altivec.c +++ b/simd/powerpc/jcgryext-altivec.c @@ -24,10 +24,10 @@ /* This file is included by jcgray-altivec.c */ -void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, - JSAMPARRAY input_buf, - JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +void +jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, JDIMENSION output_row, + int num_rows) { JSAMPROW inptr, outptr; int pitch = img_width * RGB_PIXELSIZE, num_cols; diff --git a/simd/powerpc/jcsample-altivec.c b/simd/powerpc/jcsample-altivec.c index 11609d9..5d30b10 100644 --- a/simd/powerpc/jcsample-altivec.c +++ b/simd/powerpc/jcsample-altivec.c @@ -29,11 +29,11 @@ void jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, JDIMENSION v_samp_factor, - JDIMENSION width_blocks, + JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data) { int outrow, outcol; - JDIMENSION output_cols = width_blocks * DCTSIZE; + JDIMENSION output_cols = width_in_blocks * DCTSIZE; JSAMPROW inptr, outptr; __vector unsigned char this0, next0, out; @@ -85,11 +85,11 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, void jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, JDIMENSION v_samp_factor, - JDIMENSION width_blocks, + JDIMENSION width_in_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data) { int inrow, outrow, outcol; - JDIMENSION output_cols = width_blocks * DCTSIZE; + JDIMENSION output_cols = width_in_blocks * DCTSIZE; JSAMPROW inptr0, inptr1, outptr; __vector unsigned char this0, next0, this1, next1, out; diff --git a/simd/powerpc/jdcolext-altivec.c b/simd/powerpc/jdcolext-altivec.c index fb121ce..2e452b8 100644 --- a/simd/powerpc/jdcolext-altivec.c +++ b/simd/powerpc/jdcolext-altivec.c @@ -23,9 +23,10 @@ /* This file is included by jdcolor-altivec.c */ -void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, - JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) +void +jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, + JDIMENSION input_row, JSAMPARRAY output_buf, + int num_rows) { JSAMPROW outptr, inptr0, inptr1, inptr2; int pitch = out_width * RGB_PIXELSIZE, num_cols; diff --git a/simd/powerpc/jdmrgext-altivec.c b/simd/powerpc/jdmrgext-altivec.c index 55205bb..e9eab2a 100644 --- a/simd/powerpc/jdmrgext-altivec.c +++ b/simd/powerpc/jdmrgext-altivec.c @@ -23,10 +23,11 @@ /* This file is included by jdmerge-altivec.c */ -void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, - JSAMPIMAGE input_buf, - JDIMENSION in_row_group_ctr, - JSAMPARRAY output_buf) +void +jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, + JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) { JSAMPROW outptr, inptr0, inptr1, inptr2; int pitch = output_width * RGB_PIXELSIZE, num_cols, yloop; @@ -299,10 +300,11 @@ void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, } -void jsimd_h2v2_merged_upsample_altivec (JDIMENSION output_width, - JSAMPIMAGE input_buf, - JDIMENSION in_row_group_ctr, - JSAMPARRAY output_buf) +void +jsimd_h2v2_merged_upsample_altivec (JDIMENSION output_width, + JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) { JSAMPROW inptr, outptr; diff --git a/simd/x86_64/jcsample-avx2.asm b/simd/x86_64/jcsample-avx2.asm index 29f4177..15eb8d3 100644 --- a/simd/x86_64/jcsample-avx2.asm +++ b/simd/x86_64/jcsample-avx2.asm @@ -29,14 +29,15 @@ ; ; GLOBAL(void) ; jsimd_h2v1_downsample_avx2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; ; r10d = JDIMENSION image_width ; r11 = int max_v_samp_factor ; r12d = JDIMENSION v_samp_factor -; r13d = JDIMENSION width_blocks +; r13d = JDIMENSION width_in_blocks ; r14 = JSAMPARRAY input_data ; r15 = JSAMPARRAY output_data @@ -190,14 +191,15 @@ EXTN(jsimd_h2v1_downsample_avx2): ; ; GLOBAL(void) ; jsimd_h2v2_downsample_avx2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; ; r10d = JDIMENSION image_width ; r11 = int max_v_samp_factor ; r12d = JDIMENSION v_samp_factor -; r13d = JDIMENSION width_blocks +; r13d = JDIMENSION width_in_blocks ; r14 = JSAMPARRAY input_data ; r15 = JSAMPARRAY output_data diff --git a/simd/x86_64/jcsample-sse2.asm b/simd/x86_64/jcsample-sse2.asm index aca8bdb..c9d3640 100644 --- a/simd/x86_64/jcsample-sse2.asm +++ b/simd/x86_64/jcsample-sse2.asm @@ -28,14 +28,15 @@ ; ; GLOBAL(void) ; jsimd_h2v1_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; ; r10d = JDIMENSION image_width ; r11 = int max_v_samp_factor ; r12d = JDIMENSION v_samp_factor -; r13d = JDIMENSION width_blocks +; r13d = JDIMENSION width_in_blocks ; r14 = JSAMPARRAY input_data ; r15 = JSAMPARRAY output_data @@ -172,14 +173,15 @@ EXTN(jsimd_h2v1_downsample_sse2): ; ; GLOBAL(void) ; jsimd_h2v2_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor, -; JDIMENSION v_samp_factor, JDIMENSION width_blocks, +; JDIMENSION v_samp_factor, +; JDIMENSION width_in_blocks, ; JSAMPARRAY input_data, JSAMPARRAY output_data); ; ; r10d = JDIMENSION image_width ; r11 = int max_v_samp_factor ; r12d = JDIMENSION v_samp_factor -; r13d = JDIMENSION width_blocks +; r13d = JDIMENSION width_in_blocks ; r14 = JSAMPARRAY input_data ; r15 = JSAMPARRAY output_data