亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ijg_timing.c

?? 這是在PCA下的基于IPP庫示例代碼例子,在網(wǎng)上下了IPP的庫之后,設(shè)置相關(guān)參數(shù)就可以編譯該代碼.
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):

/*
//
//             INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//    Copyright (c) 2001-2005 Intel Corporation. All Rights Reserved.
//
//
*/

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include "jpeglib.h"
#include "ippdefs.h"
#include "ippcore.h"
#include "ipps.h"
#include "ippi.h"
#include "ippj.h"




#define BITMAPFILEHEADER_SIZE 14
#define BITMAPINFOHEADER_SIZE 40
#define _IPP 1 // set to 0 to disable IPP calls in IJG

typedef enum _JPEG_SAMPLING
{
  SS_OTHER = 0,
  SS_444   = 444,
  SS_422   = 422,
  SS_411   = 411

} JSS;


#if defined ( linux )

#define  BI_BITFIELDS     3
#define  BI_RLE4          2
#define  BI_RLE8          1
#define  BI_RGB           0

#define _MAX_PATH       256
#define _MAX_DRIVE       16
#define _MAX_DIR        256
#define _MAX_FNAME      256
#define _MAX_EXT         16


static void _splitpath(
  char* path,
  char* drive,
  char* dir,
  char* fname,
  char* ext)
{
  char* p;
  char* last_slash  = NULL;
  char* dot         = NULL;
  unsigned int len;

  /* extract drive letter, if any */
  if((strlen(path) >= (_MAX_DRIVE - 2)) && (*(path + _MAX_DRIVE - 2) == ':') )
  {
    if(drive)
    {
      strncpy(drive,path,_MAX_DRIVE - 1);
      *(drive + _MAX_DRIVE - 1) = '\0';
    }
    path += _MAX_DRIVE - 1;
  }
  else if(drive)
  {
    *drive = '\0';
  }

  /* extract path string, if any */
  for(last_slash = NULL, p = path; *p; p++)
  {
    if(*p == '/' || *p == '\\')
      last_slash = p + 1;
    else if(*p == '.')
      dot = p;
  }

  if(last_slash)
  {
    if(dir)
    {
      len = IPP_MIN((unsigned int)(((char*)last_slash - (char*)path) / sizeof(char)),(_MAX_DIR - 1));
      strncpy(dir,path,len);
      *(dir + len) = '\0';
    }
    path = last_slash;
  }
  else if(dir)
  {
    *dir = '\0';
  }

  /* extract file name, if any */
  if(dot && (dot >= path))
  {
    if(fname)
    {
      len = IPP_MIN((unsigned int)(((char*)dot - (char*)path) / sizeof(char)),(_MAX_FNAME - 1));
      strncpy(fname,path,len);
      *(fname + len) = '\0';
    }

    if(ext)
    {
      len = IPP_MIN((unsigned int)(((char*)p - (char*)dot) / sizeof(char)),(_MAX_EXT - 1));
      strncpy(ext,dot,len);
      *(ext + len) = '\0';
    }
  }
  else
  {
    if(fname)
    {
      len = IPP_MIN((unsigned int)(((char*)p - (char*)path) / sizeof(char)),(_MAX_FNAME - 1));
      strncpy(fname,path,len);
      *(fname + len) = '\0';
    }
    if(ext)
    {
      *ext = '\0';
    }
  }

  return;
} /* _splitpath() */


static void _makepath(
  char* path,
  char* drive,
  char* dir,
  char* fname,
  char* ext)
{
  char* p;

  /* make drive */
  if(drive && *drive)
  {
    *path++ = *drive;
    *path++ = ':';
  }

  /* make dir */
  if((p = dir) && *p)
  {
    do
    {
      *path++ = *p++;
    } while(*p);

    if(*(p-1) != '/' && *(p-1) != '\\')
    {
      *path++ = '\\';
    }
  }

  /* make fname */
  if(p = fname)
  {
    while(*p)
      *path++ = *p++;
  }

  /* make ext */
  if(p = ext)
  {
    if(*p && *p != '.')
    {
      *path++ = '.';
    }
    while(*path++ = *p)
      ;
  }
  else
  {
    *path = '\0';
  }

  return;
} /* _makepath() */

#endif /* linux */


#define get_pentium_counter ippGetCpuClocks

static void copyright(void)
{
  printf("Test program for IJG library boosted with\n");
  printf("Intel(R) Integrated Performance Primitives\n");
  printf("Copyright(c) 2001-2005 Intel Corporation. All Rights Reserved.\n");
  return;
} /* copyright() */


static void usage(void)
{
  printf("use ./ijg_timing [options]\n");
  printf("where options are:\n");
  printf("  -?|-h show usage information\n");
  printf("  -v show ippJP library version\n");
  printf("  -a auto testing with hardcoded parameters.\n");
  printf("     They are encoding/decoding 640x480 1, 3 and 4 channels images\n");
  printf("     with random pixel values and 444, 422 and 411 sampling and 75%% quality\n");
  printf("  -t<bmp name> encode bmp to jpeg, after that decode jpeg to bmp\n");
  printf("     and compare with original bmp\n");
  printf("  -d<file name> decode JPEG <file name> file\n");
  printf("  -e<file name> encode BMP <file name> file\n");
  printf("  -qQUALITY jpeg quality 1..100\n");
  printf("  -sSAMPLING jpeg sampling 444, 422, 411\n");
  return;
} /* usage() */


static void ipp_version(void)
{
  const IppLibraryVersion* version;

  printf("Intel(R) Integrated Performance Primitives\n");

  /* ippCore version info */
  version = ippGetLibVersion();

  printf("  %s, %s {%d.%d.%d.%d}, build date %s\n",
    version->Name,
    version->Version,
    version->major,version->minor,version->majorBuild,version->build,
    version->BuildDate);

  /* ippSP version info */
  version = ippsGetLibVersion();

  printf("  %s, %s {%d.%d.%d.%d}, build date %s\n",
    version->Name,
    version->Version,
    version->major,version->minor,version->majorBuild,version->build,
    version->BuildDate);

  /* ippIP version info */
  version = ippiGetLibVersion();

  printf("  %s, %s {%d.%d.%d.%d}, build date %s\n",
    version->Name,
    version->Version,
    version->major,version->minor,version->majorBuild,version->build,
    version->BuildDate);

  /* ippJP version info */
  version = ippjGetLibVersion();

  printf("  %s, %s {%d.%d.%d.%d}, build date %s\n",
    version->Name,
    version->Version,
    version->major,version->minor,version->majorBuild,version->build,
    version->BuildDate);

  return;
} /* ipp_version() */


static void set_sampling(
  struct jpeg_compress_struct* cinfo,
  JSS sampling,
  int nchannels)
{
  switch(sampling)
  {
    case SS_444:
      cinfo->comp_info[0].h_samp_factor = 1;
      cinfo->comp_info[0].v_samp_factor = 1;
      if(nchannels == 3)
      {
        cinfo->comp_info[1].h_samp_factor = 1;
        cinfo->comp_info[1].v_samp_factor = 1;
        cinfo->comp_info[2].h_samp_factor = 1;
        cinfo->comp_info[2].v_samp_factor = 1;
      }
      if(nchannels == 4)
      {
        cinfo->comp_info[3].h_samp_factor = 1;
        cinfo->comp_info[3].v_samp_factor = 1;
      }
      break;

    case SS_422:
      cinfo->comp_info[0].h_samp_factor = 2;
      cinfo->comp_info[0].v_samp_factor = 1;
      cinfo->comp_info[1].h_samp_factor = 1;
      cinfo->comp_info[1].v_samp_factor = 1;
      cinfo->comp_info[2].h_samp_factor = 1;
      cinfo->comp_info[2].v_samp_factor = 1;
      if(nchannels == 4)
      {
        cinfo->comp_info[3].h_samp_factor = 2;
        cinfo->comp_info[3].v_samp_factor = 1;
      }
      break;

    case SS_411:
      cinfo->comp_info[0].h_samp_factor = 2;
      cinfo->comp_info[0].v_samp_factor = 2;
      cinfo->comp_info[1].h_samp_factor = 1;
      cinfo->comp_info[1].v_samp_factor = 1;
      cinfo->comp_info[2].h_samp_factor = 1;
      cinfo->comp_info[2].v_samp_factor = 1;
      if(nchannels == 4)
      {
        cinfo->comp_info[3].h_samp_factor = 2;
        cinfo->comp_info[3].v_samp_factor = 2;
      }
      break;

    default:
      printf("unknown sampling - %d\n",sampling);
  }

  return;
} /* set_sampling() */


static void get_sampling(
  struct jpeg_decompress_struct* cinfo,
  JSS* sampling)
{
  if(cinfo->num_components == 1)
  {
    *sampling = SS_444;
  }
  else
  if(cinfo->num_components == 3)
  {
    if(cinfo->comp_info[0].h_samp_factor == 1 && cinfo->comp_info[0].v_samp_factor == 1 &&
       cinfo->comp_info[1].h_samp_factor == 1 && cinfo->comp_info[1].v_samp_factor == 1 &&
       cinfo->comp_info[2].h_samp_factor == 1 && cinfo->comp_info[2].v_samp_factor == 1)
    {
      *sampling = SS_444;
    }
    else
    if(cinfo->comp_info[0].h_samp_factor == 2 && cinfo->comp_info[0].v_samp_factor == 1 &&
       cinfo->comp_info[1].h_samp_factor == 1 && cinfo->comp_info[1].v_samp_factor == 1 &&
       cinfo->comp_info[2].h_samp_factor == 1 && cinfo->comp_info[2].v_samp_factor == 1)
    {
      *sampling = SS_422;
    }
    else
    if(cinfo->comp_info[0].h_samp_factor == 2 && cinfo->comp_info[0].v_samp_factor == 2 &&
       cinfo->comp_info[1].h_samp_factor == 1 && cinfo->comp_info[1].v_samp_factor == 1 &&
       cinfo->comp_info[2].h_samp_factor == 1 && cinfo->comp_info[2].v_samp_factor == 1)
    {
      *sampling = SS_411;
    }
    else
    {
      printf("unknown sampling\n");
      *sampling = SS_OTHER;
    }
  }
  else
  if(cinfo->num_components == 4)
  {
    if(cinfo->comp_info[0].h_samp_factor == 1 && cinfo->comp_info[0].v_samp_factor == 1 &&
       cinfo->comp_info[1].h_samp_factor == 1 && cinfo->comp_info[1].v_samp_factor == 1 &&
       cinfo->comp_info[2].h_samp_factor == 1 && cinfo->comp_info[2].v_samp_factor == 1 &&
       cinfo->comp_info[3].h_samp_factor == 1 && cinfo->comp_info[3].v_samp_factor == 1)
    {
      *sampling = SS_444;
    }
    else
    if(cinfo->comp_info[0].h_samp_factor == 2 && cinfo->comp_info[0].v_samp_factor == 1 &&
       cinfo->comp_info[1].h_samp_factor == 1 && cinfo->comp_info[1].v_samp_factor == 1 &&
       cinfo->comp_info[2].h_samp_factor == 1 && cinfo->comp_info[2].v_samp_factor == 1 &&
       cinfo->comp_info[3].h_samp_factor == 2 && cinfo->comp_info[3].v_samp_factor == 1)
    {
      *sampling = SS_422;
    }
    else
    if(cinfo->comp_info[0].h_samp_factor == 2 && cinfo->comp_info[0].v_samp_factor == 2 &&
       cinfo->comp_info[1].h_samp_factor == 1 && cinfo->comp_info[1].v_samp_factor == 1 &&
       cinfo->comp_info[2].h_samp_factor == 1 && cinfo->comp_info[2].v_samp_factor == 1 &&
       cinfo->comp_info[3].h_samp_factor == 2 && cinfo->comp_info[3].v_samp_factor == 2)
    {
      *sampling = SS_411;
    }
    else
    {
      printf("unknown sampling\n");
      *sampling = SS_OTHER;
    }
  }
  else
  {
    printf("bad number of channels - %d\n",cinfo->num_components);
  }

  return;
} /* get_sampling() */


static int ijg_encode(
  Ipp8u*        inbuf,
  int           width,
  int           height,
  int           nchannels,
  JSS           sampling,
  int           quality,
  char*         outname,
  unsigned int* cpu_clocks)
{
  int    i;
  int    res;
  int    col;
  int    in_line_step;
  int    cur_input_row;
  Ipp64u clk0;
  Ipp64u clk1;
  Ipp8u* inptr;
  Ipp8u* outptr;
  Ipp8u* temp_buf = NULL;
  FILE*  fo = NULL;

  struct jpeg_error_mgr jerr;
  struct jpeg_compress_struct cinfo;

  fo = fopen(outname,"wb+");
  if(NULL == fo)
  {
    printf("can't create file %s\n",outname);
    res = -1;
    goto Exit;
  }

  cinfo.err = jpeg_std_error(&jerr);

  jpeg_create_compress(&cinfo);

  cinfo.UseIPP           = _IPP;
  cinfo.data_precision   = 8;
  cinfo.image_width      = width;
  cinfo.image_height     = height;
  cinfo.input_components = nchannels;
  cinfo.in_color_space   = ( (nchannels == 1) ? JCS_GRAYSCALE : ( (nchannels == 3) ? JCS_RGB : JCS_CMYK ) );

  jpeg_set_defaults(&cinfo);

  cinfo.jpeg_color_space = ( (nchannels == 1) ? JCS_GRAYSCALE : ( (nchannels == 3) ? JCS_YCbCr : JCS_YCCK) );

  jpeg_stdio_dest(&cinfo,fo);

  jpeg_set_quality(&cinfo,quality,TRUE);

  set_sampling(&cinfo,sampling,nchannels);

  in_line_step = cinfo.input_components * cinfo.image_width;

  while(in_line_step & 3)
  {
    in_line_step++;
  }

  temp_buf = malloc(in_line_step);
  if(NULL == temp_buf)
  {
    printf("can't allocate %d bytes\n",in_line_step);
    res = -1;
    goto Exit;
  }
#ifdef _WIN32
  SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_TIME_CRITICAL);
  Sleep(0);
#endif
  clk0 = get_pentium_counter();

  jpeg_start_compress(&cinfo,TRUE);

  cur_input_row = 0;

  while(cinfo.next_scanline < cinfo.image_height)
  {
    cur_input_row++;
    inptr  = inbuf + in_line_step * (cinfo.image_height - cur_input_row);
    outptr = temp_buf;

    for(col = cinfo.image_width; col--;)
    {
      switch(cinfo.input_components)
      {
      case 1:
        *outptr++ = *inptr++;
        break;

      case 3:
        for(i = cinfo.input_components; i--;)
        {
          outptr[0] = inptr[2];
          outptr[1] = inptr[1];
          outptr[2] = inptr[0];
        }
        inptr  += 3;
        outptr += 3;
        break;

      case 4:
        for(i = cinfo.input_components; i--;)
        {
          outptr[0] = inptr[3];
          outptr[1] = inptr[2];
          outptr[2] = inptr[1];
          outptr[3] = inptr[0];
        }
        inptr  += 4;
        outptr += 4;
        break;
      }
    }

    while((int)outptr & 3)
    {
      *outptr++ = 0;
    }

    jpeg_write_scanlines(&cinfo,&temp_buf,1);
  }

  jpeg_finish_compress(&cinfo);

  clk1 = get_pentium_counter();
#ifdef _WIN32
  SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL);
#endif
  *cpu_clocks = (unsigned int)(clk1 - clk0);

  res = 0;

Exit:

  if(NULL != temp_buf)
  {
    free(temp_buf);
  }

  jpeg_destroy_compress(&cinfo);

  /* free memory and close files */
  if(NULL != fo)
  {
    fclose(fo);
  }

  return res;
} /* ijg_encode() */


static int ijg_decode(
  char*         name,
  Ipp8u**       buffer,
  int*          width,
  int*          height,
  int*          nchannels,
  JSS*          sampling,
  unsigned int* cpu_clocks)
{
  int    res;
  int    col;
  int    bmp_width;
  int    cur_output_row;
  int    img_size;
  JSS    ss;
  Ipp64u clk0;
  Ipp64u clk1;
  Ipp8u* inptr = NULL;
  Ipp8u* outptr = NULL;
  Ipp8u* tmp_buff = NULL;
  Ipp8u* img_buff = NULL;
  FILE*  fi = NULL;

  struct jpeg_error_mgr jerr;
  struct jpeg_decompress_struct cinfo;

  cinfo.err = jpeg_std_error(&jerr);

  jpeg_create_decompress(&cinfo);

  cinfo.UseIPP = _IPP;

  fi = fopen(name,"rb");
  if(NULL == fi)
  {
    printf("can't open file - %s\n",name);
    res = -1;
    goto Exit;
  }

  jpeg_stdio_src(&cinfo,fi);

  jpeg_read_header(&cinfo,TRUE);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产成人久久av盗摄 | 国产精品萝li| 欧美tickling网站挠脚心| 欧美久久久久久蜜桃| 欧美三级电影在线观看| 亚洲一区二区三区四区在线免费观看| 欧美经典一区二区| 26uuu亚洲综合色欧美| 538在线一区二区精品国产| 在线亚洲高清视频| 色先锋aa成人| 国产精品香蕉一区二区三区| 激情国产一区二区| 精品系列免费在线观看| 蜜臀av性久久久久蜜臀av麻豆| 美女视频一区二区三区| 麻豆一区二区三| 欧美aⅴ一区二区三区视频| 久久国产精品99精品国产| 美女爽到高潮91| 麻豆精品一区二区三区| 免费在线观看一区二区三区| 国产在线视频一区二区| 国产九色精品成人porny| 国产一区二区伦理片| 成人综合激情网| 成人国产精品免费观看| av成人老司机| 欧美精品高清视频| 亚洲精品一区二区三区99| 国产一区二区三区久久悠悠色av| 国v精品久久久网| 日本精品一级二级| 欧美一卡二卡在线| 国产偷v国产偷v亚洲高清| 一区二区三区中文字幕在线观看| 亚洲午夜三级在线| 黑人巨大精品欧美一区| 国产成人啪免费观看软件| 久草这里只有精品视频| 99riav一区二区三区| 欧美亚一区二区| 色噜噜久久综合| 91美女在线看| 欧美不卡一区二区三区| 国产欧美中文在线| 亚洲欧美日韩一区二区三区在线观看| 日本中文字幕一区二区视频| 国产在线播放一区二区三区| 不卡视频在线观看| 宅男在线国产精品| 国产亚洲一二三区| 亚洲精品菠萝久久久久久久| 免费的国产精品| 成人黄色国产精品网站大全在线免费观看| 成人av在线一区二区| 欧美一区二区在线播放| 国产亚洲精品bt天堂精选| 亚洲国产精品久久不卡毛片| 久久精品国产99| av一区二区三区在线| 日韩av中文字幕一区二区三区| 国产精品一二一区| 在线观看日韩av先锋影音电影院| 久久亚洲精华国产精华液| 亚洲精品乱码久久久久久久久 | av一本久道久久综合久久鬼色| 日本精品视频一区二区| 精品日产卡一卡二卡麻豆| 亚洲一区二区三区三| 国产一区二区三区在线观看免费 | 久久综合狠狠综合久久激情| 一区二区三区中文字幕电影| 精品亚洲成a人在线观看| 99久久久久免费精品国产| 久久久精品国产免费观看同学| 亚洲综合成人在线视频| 99久久精品国产毛片| 精品国产免费人成电影在线观看四季| 国产精品乱码妇女bbbb| 久久99日本精品| 在线亚洲+欧美+日本专区| 国产午夜精品一区二区三区四区| 蜜臀av性久久久久蜜臀av麻豆| 色美美综合视频| 久久九九影视网| 亚洲sss视频在线视频| 国产91丝袜在线播放九色| 日韩精品一区二区三区视频| 亚洲综合色婷婷| 99久久夜色精品国产网站| 精品久久久久久亚洲综合网| 午夜精品久久久久久久99水蜜桃| 97精品国产露脸对白| 久久嫩草精品久久久精品一| 午夜激情久久久| 日本乱人伦aⅴ精品| 成人免费小视频| 成人午夜免费av| 精品国产一区二区三区久久影院 | 国产亚洲欧美中文| 国产在线麻豆精品观看| 7777精品伊人久久久大香线蕉完整版| 亚洲视频 欧洲视频| 91玉足脚交白嫩脚丫在线播放| 国产欧美日韩在线| 国产成人免费在线观看不卡| 国产亚洲精品福利| 国产精品资源在线| 精品999在线播放| 国产剧情一区二区| 久久先锋影音av鲁色资源 | 91极品视觉盛宴| 综合激情成人伊人| 本田岬高潮一区二区三区| 久久久亚洲精品石原莉奈 | 一本一本大道香蕉久在线精品 | 国产精品无人区| 成人免费高清在线| 久久综合狠狠综合久久激情| 日本中文字幕不卡| 欧美变态口味重另类| 老鸭窝一区二区久久精品| 欧美精品乱人伦久久久久久| 日本不卡视频一二三区| 欧美高清视频在线高清观看mv色露露十八 | 成人午夜又粗又硬又大| 亚洲视频综合在线| 一本色道综合亚洲| 亚洲国产日日夜夜| 日韩区在线观看| 狠狠色狠狠色综合| 欧美激情中文不卡| 成人丝袜18视频在线观看| 国产精品色呦呦| 一本到高清视频免费精品| 天天综合天天做天天综合| 欧美一区二区私人影院日本| 久久精品国产99久久6| 久久久91精品国产一区二区精品 | 欧美日韩国产天堂| 免费人成黄页网站在线一区二区| 精品国产乱码久久久久久夜甘婷婷 | 亚洲大片免费看| 日韩美女视频在线| 风间由美中文字幕在线看视频国产欧美 | 欧美一级黄色录像| 精品无人区卡一卡二卡三乱码免费卡| 久久精品一区二区三区四区| 99天天综合性| 五月开心婷婷久久| 久久精品一区二区三区四区| 欧美日韩中文字幕精品| 麻豆久久久久久久| 久久久久久久久99精品| 在线视频一区二区三| 另类成人小视频在线| 国产精品久久久久永久免费观看| 欧美最新大片在线看| 久88久久88久久久| 亚洲一二三四在线观看| 日韩女优视频免费观看| 91在线观看地址| 精品一区二区成人精品| 亚洲婷婷国产精品电影人久久| 欧美日韩小视频| 91性感美女视频| 美国av一区二区| 国产精品福利在线播放| 日韩精品在线一区二区| 91色在线porny| 久久精品国产99久久6| 亚洲午夜视频在线| 亚洲国产精品黑人久久久| 精品视频1区2区3区| 国产91精品免费| 日韩精品最新网址| 欧美在线|欧美| 91在线丨porny丨国产| 国产成人av福利| 国产在线精品一区二区三区不卡| 亚洲成人av福利| 亚洲精品乱码久久久久久黑人| 国产欧美视频在线观看| 2023国产一二三区日本精品2022| 7777精品伊人久久久大香线蕉超级流畅| 99久久精品免费观看| 国产91丝袜在线播放九色| 狠狠色丁香婷婷综合| 另类小说视频一区二区| 日本午夜一本久久久综合| 亚洲第一福利视频在线| 亚洲欧美激情视频在线观看一区二区三区| 国产三级精品三级在线专区| 久久婷婷国产综合精品青草| 日韩欧美视频一区| 日韩午夜电影av| 欧美一区二区精美| 日韩视频免费观看高清在线视频| 欧美日本免费一区二区三区|