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

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

?? jdcoefct.c

?? 基于Linux的ffmepg decoder
?? C
?? 第 1 頁 / 共 5 頁
字號:
  
  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
  
  //unsigned int MCU_num_VLD=0,MCU_num_DQ_MC=0; // mainly used for debug usage
  //unsigned int v,s,last_bit,bitlen; // used for debug
  
  MCU_row_num=0;
  // Loop to process one whole iMCU row
  while(cinfo->input_iMCU_row < cinfo->total_iMCU_rows)
    {
      for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; yoffset++,MCU_row_num++) 
        {
          //for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;MCU_col_num++) 
          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++)          
            {
              // DMA stage
              if(stage_active[2])
                {
                  //check the control register write operation is done , borrowed from Winnie and Robert
   		          FA526_DrainWriteBuffer();
		  
                  while(!(pmdma->Status & 0x1)) // check DMA status until DMA stage is done
                    ;
            
                  // stage[2] is done, we made it inactive
                  stage_active[2]=FALSE; 

                  //#ifdef VPE_OUTPUT
                  //RTL_DEBUG_OUT(0x94000000 | 0xc) // signal that DMA engine is done
                  //#endif
                }
      
              // DQ-MC stage
              if(stage_active[1])
                {
                  m[2]=m[1];
          
                  //check the control register write operation is done , borrowed from Winnie and Robert
		          FA526_DrainWriteBuffer();
          
                  // if the DQ_MC stage is active, we need to check whether the DQ_MC is done or not
                  do { //check MC_done
	                READ_CPSTS(cpsts_reg)
	              } while(!(cpsts_reg&0x02));
 		          
                  // OK! MC is done, we just start the DMA procedure and activate the stage[2]
                  // and store necessary DMA command chain table (to fill eack blocks System Memory Base Address)
                  //generate_dma_chain_table (cinfo,m[2],buf_descriptor2);
                  generate_dma_noninterleaved_chain_table(cinfo,m[2],MCU_row_num,pCodec->buf_descriptor2);
          
                  // start DMA and activate stage[2]
                  #ifdef CORE_VERSION_1                    
                    pmdma->SMaddr = pCodec->pSDMA_phy;  //pmdma->SMaddr = pCodec->DMA_COMMAND_system;
//			    pmdma->LMaddr = pCodec->pLDMA+pCodec->buf_descriptor2*40;
					pmdma->LMaddr = (unsigned int) (DMA_COMMAND_LOCAL_ADDR+pCodec->buf_descriptor2*40*4);
    	    	    pmdma->BlkWidth = 0;	    	        
	    	        pmdma->CCA = (unsigned int) pCodec->pSDMA_phy;  //pmdma->CCA = (unsigned int) pCodec->DMA_COMMAND_system;
    		        pmdma->Control =  (0x04B00000 | (cinfo->blocks_in_MCU)*4); //start DMA and move DMA command buffers from local memory to system memory
    		      #elif defined(CORE_VERSION_2)
    		        // we can even don't set the SMaddr,LMaddr and BlkWidth DMA register, since
		            // we will start the DMA just right from the local memory and it is enough 
		            // to just set CCA and Control DMA registers.
//	    	        pmdma->CCA = (unsigned int) (pCodec->pLDMA+pCodec->buf_descriptor2*40) | 0x02;
	    	        pmdma->CCA = (unsigned int) (DMA_COMMAND_LOCAL_ADDR+pCodec->buf_descriptor2*40*4) | 0x02;
    		        pmdma->Control =  (0x04A00000); //start DMA from local memory    		        
    		      #else
                    #error "Please define the hardware core version (either CORE_VERSION_1 or CORE_VERSION_2)"
                  #endif
    		      
                  stage_active[2]=TRUE;
                  stage_active[1]=FALSE; // stage[1] is done, we made it inactive
                }

              // start VLD-DZ Engine and set the VLD-DZ Di-zigzag scan buffer
              if(stage_active[0])
                {
                  int action;
                  //MCU_num_DQ_MC++; // mainly used for debug usage
                  //if(MCU_num_DQ_MC==0x3c1) //0x140) // used for debug usage
                  //  MCU_num_DQ_MC=MCU_num_DQ_MC; // used for debug usage
                  
                  m[1]=m[0];
                  
                  if(!cinfo->invalid_next_restart_marker)
                  {
          
                    //check the control register write operation is done , borrowed from Winnie and Robert
  		            FA526_DrainWriteBuffer();
                    // check VLD is done or not
                    do {
	                  READ_VLDSTS(vldsts_reg)
	                } while(!(vldsts_reg&0x01));	                
        	      }
                  
  	              // READ_BADR(v) // for debug usage
	              // READ_VADR(s) // for debug usage
	              // last_bit=(s&0x001f); // for debug usage
	              // bitlen=(8-(last_bit%8))%8; // for debug usage
	              // SET_BALR(0) // for debug usage
                  
                  // BTW, we should check the error code in VLD Status Register since it may contain
                  // error if VLD fail
                  // Error Code Field for JPEG Hardware: 
                  //           value 0 represents 'No Error'
                  //           value 7 represents 'Decode DC Error'
                  //           value 8 represents 'Decode AC Error'
                  // according to software C model, we don't have to take care of such VLD error
                  // if we have the restart marker          
                  // READ_VLDSTS(vldsts_reg)  // for debug usage
                  // vldsts_reg=((vldsts_reg & 0x0f000)>>12); // for debug usage
                  // switch(vldsts_reg)
                  //  {
                  //    case 0x0: break; // no error
                  //    case 0x07: break; //cinfo->invalid_next_restart_marker=TRUE; break;//ERREXIT(cinfo, JWRN_HUFF_BAD_CODE); break; // decode dc error
                  //    case 0x08: break; //cinfo->invalid_next_restart_marker=TRUE; break;//ERREXIT(cinfo, JWRN_HUFF_BAD_CODE); break; // decode ac error
                  //    default : break; //cinfo->invalid_next_restart_marker=TRUE; break;//ERREXIT(cinfo, JWRN_HUFF_BAD_CODE); break; // other unknown error
                  //  }

                  // since the VLD is done, we should decrement the restart_to_go counter in entropy struct
                  decrement_restart_interval(cinfo);
                  
                  //check_restart_marker(cinfo);
                  //reset_previous_DC(cinfo);
                  action=check_restart_marker(cinfo);
                  if(action) // means some actions for restart marker should be taken
                    {
                      int c=7; // let's loop for advancing restart marker 7 times at most if it is action 2
                      // action 1: discard marker and let entropy decoder resume processing
                      // action 2: search next marker, to advance
                      // action 3: return without advancing past this marker. Entropy decoder
                      //           will be forced to process an empty segment.
                      do{
                        if(action==1) break;
                        else if(action==2)
                          {
                            // research and advance the restart marker
                            READ_VLDCTL(vldctl_reg)
                            vldctl_reg=(vldctl_reg&0x0fffffff0)|0x9; // set the command for JPEG search re-sync marker before decoding
                            SET_VLDCTL(vldctl_reg) 
                    
                            READ_QAR(dzar_qar) 
                            dzar_qar = ((dzar_qar & 0x0000ffff) | ((unsigned int)(pCodec->pingpong_buf[pCodec->buf_descriptor1])) << 16);
                            SET_QAR(dzar_qar) // set the de-zigzag Scan Buffer Address
          
                            // start VLD Engine , to set the MC Control Register's DEC_GO field
                            SET_MCCTL(start_VLD) //set JPEG_mode and DEC_GO and INTRA
                    
                            // check VLD is done or not
                            do {
	                          READ_VLDSTS(vldsts_reg)
	                        } while(!(vldsts_reg&0x01));                            
			                action=get_restart_action(cinfo);
                          }
                        else if(action==3)
                          { cinfo->invalid_next_restart_marker=TRUE; break; }
                        else 
                          break;
                      } while(c-- && action);
                    }
                    
                  update_next_restart_number(cinfo);

                  // switch output buffer for DQ-MC Engine
                  pCodec->buf_descriptor2^=1; // toggle buffer selection for DQ-MC output buffer
                  mciaddr_ptr = (unsigned int *)(CUR_B0 + pCodec->buf_descriptor2 * STRIDE_MCU);		  
          
                  // assign QAR register to the pingpong_buf[buf_descriptor1] as the input buffer of De-Quantization & MC Engine
                  READ_QAR(dzar_qar)
                  dzar_qar = ((dzar_qar & 0x0ffff0000) | ((unsigned int)pCodec->pingpong_buf[pCodec->buf_descriptor1]));
                  SET_QAR(dzar_qar) // set the Quantization Local Buffer Address
          
                  //#ifdef VPE_OUTPUT
                  //RTL_DEBUG_OUT(0x94000000 | 0x8) // signal that QAR register is set
                  //RTL_DEBUG_OUT(0x90000000 | (unsigned int)pingpong_buf[buf_descriptor1]) // output the QAR value
                  //#endif

                  // start DQ-MC Engine
		          SET_MCIADDR(mciaddr_ptr)			
                  SET_MCCTL(start_DQ_MC)   //set JPEG_mode and DMC_GO and INTRA
		  
                  //#ifdef VPE_OUTPUT
                  //RTL_DEBUG_OUT(0x94000000 | 9) // signal that De-Quantization & MC engine starts
                  //#endif

                  // activate stage[1]
                  stage_active[1]=TRUE;
                  stage_active[0]=FALSE; // since VLD engine is done, we made it inactive          
                }

              if(MCU_col_num <= last_MCU_col) // that means there are more MCUs for VLD Engine
                {
                  boolean restart_flag=FALSE; // to locally signal the restart situation
                  //MCU_num_VLD++; // mainly used for debug usage
                  //if(MCU_num_VLD==0x3c1) //0x140) // used for debug usage
                  //  MCU_num_VLD=MCU_num_VLD; // used for debug usage
                  
                  // READ_BADR(v) // for debug usage
	              // READ_VADR(s) // for debug usage
	              // last_bit=(s&0x001f); // for debug usage
	              // bitlen=(8-(last_bit%8))%8; // for debug usage
	              // SET_BALR(0) // for debug usage

          
                  if (processing_restart_marker(cinfo))
                    {	
                      // the restart interval is reached, and we need to instruct the VLD engine to research the restart marker
                      // just set the VLD Control Register's command
                      READ_VLDCTL(vldctl_reg) 
                      vldctl_reg=(vldctl_reg&0x0fffffff0)|0x9; // set the command for JPEG search re-sync marker before decoding
                      SET_VLDCTL(vldctl_reg) 
                      restart_flag=TRUE;
                    }
                  else
                    { // restore back to normal decoding
                      // just set the VLD Control Register's command to normal decoding
                      READ_VLDCTL(vldctl_reg)
                      vldctl_reg=(vldctl_reg&0x0fffffff0)|0x8; // set the command for JPEG normal decoding
                      SET_VLDCTL(vldctl_reg)
                    }
                    
                  m[0]=MCU_col_num;
                  
                  // switch output buffer for VLD Engine
                  if(!cinfo->invalid_next_restart_marker)
                  {
                    pCodec->buf_descriptor1^=1;
                  }
        
                  // set output buffer for VLD-DZ Engine by setting DZAR register
                  READ_QAR(dzar_qar) 
                  dzar_qar = ((dzar_qar & 0x0000ffff) | ((unsigned int)(pCodec->pingpong_buf[pCodec->buf_descriptor1])) << 16);
                  SET_QAR(dzar_qar) // set the de-zigzag Scan Buffer Address                  
                  
                  if(!cinfo->invalid_next_restart_marker)
                  {
                    // start VLD Engine , to set the MC Control Register's DEC_GO field
                    SET_MCCTL(start_VLD) //set JPEG_mode and DEC_GO and INTRA
                  }
                  
                  if(cinfo->invalid_next_restart_marker && restart_flag)
                    {
                      cinfo->invalid_next_restart_marker=FALSE;
                    }
         
                  stage_active[0]=TRUE;
                }
              else // no more MCU for VLD engine, we just make the VLD stage inactive
                stage_active[0]=FALSE;
            }
          // Completed an MCU row, but perhaps not an iMCU row
          coef->MCU_ctr = 0;
        }
    
      // Completed the iMCU row, advance counters for next one
      ++cinfo->input_iMCU_row;
      if (cinfo->input_iMCU_row < cinfo->total_iMCU_rows)
        {
          start_iMCU_row(cinfo);
        }
   }
   
  /* Completed the scan */
  //(*cinfo->inputctl->finish_input_pass) (cinfo);
  return JPEG_SCAN_COMPLETED;
}
#endif // end of #ifndef USE_INTERNAL_CPU


#ifdef BLOCK_SMOOTHING_SUPPORTED

/*
 * This code applies interblock smoothing as described by section K.8
 * of the JPEG standard: the first 5 AC coefficients are estimated from
 * the DC values of a DCT block and its 8 neighboring blocks.
 * We apply smoothing only for progressive JPEG decoding, and only if
 * the coefficients it can estimate are not yet known to full precision.
 */

/* Natural-order array positions of the first 5 zigzag-order coefficients */
#define Q01_POS  1
#define Q10_POS  8
#define Q20_POS  16
#define Q11_POS  9
#define Q02_POS  2

/*
 * Determine whether block smoothing is applicable and safe.
 * We also latch the current states of the coef_bits[] entries for the
 * AC coefficients; otherwise, if the input side of the decompressor
 * advances into a new scan, we might think the coefficients are known
 * more accurately than they really are.
 */

LOCAL(boolean)
smoothing_ok (j_decompress_ptr cinfo)
{
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
  boolean smoothing_useful = FALSE;
  int ci, coefi;
  jpeg_component_info *compptr;
  JQUANT_TBL * qtable;
  int * coef_bits;
  int * coef_bits_latch;

  if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)
    return FALSE;

  /* Allocate latch area if not already done */
  if (coef->coef_bits_latch == NULL)
    coef->coef_bits_latch = (int *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  cinfo->num_components *
				  (SAVED_COEFS * SIZEOF(int)));
  coef_bits_latch = coef->coef_bits_latch;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一卡二| 亚洲综合免费观看高清完整版在线| 天堂久久一区二区三区| 精品视频在线免费| 亚洲黄色片在线观看| 精品视频1区2区| 男人的天堂久久精品| 精品久久久久久无| 国产91在线观看丝袜| 久久久久国产成人精品亚洲午夜| 国产经典欧美精品| 中文字幕亚洲一区二区av在线| 91视频在线观看| 五月综合激情网| 精品国产乱码久久久久久蜜臀| 成人夜色视频网站在线观看| 亚洲三级在线看| 91精品国产综合久久久蜜臀粉嫩 | 91精品综合久久久久久| 男人的天堂亚洲一区| 国产精品免费观看视频| 欧美在线观看视频一区二区三区| 日韩电影在线免费观看| 国产色产综合产在线视频| 91女人视频在线观看| 免播放器亚洲一区| 中文字幕第一区综合| 欧美天堂亚洲电影院在线播放| 老司机精品视频导航| 国产精品国产三级国产a| 欧美日韩一区视频| 国产精品 欧美精品| 亚洲成人精品影院| 国产欧美日韩精品一区| 欧美日韩免费高清一区色橹橹| 精彩视频一区二区三区| 一区二区三区不卡在线观看| 26uuu亚洲| 欧美三电影在线| 不卡视频免费播放| 麻豆国产精品777777在线| 亚洲日本在线a| 欧美精品一区二区三区蜜桃视频| 99精品视频在线播放观看| 裸体歌舞表演一区二区| 亚洲综合区在线| 中文字幕高清不卡| 久久午夜老司机| 欧美一区二区三区在线观看| 91亚洲国产成人精品一区二区三| 精品在线视频一区| 亚洲亚洲精品在线观看| 最新高清无码专区| 国产午夜一区二区三区| 欧美一区二区视频网站| 日本乱码高清不卡字幕| 成人性生交大合| 激情五月婷婷综合| 秋霞成人午夜伦在线观看| 亚洲国产视频在线| 中文字幕在线视频一区| 欧美激情一区二区三区四区| 欧美变态tickling挠脚心| 欧美一区二区三区男人的天堂| 欧美午夜精品一区二区三区| 色综合天天性综合| 不卡免费追剧大全电视剧网站| 国产成人免费9x9x人网站视频| 久久99这里只有精品| 五月天激情综合网| 亚洲成人福利片| 午夜精品免费在线| 亚洲国产精品影院| 午夜精品福利在线| 午夜精品久久久久久| 日欧美一区二区| 青青草国产成人av片免费| 日韩国产精品久久久久久亚洲| 午夜精品在线看| 老鸭窝一区二区久久精品| 久久精品国产成人一区二区三区| 美女视频网站久久| 精品亚洲成a人在线观看| 紧缚捆绑精品一区二区| 国产原创一区二区三区| 国产精品77777| 成人av在线影院| 在线国产亚洲欧美| 欧美男生操女生| 精品国产欧美一区二区| 久久精品一区二区三区四区| 日本一区二区免费在线观看视频 | 国产精品影视在线观看| 国产成人自拍网| av电影在线观看一区| 99精品视频一区二区三区| 色婷婷综合五月| 欧美日韩国产成人在线免费| 欧美一区二区在线免费播放 | 成人久久18免费网站麻豆| 99久久国产综合精品麻豆| 在线观看三级视频欧美| 欧美久久久久久久久中文字幕| 欧美一级黄色片| 欧美激情一二三区| 亚洲日本护士毛茸茸| 五月天亚洲精品| 国产精品一二一区| 色婷婷国产精品| 91精品国产91久久综合桃花| 久久青草欧美一区二区三区| 亚洲色大成网站www久久九九| 日韩中文字幕亚洲一区二区va在线| 久久se精品一区二区| 91丨九色porny丨蝌蚪| 日韩视频在线一区二区| 国产精品污www在线观看| 亚洲午夜激情av| 国产精品一区二区黑丝| 色8久久精品久久久久久蜜| 日韩视频一区二区在线观看| 中文字幕一区二区三区不卡| 日韩有码一区二区三区| 成人av电影在线观看| 欧美一级理论性理论a| 亚洲美女免费视频| 国内精品国产成人| 欧美日韩在线一区二区| 国产亚洲精品aa午夜观看| 亚洲午夜在线视频| 懂色av一区二区三区蜜臀| 欧美电影一区二区| 国产精品成人免费| 国产在线精品一区二区不卡了| 91传媒视频在线播放| 久久久99精品久久| 喷水一区二区三区| 色婷婷综合久久久中文字幕| 久久人人97超碰com| 男男视频亚洲欧美| 欧美日韩在线精品一区二区三区激情| 欧美经典一区二区| 理论片日本一区| 9191久久久久久久久久久| 亚洲日本电影在线| 成人免费视频免费观看| 欧美成人艳星乳罩| 日韩高清不卡一区| 欧美影院午夜播放| 亚洲老司机在线| av电影天堂一区二区在线| 国产日韩欧美精品综合| 极品少妇xxxx精品少妇| 日韩一区二区三区四区五区六区| 亚洲综合区在线| 欧美午夜片在线看| 亚洲成av人在线观看| 91福利在线导航| 亚洲一区在线观看免费观看电影高清 | 亚洲欧美日韩电影| 国产成人免费视频精品含羞草妖精| 精品伦理精品一区| 久久精品国产第一区二区三区| 欧美一区二区三区免费在线看 | 日韩欧美电影一二三| 日韩av高清在线观看| 欧美日韩aaa| 三级精品在线观看| 欧美精品高清视频| 日本女优在线视频一区二区| 欧美日韩一区二区三区四区 | 色成人在线视频| 亚洲免费av高清| 欧美日韩电影在线| 日韩vs国产vs欧美| 日韩精品中文字幕在线不卡尤物 | 国产成人精品一区二| 久久久久久久久99精品| 国产精品一区二区三区99| 久久久久久久电影| 成人午夜看片网址| 日韩一区在线播放| 色先锋aa成人| 人人精品人人爱| 久久久亚洲综合| 99精品久久久久久| 亚洲成人在线免费| 日韩视频不卡中文| 国产精品影视天天线| 国产精品毛片高清在线完整版 | 在线精品视频一区二区三四| 亚洲国产欧美日韩另类综合| 日韩一区二区三区在线| 国产麻豆精品视频| 亚洲视频免费观看| 欧美人与z0zoxxxx视频| 美国十次综合导航| 国产精品成人网| 欧美一区二区三区在线电影| 激情另类小说区图片区视频区|