shun-iwasawa 82a8f5
/*
shun-iwasawa 82a8f5
 * jsimd_mips.c
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB</ossman@cendio.se>
shun-iwasawa 82a8f5
 * Copyright (C) 2009-2011, 2014, 2016, 2018, 2020, D. R. Commander.
shun-iwasawa 82a8f5
 * Copyright (C) 2013-2014, MIPS Technologies, Inc., California.
shun-iwasawa 82a8f5
 * Copyright (C) 2015-2016, 2018, Matthieu Darbois.
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * Based on the x86 SIMD extension for IJG JPEG library,
shun-iwasawa 82a8f5
 * Copyright (C) 1999-2006, MIYASAKA Masaru.
shun-iwasawa 82a8f5
 * For conditions of distribution and use, see copyright notice in jsimdext.inc
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * This file contains the interface between the "normal" portions
shun-iwasawa 82a8f5
 * of the library and the SIMD implementations when running on a
shun-iwasawa 82a8f5
 * MIPS architecture.
shun-iwasawa 82a8f5
 */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#define JPEG_INTERNALS
shun-iwasawa 82a8f5
#include "../../jinclude.h"
shun-iwasawa 82a8f5
#include "../../jpeglib.h"
shun-iwasawa 82a8f5
#include "../../jsimd.h"
shun-iwasawa 82a8f5
#include "../../jdct.h"
shun-iwasawa 82a8f5
#include "../../jsimddct.h"
shun-iwasawa 82a8f5
#include "../jsimd.h"
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#include <stdio.h></stdio.h>
shun-iwasawa 82a8f5
#include <string.h></string.h>
shun-iwasawa 82a8f5
#include <ctype.h></ctype.h>
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
static unsigned int simd_support = ~0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if !(defined(__mips_dsp) && (__mips_dsp_rev >= 2)) && defined(__linux__)
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
LOCAL(void)
shun-iwasawa 82a8f5
parse_proc_cpuinfo(const char *search_string)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  const char *file_name = "/proc/cpuinfo";
shun-iwasawa 82a8f5
  char cpuinfo_line[256];
shun-iwasawa 82a8f5
  FILE *f = NULL;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  simd_support = 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if ((f = fopen(file_name, "r")) != NULL) {
shun-iwasawa 82a8f5
    while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f) != NULL) {
shun-iwasawa 82a8f5
      if (strstr(cpuinfo_line, search_string) != NULL) {
shun-iwasawa 82a8f5
        fclose(f);
shun-iwasawa 82a8f5
        simd_support |= JSIMD_DSPR2;
shun-iwasawa 82a8f5
        return;
shun-iwasawa 82a8f5
      }
shun-iwasawa 82a8f5
    }
shun-iwasawa 82a8f5
    fclose(f);
shun-iwasawa 82a8f5
  }
shun-iwasawa 82a8f5
  /* Did not find string in the proc file, or not Linux ELF. */
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
/*
shun-iwasawa 82a8f5
 * Check what SIMD accelerations are supported.
shun-iwasawa 82a8f5
 *
shun-iwasawa 82a8f5
 * FIXME: This code is racy under a multi-threaded environment.
shun-iwasawa 82a8f5
 */
shun-iwasawa 82a8f5
LOCAL(void)
shun-iwasawa 82a8f5
init_simd(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
#ifndef NO_GETENV
shun-iwasawa 82a8f5
  char *env = NULL;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support != ~0U)
shun-iwasawa 82a8f5
    return;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  simd_support = 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__mips_dsp) && (__mips_dsp_rev >= 2)
shun-iwasawa 82a8f5
  simd_support |= JSIMD_DSPR2;
shun-iwasawa 82a8f5
#elif defined(__linux__)
shun-iwasawa 82a8f5
  /* We still have a chance to use MIPS DSPR2 regardless of globally used
shun-iwasawa 82a8f5
   * -mdspr2 options passed to gcc by performing runtime detection via
shun-iwasawa 82a8f5
   * /proc/cpuinfo parsing on linux */
shun-iwasawa 82a8f5
  parse_proc_cpuinfo("MIPS 74K");
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#ifndef NO_GETENV
shun-iwasawa 82a8f5
  /* Force different settings through environment variables */
shun-iwasawa 82a8f5
  env = getenv("JSIMD_FORCEDSPR2");
shun-iwasawa 82a8f5
  if ((env != NULL) && (strcmp(env, "1") == 0))
shun-iwasawa 82a8f5
    simd_support = JSIMD_DSPR2;
shun-iwasawa 82a8f5
  env = getenv("JSIMD_FORCENONE");
shun-iwasawa 82a8f5
  if ((env != NULL) && (strcmp(env, "1") == 0))
shun-iwasawa 82a8f5
    simd_support = 0;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
static const int mips_idct_ifast_coefs[4] = {
shun-iwasawa 82a8f5
  0x45404540,           /* FIX( 1.082392200 / 2) =  17734 = 0x4546 */
shun-iwasawa 82a8f5
  0x5A805A80,           /* FIX( 1.414213562 / 2) =  23170 = 0x5A82 */
shun-iwasawa 82a8f5
  0x76407640,           /* FIX( 1.847759065 / 2) =  30274 = 0x7642 */
shun-iwasawa 82a8f5
  0xAC60AC60            /* FIX(-2.613125930 / 4) = -21407 = 0xAC61 */
shun-iwasawa 82a8f5
};
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
/* The following struct is borrowed from jdsample.c */
shun-iwasawa 82a8f5
typedef void (*upsample1_ptr) (j_decompress_ptr cinfo,
shun-iwasawa 82a8f5
                               jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                               JSAMPARRAY input_data,
shun-iwasawa 82a8f5
                               JSAMPARRAY *output_data_ptr);
shun-iwasawa 82a8f5
typedef struct {
shun-iwasawa 82a8f5
  struct jpeg_upsampler pub;
shun-iwasawa 82a8f5
  JSAMPARRAY color_buf[MAX_COMPONENTS];
shun-iwasawa 82a8f5
  upsample1_ptr methods[MAX_COMPONENTS];
shun-iwasawa 82a8f5
  int next_row_out;
shun-iwasawa 82a8f5
  JDIMENSION rows_to_go;
shun-iwasawa 82a8f5
  int rowgroup_height[MAX_COMPONENTS];
shun-iwasawa 82a8f5
  UINT8 h_expand[MAX_COMPONENTS];
shun-iwasawa 82a8f5
  UINT8 v_expand[MAX_COMPONENTS];
shun-iwasawa 82a8f5
} my_upsampler;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
typedef my_upsampler *my_upsample_ptr;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_rgb_ycc(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_rgb_gray(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_ycc_rgb(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_ycc_rgb565(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_c_can_null_convert(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
shun-iwasawa 82a8f5
                      JSAMPIMAGE output_buf, JDIMENSION output_row,
shun-iwasawa 82a8f5
                      int num_rows)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  void (*dspr2fct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  switch (cinfo->in_color_space) {
shun-iwasawa 82a8f5
  case JCS_EXT_RGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extrgb_ycc_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_RGBX:
shun-iwasawa 82a8f5
  case JCS_EXT_RGBA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extrgbx_ycc_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extbgr_ycc_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGRX:
shun-iwasawa 82a8f5
  case JCS_EXT_BGRA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extbgrx_ycc_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XBGR:
shun-iwasawa 82a8f5
  case JCS_EXT_ABGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extxbgr_ycc_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XRGB:
shun-iwasawa 82a8f5
  case JCS_EXT_ARGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extxrgb_ycc_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  default:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extrgb_ycc_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  }
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  dspr2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
shun-iwasawa 82a8f5
                       JSAMPIMAGE output_buf, JDIMENSION output_row,
shun-iwasawa 82a8f5
                       int num_rows)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  void (*dspr2fct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  switch (cinfo->in_color_space) {
shun-iwasawa 82a8f5
  case JCS_EXT_RGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extrgb_gray_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_RGBX:
shun-iwasawa 82a8f5
  case JCS_EXT_RGBA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extrgbx_gray_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extbgr_gray_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGRX:
shun-iwasawa 82a8f5
  case JCS_EXT_BGRA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extbgrx_gray_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XBGR:
shun-iwasawa 82a8f5
  case JCS_EXT_ABGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extxbgr_gray_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XRGB:
shun-iwasawa 82a8f5
  case JCS_EXT_ARGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extxrgb_gray_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  default:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_extrgb_gray_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  }
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  dspr2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
shun-iwasawa 82a8f5
                      JDIMENSION input_row, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
                      int num_rows)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  void (*dspr2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  switch (cinfo->out_color_space) {
shun-iwasawa 82a8f5
  case JCS_EXT_RGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_ycc_extrgb_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_RGBX:
shun-iwasawa 82a8f5
  case JCS_EXT_RGBA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_ycc_extrgbx_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_ycc_extbgr_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGRX:
shun-iwasawa 82a8f5
  case JCS_EXT_BGRA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_ycc_extbgrx_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XBGR:
shun-iwasawa 82a8f5
  case JCS_EXT_ABGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_ycc_extxbgr_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XRGB:
shun-iwasawa 82a8f5
  case JCS_EXT_ARGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_ycc_extxrgb_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  default:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_ycc_extrgb_convert_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  }
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  dspr2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
shun-iwasawa 82a8f5
                         JDIMENSION input_row, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
                         int num_rows)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_c_null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
shun-iwasawa 82a8f5
                     JSAMPIMAGE output_buf, JDIMENSION output_row,
shun-iwasawa 82a8f5
                     int num_rows)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_c_null_convert_dspr2(cinfo->image_width, input_buf, output_buf,
shun-iwasawa 82a8f5
                             output_row, num_rows, cinfo->num_components);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v2_downsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* FIXME: jsimd_h2v2_downsample_dspr2() fails some of the TJBench tiling
shun-iwasawa 82a8f5
   * regression tests, probably because the DSPr2 SIMD implementation predates
shun-iwasawa 82a8f5
   * those tests. */
shun-iwasawa 82a8f5
#if 0
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v2_smooth_downsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v1_downsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* FIXME: jsimd_h2v1_downsample_dspr2() fails some of the TJBench tiling
shun-iwasawa 82a8f5
   * regression tests, probably because the DSPr2 SIMD implementation predates
shun-iwasawa 82a8f5
   * those tests. */
shun-iwasawa 82a8f5
#if 0
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                      JSAMPARRAY input_data, JSAMPARRAY output_data)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_h2v2_downsample_dspr2(cinfo->image_width, cinfo->max_v_samp_factor,
shun-iwasawa 82a8f5
                              compptr->v_samp_factor, compptr->width_in_blocks,
shun-iwasawa 82a8f5
                              input_data, output_data);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo,
shun-iwasawa 82a8f5
                             jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                             JSAMPARRAY input_data, JSAMPARRAY output_data)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_h2v2_smooth_downsample_dspr2(input_data, output_data,
shun-iwasawa 82a8f5
                                     compptr->v_samp_factor,
shun-iwasawa 82a8f5
                                     cinfo->max_v_samp_factor,
shun-iwasawa 82a8f5
                                     cinfo->smoothing_factor,
shun-iwasawa 82a8f5
                                     compptr->width_in_blocks,
shun-iwasawa 82a8f5
                                     cinfo->image_width);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                      JSAMPARRAY input_data, JSAMPARRAY output_data)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_h2v1_downsample_dspr2(cinfo->image_width, cinfo->max_v_samp_factor,
shun-iwasawa 82a8f5
                              compptr->v_samp_factor, compptr->width_in_blocks,
shun-iwasawa 82a8f5
                              input_data, output_data);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v2_upsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v1_upsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_int_upsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                    JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_h2v2_upsample_dspr2(cinfo->max_v_samp_factor, cinfo->output_width,
shun-iwasawa 82a8f5
                            input_data, output_data_ptr);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                    JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_h2v1_upsample_dspr2(cinfo->max_v_samp_factor, cinfo->output_width,
shun-iwasawa 82a8f5
                            input_data, output_data_ptr);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_int_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                   JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  jsimd_int_upsample_dspr2(upsample->h_expand[compptr->component_index],
shun-iwasawa 82a8f5
                           upsample->v_expand[compptr->component_index],
shun-iwasawa 82a8f5
                           input_data, output_data_ptr, cinfo->output_width,
shun-iwasawa 82a8f5
                           cinfo->max_v_samp_factor);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v2_fancy_upsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v1_fancy_upsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                          JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_h2v2_fancy_upsample_dspr2(cinfo->max_v_samp_factor,
shun-iwasawa 82a8f5
                                  compptr->downsampled_width, input_data,
shun-iwasawa 82a8f5
                                  output_data_ptr);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                          JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_h2v1_fancy_upsample_dspr2(cinfo->max_v_samp_factor,
shun-iwasawa 82a8f5
                                  compptr->downsampled_width, input_data,
shun-iwasawa 82a8f5
                                  output_data_ptr);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v2_merged_upsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_h2v1_merged_upsample(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
shun-iwasawa 82a8f5
                           JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  void (*dspr2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, JSAMPLE *);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  switch (cinfo->out_color_space) {
shun-iwasawa 82a8f5
  case JCS_EXT_RGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v2_extrgb_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_RGBX:
shun-iwasawa 82a8f5
  case JCS_EXT_RGBA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v2_extrgbx_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v2_extbgr_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGRX:
shun-iwasawa 82a8f5
  case JCS_EXT_BGRA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v2_extbgrx_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XBGR:
shun-iwasawa 82a8f5
  case JCS_EXT_ABGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v2_extxbgr_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XRGB:
shun-iwasawa 82a8f5
  case JCS_EXT_ARGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v2_extxrgb_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  default:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v2_extrgb_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  }
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  dspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf,
shun-iwasawa 82a8f5
           cinfo->sample_range_limit);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
shun-iwasawa 82a8f5
                           JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  void (*dspr2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, JSAMPLE *);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  switch (cinfo->out_color_space) {
shun-iwasawa 82a8f5
  case JCS_EXT_RGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v1_extrgb_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_RGBX:
shun-iwasawa 82a8f5
  case JCS_EXT_RGBA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v1_extrgbx_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v1_extbgr_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_BGRX:
shun-iwasawa 82a8f5
  case JCS_EXT_BGRA:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v1_extbgrx_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XBGR:
shun-iwasawa 82a8f5
  case JCS_EXT_ABGR:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v1_extxbgr_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  case JCS_EXT_XRGB:
shun-iwasawa 82a8f5
  case JCS_EXT_ARGB:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v1_extxrgb_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  default:
shun-iwasawa 82a8f5
    dspr2fct = jsimd_h2v1_extrgb_merged_upsample_dspr2;
shun-iwasawa 82a8f5
    break;
shun-iwasawa 82a8f5
  }
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  dspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf,
shun-iwasawa 82a8f5
           cinfo->sample_range_limit);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_convsamp(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(DCTELEM) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_convsamp_float(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(ISLOW_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#ifndef __mips_soft_float
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
shun-iwasawa 82a8f5
               DCTELEM *workspace)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_convsamp_dspr2(sample_data, start_col, workspace);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
shun-iwasawa 82a8f5
                     FAST_FLOAT *workspace)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
#ifndef __mips_soft_float
shun-iwasawa 82a8f5
  jsimd_convsamp_float_dspr2(sample_data, start_col, workspace);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_fdct_islow(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(DCTELEM) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_fdct_ifast(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(DCTELEM) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_fdct_float(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_fdct_islow(DCTELEM *data)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_fdct_islow_dspr2(data);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_fdct_ifast(DCTELEM *data)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_fdct_ifast_dspr2(data);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_fdct_float(FAST_FLOAT *data)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_quantize(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(DCTELEM) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_quantize_float(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(ISLOW_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#ifndef __mips_soft_float
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_quantize_dspr2(coef_block, divisors, workspace);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
shun-iwasawa 82a8f5
                     FAST_FLOAT *workspace)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
#ifndef __mips_soft_float
shun-iwasawa 82a8f5
  jsimd_quantize_float_dspr2(coef_block, divisors, workspace);
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_idct_2x2(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(ISLOW_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_idct_4x4(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(ISLOW_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_idct_6x6(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(ISLOW_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_idct_12x12(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(ISLOW_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
               JCOEFPTR coef_block, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
               JDIMENSION output_col)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_idct_2x2_dspr2(compptr->dct_table, coef_block, output_buf, output_col);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
               JCOEFPTR coef_block, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
               JDIMENSION output_col)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  int workspace[DCTSIZE * 4]; /* buffers data between passes */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  jsimd_idct_4x4_dspr2(compptr->dct_table, coef_block, output_buf, output_col,
shun-iwasawa 82a8f5
                       workspace);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_idct_6x6(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
               JCOEFPTR coef_block, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
               JDIMENSION output_col)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  jsimd_idct_6x6_dspr2(compptr->dct_table, coef_block, output_buf, output_col);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_idct_12x12(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                 JCOEFPTR coef_block, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
                 JDIMENSION output_col)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  int workspace[96];
shun-iwasawa 82a8f5
  int output[12] = {
shun-iwasawa 82a8f5
    (int)(output_buf[0] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[1] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[2] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[3] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[4] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[5] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[6] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[7] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[8] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[9] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[10] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[11] + output_col)
shun-iwasawa 82a8f5
  };
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  jsimd_idct_12x12_pass1_dspr2(coef_block, compptr->dct_table, workspace);
shun-iwasawa 82a8f5
  jsimd_idct_12x12_pass2_dspr2(workspace, output);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_idct_islow(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(ISLOW_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_idct_ifast(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  init_simd();
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* The code is optimised for these values only */
shun-iwasawa 82a8f5
  if (DCTSIZE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JCOEF) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (BITS_IN_JSAMPLE != 8)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(JDIMENSION) != 4)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (sizeof(IFAST_MULT_TYPE) != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
  if (IFAST_SCALE_BITS != 2)
shun-iwasawa 82a8f5
    return 0;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
#if defined(__MIPSEL__)
shun-iwasawa 82a8f5
  if (simd_support & JSIMD_DSPR2)
shun-iwasawa 82a8f5
    return 1;
shun-iwasawa 82a8f5
#endif
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_idct_float(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                 JCOEFPTR coef_block, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
                 JDIMENSION output_col)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  int output[8] = {
shun-iwasawa 82a8f5
    (int)(output_buf[0] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[1] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[2] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[3] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[4] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[5] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[6] + output_col),
shun-iwasawa 82a8f5
    (int)(output_buf[7] + output_col)
shun-iwasawa 82a8f5
  };
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  jsimd_idct_islow_dspr2(coef_block, compptr->dct_table, output,
shun-iwasawa 82a8f5
                         IDCT_range_limit(cinfo));
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                 JCOEFPTR coef_block, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
                 JDIMENSION output_col)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  JCOEFPTR inptr;
shun-iwasawa 82a8f5
  IFAST_MULT_TYPE *quantptr;
shun-iwasawa 82a8f5
  DCTELEM workspace[DCTSIZE2];  /* buffers data between passes */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* Pass 1: process columns from input, store into work array. */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  inptr = coef_block;
shun-iwasawa 82a8f5
  quantptr = (IFAST_MULT_TYPE *)compptr->dct_table;
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  jsimd_idct_ifast_cols_dspr2(inptr, quantptr, workspace,
shun-iwasawa 82a8f5
                              mips_idct_ifast_coefs);
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  /* Pass 2: process rows from work array, store into output array. */
shun-iwasawa 82a8f5
  /* Note that we must descale the results by a factor of 8 == 2**3, */
shun-iwasawa 82a8f5
  /* and also undo the PASS1_BITS scaling. */
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
  jsimd_idct_ifast_rows_dspr2(workspace, output_buf, output_col,
shun-iwasawa 82a8f5
                              mips_idct_ifast_coefs);
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
shun-iwasawa 82a8f5
                 JCOEFPTR coef_block, JSAMPARRAY output_buf,
shun-iwasawa 82a8f5
                 JDIMENSION output_col)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_huff_encode_one_block(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(JOCTET *)
shun-iwasawa 82a8f5
jsimd_huff_encode_one_block(void *state, JOCTET *buffer, JCOEFPTR block,
shun-iwasawa 82a8f5
                            int last_dc_val, c_derived_tbl *dctbl,
shun-iwasawa 82a8f5
                            c_derived_tbl *actbl)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return NULL;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_encode_mcu_AC_first_prepare(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(void)
shun-iwasawa 82a8f5
jsimd_encode_mcu_AC_first_prepare(const JCOEF *block,
shun-iwasawa 82a8f5
                                  const int *jpeg_natural_order_start, int Sl,
shun-iwasawa 82a8f5
                                  int Al, JCOEF *values, size_t *zerobits)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_can_encode_mcu_AC_refine_prepare(void)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
GLOBAL(int)
shun-iwasawa 82a8f5
jsimd_encode_mcu_AC_refine_prepare(const JCOEF *block,
shun-iwasawa 82a8f5
                                   const int *jpeg_natural_order_start, int Sl,
shun-iwasawa 82a8f5
                                   int Al, JCOEF *absvalues, size_t *bits)
shun-iwasawa 82a8f5
{
shun-iwasawa 82a8f5
  return 0;
shun-iwasawa 82a8f5
}