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

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

?? jdcoefct.c

?? 基于Linux的ffmepg decoder
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
 * jdcoefct.c
 *
 * Copyright (C) 1994-1997, Thomas G. Lane.
 * This file is part of the Independent JPEG Group's software.
 * For conditions of distribution and use, see the accompanying README file.
 *
 * This file contains the coefficient buffer controller for decompression.
 * This controller is the top level of the JPEG decompressor proper.
 * The coefficient buffer lies between entropy decoding and inverse-DCT steps.
 *
 * In buffered-image mode, this controller is the interface between
 * input-oriented processing and output-oriented processing.
 * Also, the input side (only) is used when reading a file for transcoding.
 */

#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"

/* Block smoothing is only applicable for progressive JPEG, so: */
#ifndef D_PROGRESSIVE_SUPPORTED
#undef BLOCK_SMOOTHING_SUPPORTED
#endif

/* Private buffer controller object */

typedef struct {
  struct jpeg_d_coef_controller pub; /* public fields */

  /* These variables keep track of the current location of the input side. */
  /* cinfo->input_iMCU_row is also used for this. */
  JDIMENSION MCU_ctr;		/* counts MCUs processed in current row */
  int MCU_vert_offset;		/* counts MCU rows within iMCU row */
  int MCU_rows_per_iMCU_row;	/* number of such rows needed */

  /* The output side's location is represented by cinfo->output_iMCU_row. */

  /* In single-pass modes, it's sufficient to buffer just one MCU.
   * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
   * and let the entropy decoder write into that workspace each time.
   * (On 80x86, the workspace is FAR even though it's not really very big;
   * this is to keep the module interfaces unchanged when a large coefficient
   * buffer is necessary.)
   * In multi-pass modes, this array points to the current MCU's blocks
   * within the virtual arrays; it is used only by the input side.
   */
  JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];

#ifdef D_MULTISCAN_FILES_SUPPORTED
  /* In multi-pass modes, we need a virtual block array for each component. */
  jvirt_barray_ptr whole_image[MAX_COMPONENTS];
#endif

#ifdef BLOCK_SMOOTHING_SUPPORTED
  /* When doing block smoothing, we latch coefficient Al values here */
  int * coef_bits_latch;
#define SAVED_COEFS  6		/* we save coef_bits[0..5] */
#endif
} my_coef_controller;

typedef my_coef_controller * my_coef_ptr;

/* Forward declarations */
METHODDEF(int) decompress_onepass
	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#ifdef D_MULTISCAN_FILES_SUPPORTED
METHODDEF(int) decompress_data
	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#endif
#ifdef BLOCK_SMOOTHING_SUPPORTED
LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
METHODDEF(int) decompress_smooth_data
	JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#endif


LOCAL(void)
start_iMCU_row (j_decompress_ptr cinfo)
/* Reset within-iMCU-row counters for a new row (input side) */
{
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

  /* In an interleaved scan, an MCU row is the same as an iMCU row.
   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
   * But at the bottom of the image, process only what's left.
   */
  if (cinfo->comps_in_scan > 1) {
    coef->MCU_rows_per_iMCU_row = 1;
  } else {
    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))
      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
    else
      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
  }

  coef->MCU_ctr = 0;
  coef->MCU_vert_offset = 0;
}


/*
 * Initialize for an input processing pass.
 */

METHODDEF(void)
start_input_pass (j_decompress_ptr cinfo)
{
  cinfo->input_iMCU_row = 0;
  start_iMCU_row(cinfo);
}


/*
 * Initialize for an output processing pass.
 */

METHODDEF(void)
start_output_pass (j_decompress_ptr cinfo)
{
#ifdef BLOCK_SMOOTHING_SUPPORTED
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

  /* If multipass, check to see whether to use block smoothing on this pass */
  if (coef->pub.coef_arrays != NULL) {
    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
      coef->pub.decompress_data = decompress_smooth_data;
    else
      coef->pub.decompress_data = decompress_data;
  }
#endif
  cinfo->output_iMCU_row = 0;
}

#ifdef USE_INTERNAL_CPU
void store_embedded_cpu_parameters(j_decompress_ptr cinfo,j_decompress_embedded_ptr pdecinfo)
{
  int ci;
  jpeg_component_info *compptr;
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  FTMCP100_CODEC *pCodec=(FTMCP100_CODEC *)cinfo->pCodec;
  
  
  #ifdef VPE_OUTPUT
    RTL_DEBUG_OUT(0x90000000 | 0x100) // beginning of storing embedded cpu parameter
  #endif
  
  //pdecinfo->pCoreBaseAddr=pCodec->pCoreBaseAddr;
  
  // set the parameters for internal CPU firmware execution
  /**** process_data_context_main() or process_data_simple_main () function's related variables ****/
  //iMCU_row_ctr // we don't need to set this parameter, used for internal CPU
  pdecinfo->total_iMCU_rows=cinfo->total_iMCU_rows;
  pdecinfo->max_v_samp_factor=cinfo->max_v_samp_factor;
  /**** decompress_onepass() function's related variables ****/
  pdecinfo->MCUs_per_row=cinfo->MCUs_per_row;
  pdecinfo->MCU_ctr=coef->MCU_ctr;
  pdecinfo->blocks_in_MCU=cinfo->blocks_in_MCU;
  pdecinfo->invalid_next_restart_marker=cinfo->invalid_next_restart_marker;
  
  #ifdef VPE_OUTPUT
    RTL_DEBUG_OUT(0x90000000 | (pdecinfo->total_iMCU_rows))  
  #endif
  
  for(ci=0;ci<cinfo->comps_in_scan;ci++)
    {
      compptr = cinfo->cur_comp_info[ci];
      pdecinfo->cur_comp_info[ci].component_index=compptr->component_index;
      pdecinfo->cur_comp_info[ci].MCU_height=compptr->MCU_height;
      pdecinfo->cur_comp_info[ci].MCU_width=compptr->MCU_width;
      pdecinfo->cur_comp_info[ci].MCU_sample_width=compptr->MCU_sample_width;
    };
  pdecinfo->comps_in_scan=cinfo->comps_in_scan;
  
  #ifdef VPE_OUTPUT
    RTL_DEBUG_OUT(0x90000000 | 0x101) 
  #endif
  
  //for(ci=0;ci<3;ci++) pdecinfo->outdata[ci]=outdata[ci];
  for(ci=0;ci<3;ci++) pdecinfo->outdata[ci]=pCodec->outdata[ci];  
  
  pdecinfo->restarts_to_go=cinfo->restart_interval;
  pdecinfo->restart_interval=cinfo->restart_interval;
  pdecinfo->next_restart_num=cinfo->marker->next_restart_num;
  
  pdecinfo->restart_flag=FALSE; // initalize the restart interval flag to false
  
  pdecinfo->input_iMCU_row=cinfo->input_iMCU_row;
  
  #ifdef VPE_OUTPUT
    RTL_DEBUG_OUT(0x90000000 | 0x102) 
  #endif
  
  pdecinfo->MCU_rows_per_iMCU_row=coef->MCU_rows_per_iMCU_row;
  pdecinfo->cur_comp_info_0_v_samp_factor=cinfo->cur_comp_info[0]->v_samp_factor;
  pdecinfo->cur_comp_info_0_last_row_height=cinfo->cur_comp_info[0]->last_row_height;
  pdecinfo->MCU_vert_offset=coef->MCU_vert_offset;
  
  
  #ifdef VPE_OUTPUT
    RTL_DEBUG_OUT(0x90000000 | 0x1ff) // end of storing embedded cpu parameter
  #endif
}
#endif


/*
 * Decompress and return some data in the single-pass case.
 * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
 * Input and output must run in lockstep since we have only a one-MCU buffer.
 * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
 *
 * NB: output_buf contains a plane for each component in image,
 * which we index according to the component's SOF position.
 */

/*
 * This function is designed for pipeline processing in order to fully utilize
 * hardware's capability
 */
METHODDEF(int)
decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
{
#ifdef USE_INTERNAL_CPU
  FTMCP100_CODEC *pCodec=(FTMCP100_CODEC *)cinfo->pCodec;
  unsigned int start_inter_cpu;
  //int ci; unsigned int *p;
  struct jpeg_decompress_embedded_struct *pdecinfo=(struct jpeg_decompress_embedded_struct *)JPG_DEC_INFO;

  // store the parameters used for internal CPU  
  store_embedded_cpu_parameters(cinfo,pdecinfo);
  
  pdecinfo->internal_cpu_command=1; // to instruct the internal CPU to do interleaved decoding
  pdecinfo->external_cpu_response=0;
  // to start the internal CPU  
  start_inter_cpu = 1<<18;
  
  //#ifdef VPE_OUTPUT
  //  RTL_DEBUG_OUT(0x90000000 | 0x200) // begin to start the internal CPU
  //#endif

  /*
  #ifdef VPE_OUTPUT
    // to print the internal CPU code
    p=(unsigned int*)CPU_BASE_ADDRESS;
    for(ci=0;ci<sizeof(InterCPUcode)/sizeof(unsigned int);ci++)
      { 
        RTL_DEBUG_OUT(0x90000000 | ((*p++)&0x0fffffff))
      }
  #endif
  */
  
  //__asm{		
    SET_INCTL(start_inter_cpu)
  //}

  // to wait for internal CPU's response by querying the 'pdecinfo->external_cpu_response' variable
  POLL_EXTERNAL_CPU_RESPONSE_START
  
  while(pdecinfo->external_cpu_response!=1) 
    { int i;  for(i=0;i<10000; i++) { } 
      //#ifdef VPE_OUTPUT
      //RTL_DEBUG_OUT(0x90000000 | 0x201) // still querying the extrenal CPU
      //#endif
      //printf("external respose is %d\n",pdecinfo->external_cpu_response);
    }
    
  POLL_EXTERNAL_CPU_RESPONSE_END
  
  //#ifdef VPE_OUTPUT
    //RTL_DEBUG_OUT(0x90000000 | 0x2ff) // end of starting the internal CPU
  //#endif
  
#else  // else of #ifdef USE_INTERNAL_CPU

  FTMCP100_CODEC *pCodec=(FTMCP100_CODEC *)cinfo->pCodec;
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  JDIMENSION MCU_col_num;	// index of current MCU within row 
  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
  
  //JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  //  int blkn, ci, xindex, yindex, yoffset, useful_width;
  //  JSAMPARRAY output_ptr;
  //  JDIMENSION start_col, output_col;
  //  jpeg_component_info *compptr;
  //  inverse_DCT_method_ptr inverse_DCT;

  boolean stage_active[3]= { FALSE,FALSE,FALSE }; // VLD-DZ , DQ-MC , DMA stages
  JDIMENSION m[3]={ 0, 0, 0 };  // the MCU_col_num stack (to serve as pipeline register)
  
  // we made it static since we usually need to reserve descriptor status because of restart marker
  //static int buf_descriptor1=0; // used to select ping pong buffer for VLD output
  //static int buf_descriptor2=0; // used to select buffer between DQ-MC stage and DMA stage (indicated by MCIADDR for DQ-MC engine output)
  
  unsigned int cpsts_reg,vldsts_reg,vldctl_reg;
  unsigned int dzar_qar;
  unsigned int *mciaddr_ptr;
  volatile MDMA *pmdma = MDMA1; // used to access the DMA register
  
  const unsigned int start_VLD=((1 << 9) | (1 << 5) | (1<<1));  //set JPEG_mode and DEC_GO and INTRA
  const unsigned int start_DQ_MC=((1 << 9) | (1<<10) | (1 << 1));  //set JPEG_mode and DMC_GO and INTRA
  
  //#ifdef VPE_OUTPUT
  //static MCU_num=0; // mainly used for VPE out....RTL simulation debug usage
  //#endif
  
  //static unsigned int MCU_num_VLD=0,MCU_num_DQ_MC=0; // mainly used for debug usage
  //unsigned int v,s,last_bit,bitlen; // mainly used for debug

  // Loop to process as much as one whole iMCU row
  for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col || (stage_active[0] | stage_active[1] | stage_active[2]);MCU_col_num++)
    {
      //#ifdef FPGA_PLATFORM
      //printf("MCU Column Number : %d\n",MCU_col_num);
      //#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国模少妇一区二区三区| 欧美日本乱大交xxxxx| 8x福利精品第一导航| 国产精品乱人伦一区二区| 日本va欧美va瓶| 91美女片黄在线观看91美女| 久久久久国色av免费看影院| 日日夜夜精品视频免费| 欧美综合一区二区| 国产精品毛片大码女人| 国产一区日韩二区欧美三区| 欧美日本一区二区在线观看| 亚洲男同1069视频| 成人精品小蝌蚪| 国产偷v国产偷v亚洲高清| 免费看日韩精品| 欧美日韩国产另类一区| 一区二区三区高清在线| 99精品久久只有精品| 青娱乐精品视频| 日本韩国欧美在线| 国产精品拍天天在线| 国产精品一区二区黑丝| 久久久久国产精品麻豆| 九色综合国产一区二区三区| 日韩一级黄色片| 免费观看在线色综合| 91精品国产综合久久久久久久久久| 一区二区三区四区亚洲| 日本乱码高清不卡字幕| 樱花草国产18久久久久| 欧亚洲嫩模精品一区三区| 亚洲综合在线免费观看| 欧洲人成人精品| 午夜精品一区二区三区电影天堂| 在线亚洲人成电影网站色www| 亚洲精品视频免费观看| 欧美怡红院视频| 日本不卡视频一二三区| 91精品国产综合久久精品图片| 亚洲国产乱码最新视频| 制服丝袜亚洲播放| 久久aⅴ国产欧美74aaa| 精品精品国产高清一毛片一天堂| 狠狠色丁香婷婷综合| 中文字幕av一区二区三区免费看 | 国产日韩欧美电影| 大白屁股一区二区视频| 亚洲日本在线天堂| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 亚洲成av人片在线观看无码| 欧美一区二区三区视频| 国产经典欧美精品| 中文字幕一区二区三区乱码在线 | 国产成人高清视频| 亚洲同性同志一二三专区| 欧美亚男人的天堂| 另类小说视频一区二区| 国产精品成人在线观看| 在线观看亚洲一区| 极品尤物av久久免费看| 国产精品久久一级| 69av一区二区三区| 国产精品一品二品| 亚洲h在线观看| 欧美国产精品一区| 欧美精品日韩精品| 99这里都是精品| 久久国产尿小便嘘嘘尿| 亚洲精品美国一| 精品剧情v国产在线观看在线| 99在线精品免费| 精品一区二区成人精品| 亚洲精选免费视频| 久久精品视频在线看| 欧美人妖巨大在线| 99精品视频在线免费观看| 捆绑调教一区二区三区| 亚洲午夜影视影院在线观看| 久久精品一区蜜桃臀影院| 欧美日韩一区不卡| 久久久久亚洲蜜桃| 欧美日韩一区 二区 三区 久久精品| 国产麻豆成人传媒免费观看| 亚洲无线码一区二区三区| 国产精品三级在线观看| 精品福利一区二区三区| 欧美日韩精品一区二区在线播放| 成人精品国产福利| 国产成人综合在线| 老司机一区二区| 日韩黄色免费网站| 亚洲国产精品一区二区久久| 国产精品久久久久久久午夜片 | 国产剧情一区在线| 亚洲va欧美va人人爽午夜 | 欧洲亚洲国产日韩| 91麻豆视频网站| 成人免费av在线| 国产99精品视频| 精品在线播放午夜| 日本不卡一二三区黄网| 丝袜美腿亚洲一区二区图片| 亚洲成人av福利| 日韩精品一级中文字幕精品视频免费观看 | 日韩专区中文字幕一区二区| 亚洲一区二区三区视频在线| 一区二区三区在线播放| 中文字幕亚洲不卡| 国产精品乱子久久久久| 国产精品夫妻自拍| 日韩理论片中文av| 亚洲激情男女视频| 亚洲午夜成aⅴ人片| 婷婷中文字幕一区三区| 午夜精品爽啪视频| 无吗不卡中文字幕| 日韩在线一区二区| 波多野结衣中文字幕一区二区三区| 国产电影一区在线| 成人动漫精品一区二区| 91欧美一区二区| 在线视频你懂得一区| 欧美日韩高清一区二区| 欧美精品自拍偷拍动漫精品| 91麻豆精品国产| 精品99一区二区三区| 国产调教视频一区| **性色生活片久久毛片| 亚洲一区二区在线免费观看视频| 亚洲高清久久久| 国产一区啦啦啦在线观看| 国产 欧美在线| 一本大道av一区二区在线播放| 91丨九色porny丨蝌蚪| 欧美在线free| 精品国产伦一区二区三区观看方式| 精品国产sm最大网站免费看| 国产亲近乱来精品视频| 一区二区三区四区不卡在线| 日韩精品一区第一页| 国产成人免费网站| 91电影在线观看| 精品日韩欧美一区二区| 中文字幕一区二| 欧美a一区二区| 成人三级伦理片| 欧美久久免费观看| 国产日韩欧美一区二区三区乱码| 亚洲精品水蜜桃| 久久成人羞羞网站| 91麻豆福利精品推荐| 欧美一区二区三区在线| 国产精品网站在线| 日韩电影在线观看一区| 成人av网站免费| 欧美一级专区免费大片| 中文字幕一区视频| 精品一区二区三区在线播放视频 | 免费一级欧美片在线观看| 99久久综合国产精品| 337p亚洲精品色噜噜噜| 亚洲欧洲韩国日本视频| 久久99热99| 欧美日韩五月天| 国产精品另类一区| 另类小说视频一区二区| 在线视频中文字幕一区二区| 亚洲国产成人私人影院tom| 日本午夜精品视频在线观看| av不卡在线观看| 国产亚洲1区2区3区| 91福利区一区二区三区| 亚洲国产精品精华液ab| 伦理电影国产精品| 欧美日韩国产另类一区| 亚洲免费看黄网站| 成人听书哪个软件好| 精品国产伦一区二区三区观看方式| 亚洲综合色自拍一区| 91小视频在线免费看| 日本一区二区三区在线不卡| 国内精品国产成人国产三级粉色| 欧美肥妇free| 亚洲午夜免费电影| 欧美综合一区二区| 亚洲自拍另类综合| 欧美午夜精品一区二区三区 | 91色婷婷久久久久合中文| 国产片一区二区三区| 国内精品久久久久影院一蜜桃| 91麻豆精品国产| 日韩中文字幕一区二区三区| 欧洲一区在线观看| 亚洲在线视频网站| 91国偷自产一区二区使用方法| 国产精品久久久久久久久快鸭| 国产精品夜夜嗨| 久久精品人人做人人爽97| 精品亚洲欧美一区|