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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zdjpeg.c

?? linux環(huán)境下jpeg編解碼算法的實現(xiàn)
?? C
?? 第 1 頁 / 共 4 頁
字號:
//  zJpegInit( vMem, pMem );  zJpegInit( APP_PHY_MEMORY + vMem, APP_PHY_MEMORY + pMem );  /*   * Override the default JPEG error handling. [Note, this functionality may   * change in future releases!]   */  cinfo.err = zJpegStdError(&errorHandler.pub);  errorHandler.pub.error_exit = zdjpegErrorExit;  /* Establish the setjmp return context */  if (setjmp(errorHandler.setjmp_buffer))  {    zJpegFinishDecompress(&cinfo);    return 0;  }  /* Scan command line to find file names. */  /* It is convenient to use just one switch-parsing routine, but the switch   * values read here are ignored; we will rescan the switches after opening   * the input file.   * (Exception: tracing level set here controls verbosity for COM markers   * found during jpeg_read_header...)   */  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);  /*   * This semaphore syncs this command line utility to the asynchronous decode   */  sem_init(&done, 0, 0);  /*   * Initialize 3D graphics   */  display_init();  /*   * Now decide if we are in one-shot or slideshow mode and proceed accordingly   */  if (slideshow == FALSE && play == FALSE && tile == FALSE && outfilename == NULL)  {    /*     * Initialize the JPEG decompression object     */    if (zJpegCreateDecompress( &cinfo ) != EXIT_SUCCESS)    {      fprintf(stderr, "%s: can't create decompression object\n", progname);      exit(EXIT_FAILURE);    }    /*     * At this point pZSP  which is the ZEVIO specific 'cinfo' extension can be     * initialized. The intention is that 'cinfo' remains as standard and all     * extensions use the existing 'client_data' pointer to user extensions     *///    pZSP = (struct zjpeg_command *)cinfo.client_data;    if (file_index < argc)    {      if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL)      {        fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);        exit(EXIT_FAILURE);      }    }    else    {      fprintf(stderr, "%s: must name one input and one output file\n", progname);      usage();    }    if (zJpegOKToDecode(&cinfo, input_file) == JPEG_NOK_TO_DECODE)    {      printf("Unsupported Image Type\n");      zJpegReleaseDecompress(&cinfo);      fclose(input_file);      return 1;    }    if (cinfo.err->trace_level)    {      timSet.it_interval.tv_sec = INTERVAL_TIME;      timSet.it_interval.tv_usec = 0;      timSet.it_value.tv_sec = INTERVAL_TIME;      timSet.it_value.tv_usec = 0;      assert(!setitimer(ITIMER_REAL, &timSet, NULL));    }    /*     * Specify data source for decompression. File and memory sources are     * supported although memory does not make any sense in the context of a     * command line utility...     */    zJpegStdioSrc(&cinfo, input_file);    /*     * Read file header which sets the default decompression parameters. At this     * point the ZEVIO decoder can check for an embedded thumbnail, see the logic     * below for details...     */    if (zJpegReadHeader(&cinfo, thumbnail, &thumbnailFound) == JPEG_NOK_TO_DECODE)    {      printf("Unsupported Image Type\n");      zJpegFinishDecompress(&cinfo);      zJpegReleaseDecompress(&cinfo);      fclose(input_file);      return 1;    }    if(thumbnail == TRUE && thumbnailFound == FALSE)    {      fprintf(stderr, "%s: no thumbnail present\n", progname);      zJpegFinishDecompress(&cinfo);      rewind(input_file);      zJpegStdioSrc(&cinfo, input_file);      zJpegReadHeader(&cinfo, FALSE, &thumbnailFound);      oWidth  = 160;      oHeight = 120;    }    if (thumbnail == TRUE)    {	 oWidth  = 160; oHeight = 120;    }    /*     * Adjust default decompression parameters by re-parsing the options. In a     * real application the decode parameters must be set after reading the     * header     */    file_index = parse_switches( &cinfo, argc, argv, 0, TRUE );    /*     * Scale the image to fit the desired output size. Here we always scale to     * match aspect ratio and maximum 800x600     */    zJpegSetOutputSize( &cinfo, &oWidth, &oHeight, SCALE_MAX );	printf("SetOutputSize: %d x %d\n", oWidth, oHeight);    /*     * (void*) gpuBuf.pBase = physical address to top left corner of buffer     * (unsigned short*) gpuBuf.vBase = virtual address to top left corner of buffer     */    GPU_Factory_Request(ZV_GBUF_FULL_SCREEN,&gpuBuf);    /*     * Start decompressor, the callback and memory pointers for the output     * buffer are passed as parameters     */    (void) zJpegStartDecompress(&cinfo, freeInputBuffer, 0, gpuBuf.vBase, (unsigned long)gpuBuf.pBase); // Buffer assigned internally for now    /*     * Pend on callback indicating decode complete     */    sem_wait(&done);    /*     * Decode time is captured before writing out the file which is subject to     * NFS delays. Of course the input and swap file are also plagued by NFS     * but at least one source of uncertainty is removed...     */    if  (cinfo.err->trace_level)    {      assert(!getitimer(ITIMER_REAL, &timGet1));    }    assert(oWidth  <= OUTPUT_W);    assert(oHeight <= OUTPUT_H);    /*     * Draw LCD display     */    GPU_Factory_BindTexture(&gpuBuf);    display_pixels( (void *)gpuBuf.vBase,                    (unsigned short*)gpuVMem,                    gpuBuf.offset );    if  (cinfo.err->trace_level)    {      assert(!getitimer(ITIMER_REAL, &timGet2));    }    /*     * Write the image out to the specified file in PPM format. Output width and     * output height are constrained if incorrct scaling selection could cause a     * memory access problem, any image is capped at 800*600 pixels     *     * NOTE : Writing a file here totally screws up the presentation time value     * but currently drawing to 3D when the image is in GPU memory (not system)     * corrupts the decode results so it is here or never!     */    /*     * Tidy up after decode of a single image, this should be used by any     * application     */    zJpegReleaseDecompress(&cinfo);    /*     * Decode & presentation run time output     */    if  (cinfo.err->trace_level)    {      zJpegInstrumentation result;      zJpegGetInstrumentation( &cinfo, &result );      printf("\n%d %u.%ums [%d] %u.%ums [%d] %d %dx%d %dx%d %dx%d\n",             result.ppPackets,             result.zspTimer0ms,             result.zspTimer0hus,             result.zspTimer0oflow,             result.zspTimer1ms,             result.zspTimer1hus,             result.zspTimer1oflow,             result.chromaType,             result.imageWidth,             result.imageHeight,             result.outputWidth,             result.outputHeight,             result.displayWidth,             result.displayHeight);      time = INTERVAL_TIME*1000000 - (timGet1.it_value.tv_sec * 1000000 + timGet1.it_value.tv_usec);      if (time <= 0)        printf("Task Timer Elapsed...\n");      else        printf("[D] %ld.%02lds ", time/1000000, (time%1000000)/10000);      time = INTERVAL_TIME*1000000 - (timGet2.it_value.tv_sec * 1000000 + timGet2.it_value.tv_usec);      if (time <= 0)        printf("Task Timer Elapsed...\n");      else        printf("[P] %ld.%02lds for %s\n", time/1000000, (time%1000000)/10000, argv[file_index]);    }    fclose(input_file);    GPU_Factory_Release(&gpuBuf);    /*     * The default behavior is to leave the image visible but this obscures the     * directFB plane, there is a command line option to delay for 'N' seconds then     * clear the image.     */    if (presentationDelay)    {      sleep(presentationDelay);      zevio2d_disable_3dscr();    }  }  else if (outfilename)  {    /*     * This path implements an encode option. It encodes a JPEG with an     * embedded thumbnail. Right now the method used is VERY crude, the image     * is decoded and encoded twice, once for thumbnail and the second time for     * display. Going forward there are much better ways to do this, e.g.     * copying the thumbnail from the original image if there are no changes     * such as cropping or in the more general case scaling a resulting display     * size image to thumbnail size before encoding, much faster than a double     * decode but another PP step to implement.     *     * Also no EXIF is transferred over, that will almost certainly be required     * in the future.     */    unsigned char *header;    FILE *tempFile;    unsigned int length,                 orientation;    /*     * Step 1 - Decode Thumbnail to a discrete file. To differentiate the     * thumbnails and bypass ZSP PP (necessary for this low rent solution) the     * thumbnail is going to be generated at 200*150.     */    if (zJpegCreateDecompress( &cinfo ) != EXIT_SUCCESS)    {      fprintf(stderr, "%s: can't create decompression object\n", progname);      exit(EXIT_FAILURE);    }    if (file_index < argc)    {      if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL)      {        fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);        exit(EXIT_FAILURE);      }    }    else    {      fprintf(stderr, "%s: must name one input and one output file\n", progname);      usage();    }    GPU_Factory_Request(ZV_GBUF_FULL_SCREEN,&gpuBuf);    zJpegStdioSrc(&cinfo, input_file);    zJpegReadHeader(&cinfo, FALSE, &thumbnailFound);    oWidth  = 200;    oHeight = 150;    orientation = zJpegGetOrientation( &cinfo );    zJpegSetOutputSize( &cinfo, &oWidth, &oHeight, SCALE_MAX );     rgbBuffer = malloc(800 * 3 * 2);     assert(rgbBuffer);     zJpegSetRGBbuffer( &cinfo, rgbBuffer );    encodeStart( &cinfo, "temp", oWidth, oHeight, 80 );    (void) zJpegStartDecompress(&cinfo, freeInputBuffer, 0, gpuBuf.vBase, (unsigned long)gpuBuf.pBase); // Buffer assigned internally for now    sem_wait(&done);    encodeEnd();    zJpegFinishDecompress(&cinfo);//    zJpegReleaseDecompress(&cinfo);printf("Thumb complete\n");    /*     * Step 2 - Read back the temporary file into a memory buffer and determine     * its length. The image is read after sufficient space for the APP1/IFD     * header so that the marker can be written in a single go     */    header = (unsigned char *)malloc(16384);    assert(header);    tempFile = fopen("temp.jpg", "rb");    assert(tempFile);    length = fread(header + 74, 1, 16384-74, tempFile);    assert(length);    fclose(tempFile);printf("Thumb read\n");    if (length == 16384-74)    {      printf("Warning JPEG Thumbnail too big!\n");    }    header[ 0] = 'E';   // Exif marker    header[ 1] = 'x';    header[ 2] = 'i';    header[ 3] = 'f';     header[ 4] = 0x00;     header[ 5] = 0x00;     header[ 6] = 0x49;  // Indicates little Endian TIFF, start of TIFF     header[ 7] = 0x49;     header[ 8] = 0x2A;  // TIFF Magic Number     header[ 9] = 0x00;     header[10] = 0x08;  // Offset from start of TIFF to IFD0     header[11] = 0x00;     header[12] = 0x00;     header[13] = 0x00;     header[14] = 0x01;  // IFD0 Entry Count     header[15] = 0x00;     header[16] = 0x12;  // Orientation Tag     header[17] = 0x01;     header[18] = 0x03;     header[19] = 0x00;     header[20] = 0x01;     header[21] = 0x00;     header[22] = 0x00;     header[23] = 0x00;     header[24] = orientation;  // Orientation Value     header[25] = 0x00;     header[26] = 0x00;     header[27] = 0x00;     header[28] = 0x1A;  // Offset from start of TIFF to IFD1     header[29] = 0x00;     header[30] = 0x00;     header[31] = 0x00;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日本视频在线| 欧美激情综合五月色丁香 | 国产高清视频一区| 日本久久一区二区三区| 久久久久国产免费免费| 午夜天堂影视香蕉久久| 色噜噜狠狠色综合欧洲selulu| 久久久久国产精品人| 午夜精品一区二区三区三上悠亚| thepron国产精品| 久久久久久久久久久久久女国产乱| 天天综合色天天综合色h| 菠萝蜜视频在线观看一区| 亚洲精品一区二区精华| 日精品一区二区三区| 欧美无砖砖区免费| 亚洲黄色尤物视频| 99精品偷自拍| 自拍偷自拍亚洲精品播放| 久久99九九99精品| 欧美va在线播放| 美脚の诱脚舐め脚责91 | 色综合激情五月| 中文字幕欧美激情一区| 国产99久久久国产精品潘金网站| 亚洲精品一线二线三线| 久久国产日韩欧美精品| 日韩免费观看2025年上映的电影 | 亚洲在线视频网站| 91久久一区二区| 一区二区三区免费| 在线一区二区三区四区五区| 亚洲精品久久7777| 色偷偷88欧美精品久久久| 亚洲免费av高清| 91国偷自产一区二区开放时间| 亚洲视频一二区| 色久综合一二码| 亚洲精品久久嫩草网站秘色| 欧美三级中文字幕在线观看| 午夜精品成人在线视频| 欧美人伦禁忌dvd放荡欲情| 天堂av在线一区| 日韩一级片网址| 国产一区二区三区免费看 | 91精品国产综合久久久久久| 亚洲.国产.中文慕字在线| 欧美一区二区视频免费观看| 久久成人免费电影| 久久久久9999亚洲精品| 99久久综合精品| 亚洲一区二区三区自拍| 3d成人h动漫网站入口| 精品亚洲成a人在线观看| 亚洲国产激情av| 在线一区二区三区四区五区 | 成人av电影在线播放| 亚洲精品久久久久久国产精华液| 欧美日韩一区二区三区不卡| 久久se这里有精品| 综合电影一区二区三区| 51精品视频一区二区三区| 国产精品一区一区三区| 亚洲欧美国产毛片在线| 日韩女同互慰一区二区| 成人av电影在线网| 日本在线不卡一区| 国产精品白丝在线| 欧美一级夜夜爽| 99re热这里只有精品视频| 无码av免费一区二区三区试看| 久久久久久久久99精品| 欧美日韩卡一卡二| 国产91精品久久久久久久网曝门| 亚洲最新视频在线播放| 久久久久国产精品人| 欧美美女一区二区在线观看| 成人精品在线视频观看| 男人的j进女人的j一区| 亚洲欧洲国产专区| 337p日本欧洲亚洲大胆色噜噜| 色偷偷成人一区二区三区91| 国产精一品亚洲二区在线视频| 亚洲激情第一区| 国产精品人成在线观看免费 | 欧美日韩一区二区三区四区五区| 国产不卡在线一区| 麻豆国产精品一区二区三区| 亚洲精品菠萝久久久久久久| 久久久久久久国产精品影院| 91精品免费在线观看| 色婷婷久久99综合精品jk白丝| 国产剧情av麻豆香蕉精品| 日韩av成人高清| 亚洲一区日韩精品中文字幕| 国产精品美女久久久久久久| 精品处破学生在线二十三| 555夜色666亚洲国产免| 欧美色窝79yyyycom| 91啪亚洲精品| 99视频一区二区| 波多野结衣在线一区| 国产乱码精品一区二区三区av | 日本精品一级二级| av一区二区三区四区| 国产高清精品网站| 国模娜娜一区二区三区| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲国产三级在线| 亚洲免费观看高清完整| 亚洲三级在线免费观看| 欧美视频一区二区三区在线观看| 99在线精品一区二区三区| 色av成人天堂桃色av| 中文无字幕一区二区三区| 精品国产乱码久久久久久蜜臀| 欧美精三区欧美精三区| 欧美久久免费观看| 欧美精品久久一区| 日韩三级.com| 亚洲精品在线免费观看视频| 久久久久久久久久电影| 日本一区二区三区视频视频| 国产精品无遮挡| 亚洲色图制服丝袜| 一区二区三区精密机械公司| 亚洲福利一二三区| 奇米精品一区二区三区四区| 久99久精品视频免费观看| 国产一区日韩二区欧美三区| 国产成人综合亚洲91猫咪| 不卡欧美aaaaa| 色妞www精品视频| 欧美精品久久一区二区三区| 精品国产免费久久| 国产精品久久久久影院老司| 亚洲自拍都市欧美小说| 蜜桃视频在线观看一区| 国产精品123区| 在线观看日韩国产| 日韩一区二区三区视频在线观看| 久久一日本道色综合| 中文字幕一区不卡| 午夜精品在线视频一区| 国产精品88888| 91极品视觉盛宴| 久久久噜噜噜久久人人看 | 欧美久久久久久久久| 久久综合资源网| 夜夜精品视频一区二区 | 国产精品网站一区| 亚洲午夜激情av| 国产一区二区在线影院| 色视频欧美一区二区三区| 日韩精品资源二区在线| 亚洲人成网站色在线观看| 日韩精品1区2区3区| 成人av中文字幕| 日韩手机在线导航| 亚洲免费在线看| 国产真实乱对白精彩久久| 91精品1区2区| 国产午夜亚洲精品理论片色戒| 亚洲国产成人高清精品| 成人激情午夜影院| 日韩欧美国产午夜精品| 亚洲激情自拍视频| 国产suv一区二区三区88区| 欧美日韩大陆在线| 综合久久给合久久狠狠狠97色| 久久精品国产秦先生| 欧美三级三级三级| 一区在线观看免费| 国产精品2024| 91精品黄色片免费大全| 一区二区在线观看视频在线观看| 成人综合在线观看| 精品久久久久久久久久久久久久久 | 亚洲福利视频一区二区| 99久久精品免费观看| 久久精品一区二区三区不卡牛牛 | 国产aⅴ综合色| 日韩欧美第一区| 欧美aaaaa成人免费观看视频| 欧美在线影院一区二区| 成人欧美一区二区三区白人| 国产精品一线二线三线精华| 精品日韩欧美在线| 久久精品国产在热久久| 5858s免费视频成人| 香蕉久久一区二区不卡无毒影院 | 国产精品久久久久永久免费观看| 国产中文一区二区三区| 亚洲精品一区二区三区精华液| 日韩av电影免费观看高清完整版| 7777精品久久久大香线蕉 | 亚洲va韩国va欧美va| 在线观看av不卡| 亚洲三级电影网站| 亚洲一区av在线|