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

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

?? jpeg_dec.c

?? 基于Linux的ffmepg decoder
?? C
字號:
#include "jpeg_dec.h"#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications *///#include "jmemsys.h"		/* import the system-dependent declarations */// reserve space for input bitstream, output YUV, golden bitstream under RTL simulation#ifdef RTL_PLATFORM  // Under RTL simulation, we have to embedded the JPEG bitstream inside executable program.  // So we include the array of JPEG bitstream to compile with program body.  #include "input_stream.h"    // Under RTL simulation, we reserve the output YUV space inside executable program.  // So we include the array of decoded image result to compile with program body.  #include "output_stream.h"    // include the 'golden_stream.h' file for the purpose of automatically comparing decoding  // result durin RTL simulation  #include "golden_stream.h"  unsigned char* goldendata[]={ (unsigned char *) goldenstream0, (unsigned char *) goldenstream1,(unsigned char *) goldenstream2 };  unsigned long int goldendata_len[]={sizeof(goldenstream0),sizeof(goldenstream1),sizeof(goldenstream2)};#endif#ifdef USE_INTERNAL_CPU  //#ifdef FPGA_PLATFORM    //#include "intercpucode_fpga.h"  //#elif defined(RTL_PLATFORM)    //#include "intercpucode_rtl.h"  //#else    //#error "Please define the platfrom flags in project setting (either FPGA_PLATFORM or RTL_PLATFORM)"  //#endif  #include "intercpucode.h"#endif/* Create the add-on message string table. */#define JMESSAGE(code,string)	string ,static const char * const cdjpeg_message_table[] = {#include "cderror.h"  NULL};//struct jpeg_decompress_struct cinfo;//struct jpeg_error_mgr jerr;void Init_FTMCP100(j_decompress_ptr cinfo,FJPEG_DEC_PARAM * ptParam){  unsigned int *inbitstr;  unsigned int vldsts_reg;    // You don't have to free the 'pCodec' since we use the 'alloc_small' function.  FTMCP100_CODEC *pCodec=(FTMCP100_CODEC *) (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,sizeof(FTMCP100_CODEC));    // attach our FTMCP100 Codec object to decompression object  cinfo->pCodec=pCodec;  // To initialize this global variable BASE_ADDRESS in the first place  // or all other reigster access depend on this global variable  pCodec->pCoreBaseAddr=ptParam->pu32BaseAddr;    pCodec->pfnDmaMalloc=(void *)ptParam->pfnDmaMalloc;  pCodec->pfnDmaFree=(void *)ptParam->pfnDmaFree;    #ifdef CORE_VERSION_1    // ten blocks at most.. and each DMA command set occupies 4 words    // and we allocate the system DMA memory about 4*10*4=160 bytes with 16-byte alignment    pCodec->pSDMA_virt=(unsigned char*)(*(DMA_MALLOC_PTR)pCodec->pfnDmaMalloc)(160,16,16,&pCodec->pSDMA_phy);  #endif    pCodec->pingpong_buf[0] = (unsigned short *) (PINGPONG_BUFFER_0_ADDR);  pCodec->pingpong_buf[1] = (unsigned short *) (PINGPONG_BUFFER_1_ADDR);    pCodec->pLDMA = (unsigned int *) (DMA_COMMAND_LOCAL_ADDR+pCodec->pCoreBaseAddr);    #ifdef USE_INTERNAL_CPU    pCodec->pLDMA_INTERNAL_CPU = (unsigned int *) (DMA_COMMAND_INTERNAL_CPU+pCodec->pCoreBaseAddr);  #endif    // initialize the buffer descriptor  pCodec->buf_descriptor1=0; // used to select ping pong buffer for VLD output  pCodec->buf_descriptor2=0; // used to select buffer between DQ-MC stage and DMA stage (indicated by MCIADDR for DQ-MC engine output)      // initialze some varaibles here  #ifdef RTL_PLATFORM    // 'instream' variable is defined in the file 'input_stream.h'    inbitstr = (unsigned int *)instream; // set input bitstream location  #else    inbitstr = (unsigned int *)ptParam->pu8BitstreamAddr; // set input bitstream location  #endif    SET_VLDCTL(1<<5) //stop autobuffer in case previous firmware program did not terminate normally  SET_PYDCR(0)  // set JPEG Previous Y DC Value Register to zero	SET_PUVDCR(0) // set JPEG Previous UV DC Value Register to zero	SET_CKR(CKR_RATIO) // set Coprocessor Clock Control Register	SET_VADR(VLD_AUTOBUFFER_ADDR)  // set VLD Data Address Register (in Local Memory)	SET_BADR(0) // reset the Bitstream Access Data Regsiter	SET_BALR(0) // reset the Bitstream Access Length Register 	SET_ABADR((unsigned int)inbitstr) // set Auto-Buffer System Data Address for VLD read operation	SET_VLDCTL(0x58)  //Autobuffer Start (1011000) , just enable the VLD autobuffer engine and enable endian swapping (bit 6)	SET_MCCADDR(0)  // we set MCCADDR to zero on purpose 	  #ifdef USE_INTERNAL_CPU    // we might need to reset the internal CPU before decoding under embedded-CPU architecture    SET_INCTL(1<<19) // reset internal CPU  #endif  // before read the header, we ought to check if the auto-buffer is ready for access or not  // check autobuffer access is done or not  do {    READ_VLDSTS(vldsts_reg)	} while(!(vldsts_reg&0x0800));}void *FJpegDecCreate(FJPEG_DEC_PARAM * ptParam){   struct jpeg_decompress_struct *cinfo;  struct jpeg_error_mgr *jerr;    #ifdef USE_INTERNAL_CPU    FTMCP100_CODEC *pCodec;    volatile MDMA *pmdma;    unsigned int internal_cpu_code_word_length;    int ci; unsigned int *p;    #endif     #ifdef RTL_PLATFORM    __rt_lib_init(0x50000, 0x200000);        _fp_init();  #endif  // start the out operation  #ifdef VPE_OUTPUT    RTL_DEBUG_OUT(0x91111111) // begin VPE operation  #endif    cinfo=malloc(sizeof(struct jpeg_decompress_struct));  jerr=malloc(sizeof(struct jpeg_error_mgr));  // Initialize the JPEG decompression object with default error handling.  cinfo->err = jpeg_std_error(jerr); //cinfo.err = jpeg_std_error(&jerr);  jpeg_create_decompress(cinfo); //jpeg_create_decompress(&cinfo);  // Add some application-specific error messages (from cderror.h)  jerr->addon_message_table = cdjpeg_message_table; //jerr.addon_message_table = cdjpeg_message_table;  jerr->first_addon_message = JMSG_FIRSTADDONCODE; //jerr.first_addon_message = JMSG_FIRSTADDONCODE;  jerr->last_addon_message = JMSG_LASTADDONCODE; //jerr.last_addon_message = JMSG_LASTADDONCODE;    Init_FTMCP100(cinfo,ptParam);    #ifdef USE_INTERNAL_CPU    pCodec=(FTMCP100_CODEC *)cinfo->pCodec;#ifndef LINUX    pmdma = MDMA1; // used to access the DMA register    pmdma->Status = 1;    // let's set the DMA command buffer for loading the internal CPU code to internal    // local memory, seems not work...let's use data move ...    // improve it by DMA later    internal_cpu_code_word_length=sizeof(InterCPUcode) / sizeof(unsigned int);    #ifdef VPE_OUTPUT      //RTL_DEBUG_OUT(0x90000000 | internal_cpu_code_word_length) // print the word length of internal cpu code    #endif    // copy from Winnie's code    pCodec->pLDMA_INTERNAL_CPU[0]=InterCPUcode;	pCodec->pLDMA_INTERNAL_CPU[1]=pCodec->pCoreBaseAddr;	pCodec->pLDMA_INTERNAL_CPU[2]=0x0;	pCodec->pLDMA_INTERNAL_CPU[3]=0x0<<26 | 0x8<<20 | internal_cpu_code_word_length;	pmdma->CCA = (((unsigned int) pCodec->pLDMA_INTERNAL_CPU)&0xfffffff0) | 0x2;	pmdma->Control = 0xa<<20 | 0x1<<26;				//start DMA#else     memcpy (pCodec->pCoreBaseAddr, InterCPUcode, sizeof(InterCPUcode));#endif    // to print the internal CPU code    /*    p=(unsigned int*)ptParam->pu32BaseAddr;    for(ci=0;ci<internal_cpu_code_word_length;ci++)      {        #ifdef VPE_OUTPUT          //RTL_DEBUG_OUT(0x90000000 | (InterCPUcode[ci]&0x0fffffff))        #endif        *p=InterCPUcode[ci];        p++;      }    */   #endif    // Specify data source for decompression  jpeg_stdio_src(cinfo, NULL); //jpeg_stdio_src(&cinfo, NULL);    return (void *)cinfo;}JPEGDEC_EXPOPRT void FJpegDecReadHeader(void *dec_handle,FJPEG_DEC_RESULT *pDecResult){  int ci;  jpeg_component_info *compptr;  struct jpeg_decompress_struct *cinfo=(struct jpeg_decompress_struct *) dec_handle;    (void) jpeg_read_header(cinfo, TRUE); //(void) jpeg_read_header(&cinfo, TRUE);    // Start decompressor  (void) jpeg_start_decompress(cinfo); //(void) jpeg_start_decompress(&cinfo);    // fill the members of FJPEG_DEC_RESULT data structure for return  pDecResult->u32ImageWidth=cinfo->image_width;  pDecResult->u32ImageHeight=cinfo->image_height;  pDecResult->u8NumComponents=cinfo->num_components;  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;ci++, compptr++)     {      pDecResult->rgComponentInfo[ci].m_u8HSamplingFrequency=compptr->h_samp_factor;      pDecResult->rgComponentInfo[ci].m_u8VSamplingFrequency=compptr->v_samp_factor;      if(jpeg_has_multiple_scans(cinfo))        { // it the image is non-interleaved format , one block per MCU          pDecResult->rgComponentInfo[ci].m_u32ComponentWidth= compptr->width_in_blocks * DCTSIZE;          pDecResult->rgComponentInfo[ci].m_u32ComponentHeight= compptr->height_in_blocks * DCTSIZE;          //m=compptr->MCU_blocks*compptr->width_in_blocks * compptr->height_in_blocks;        }      else        {          pDecResult->rgComponentInfo[ci].m_u32ComponentWidth= cinfo->MCUs_per_row * compptr->MCU_width * DCTSIZE;          pDecResult->rgComponentInfo[ci].m_u32ComponentHeight= cinfo->MCU_rows_in_scan * compptr->MCU_height * DCTSIZE;                    //m=compptr->MCU_blocks*cinfo->MCUs_per_row*cinfo->MCU_rows_in_scan;        }              pDecResult->rgComponentInfo[ci].m_u32ComponentTotalSize=pDecResult->rgComponentInfo[ci].m_u32ComponentWidth * pDecResult->rgComponentInfo[ci].m_u32ComponentHeight;    }}JPEGDEC_EXPOPRT void FJpegDecDecode(void *dec_handle,FJPEG_DEC_PARAM *ptParam){  struct jpeg_decompress_struct *cinfo=(struct jpeg_decompress_struct *) dec_handle;  FTMCP100_CODEC *pCodec=(FTMCP100_CODEC *)cinfo->pCodec;  int ci;  #ifdef USE_INTERNAL_CPU    volatile MDMA *pmdma = MDMA1;  #endif    // And record the output YUV buffer 8-byte aligned address to the pCodec object  #ifdef RTL_PLATFORM    unsigned char* outdata[]={ (unsigned char *) outstream0, (unsigned char *) outstream1,(unsigned char *) outstream2 };    for(ci=0; ci<ptParam->u8NumComponents; ci++)      pCodec->outdata[ci]=outdata[ci];  #else    for(ci=0; ci<ptParam->u8NumComponents; ci++)      pCodec->outdata[ci]=ptParam->pu8YUVAddr[ci];  #endif  // if it is interleaved image, we set the DMA stuff here...  if(! jpeg_has_multiple_scans(cinfo)) //if(! jpeg_has_multiple_scans(&cinfo))      (void) ftmcp100_set_mcu_dma_params(cinfo); //(void) ftmcp100_set_mcu_dma_params(&cinfo); // to set the MCUTIR and MCUBR register   // we need to flush the D cache or the result will be wrong   FA526_CleanInvalidateDCacheAll();    // Process data  #ifdef VPE_OUTPUT    RTL_DEBUG_OUT(0x94000000 | 6) // beginning of decoding  #endif    #ifdef USE_INTERNAL_CPU    // remember that we have start the DMA trasnfer of internal CPU code in    // FJpegDecCreate() function, so we need to check the DMA status right here...   #ifndef LINUX    while(!(pmdma->Status & 0x1)) ; // check DMA is done  #endif  #endif      while (cinfo->output_scanline < cinfo->output_height) { //while (cinfo.output_scanline < cinfo.output_height) {    jpeg_read_scanlines(cinfo, NULL,0);        /*    num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,					dest_mgr->buffer_height);        (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);    */  }     #ifdef VPE_OUTPUT    RTL_DEBUG_OUT(0x94000000 | 7) // end of decoding  #endif  // dump the YUV data in System Memory which was moved from Local Memory  //......................   #ifdef VPE_OUTPUT  #ifdef VPE_DUMP_YUV   (void) ftmcp100_dump_yuv(cinfo); // to dump the final result for YUV data  #endif  #endif  SET_VLDCTL(0x28)  //Autobuffer Stop}void FJpegDecDestroy(void *dec_handle){   struct jpeg_decompress_struct *cinfo=(struct jpeg_decompress_struct *) dec_handle;    struct jpeg_error_mgr *jerr=cinfo->err;    #if (defined(RTL_PLATFORM) || defined(CORE_VERSION_1) )    FTMCP100_CODEC *pCodec=(FTMCP100_CODEC *)cinfo->pCodec;  #endif      #ifdef RTL_PLATFORM    if(cinfo->num_components)    {      int ci,gi;      for (ci=0;ci<cinfo->num_components;ci++)        {          int error_flag=0;          for(gi=0;gi<goldendata_len[ci];gi++)            {              // to show bitstream data		      RTL_DEBUG_OUT(0x97000000 | (unsigned int)(pCodec->outdata[ci])[gi]) // dump the encoded bitstream data              if ((pCodec->outdata[ci])[gi]!=(goldendata[ci])[gi])                {                   // to show the gloden data since there is error                  RTL_DEBUG_OUT(0x98000000 | (unsigned int)(goldendata[ci])[gi]) // dump the encoded bitstream data                  error_flag=1;                  break;                }            }          if(error_flag)            { RTL_DEBUG_OUT(0x01234569) break; }  // Fail!          else            RTL_DEBUG_OUT(0x01234568) // Pass!        }    }  #endif      #ifdef CORE_VERSION_1    // ten blocks at most.. and each DMA command set occupies 4 words    // and we free the allocated system DMA memory with physical address and virtual address    (*(DMA_FREE_PTR)pCodec->pfnDmaFree)(pCodec->pSDMA_virt,pCodec->pSDMA_phy);  #endif    #ifdef VPE_OUTPUT    RTL_DEBUG_OUT(0x91222222) // means end of entire jpeg decoder  #endif    (void) jpeg_finish_decompress(cinfo);    #ifdef VPE_OUTPUT    RTL_DEBUG_OUT(0x01234567) // VPE Debug Finish  #endif    jpeg_destroy_decompress(cinfo);  //free(pCodec); // we don't have to free the pCodec since we use (*cinfo->mem->alloc_small) function to allocate the memory  free(jerr);  free(cinfo);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.亚洲色图.com| 亚洲精品国产无天堂网2021| 久久久久成人黄色影片| 国产精品入口麻豆原神| 一区二区三区四区视频精品免费| 亚洲成人免费观看| 国产美女在线精品| 日本电影欧美片| 精品国产91亚洲一区二区三区婷婷 | 欧美夫妻性生活| 久久精品人人做人人爽人人| 18欧美亚洲精品| 琪琪一区二区三区| av中文字幕不卡| 欧美一级日韩免费不卡| 亚洲欧美中日韩| 蜜臀久久久久久久| 91老司机福利 在线| 欧美videofree性高清杂交| 亚洲色图清纯唯美| 国产综合成人久久大片91| 在线精品视频一区二区| 久久综合给合久久狠狠狠97色69| 一级女性全黄久久生活片免费| 国产欧美精品一区二区色综合 | 天堂av在线一区| 国产乱码精品一区二区三区五月婷| 成人免费看视频| 欧美日韩国产一级| 国产精品天干天干在线综合| 亚洲成av人**亚洲成av**| 国产一本一道久久香蕉| 在线观看亚洲精品| 日本少妇一区二区| 国产精品久久久久久久久搜平片| 伊人婷婷欧美激情| 麻豆精品在线看| 国产suv精品一区二区6| 欧美日韩国产一级二级| 欧美国产精品一区二区| 日本成人在线看| 色哟哟一区二区| 精品国产精品网麻豆系列| 亚洲自拍偷拍网站| 国产激情一区二区三区| 欧美日韩亚洲综合| 国产精品国产三级国产aⅴ原创| 日韩高清不卡在线| 色吧成人激情小说| 欧美激情在线观看视频免费| 三级不卡在线观看| 91免费观看在线| 国产亚洲欧美激情| 免费成人美女在线观看.| 色老汉一区二区三区| 欧美国产国产综合| 男人的天堂久久精品| 懂色一区二区三区免费观看| 欧美一区二区免费| 国产精品无圣光一区二区| 精品在线亚洲视频| 欧美一区二区三区在线观看 | 久久九九久久九九| 日日夜夜精品视频天天综合网| 成人小视频在线观看| 久久女同互慰一区二区三区| 国产亚洲一区二区三区在线观看 | 欧美图区在线视频| 中国色在线观看另类| 日本一区二区三区在线观看| 日韩av成人高清| 色哟哟国产精品| 国产欧美日韩精品a在线观看| 日韩专区在线视频| 91色在线porny| 国产精品视频九色porn| 极品少妇xxxx偷拍精品少妇| 欧美一级xxx| 五月激情丁香一区二区三区| 在线精品亚洲一区二区不卡| 亚洲精品欧美二区三区中文字幕| 久久嫩草精品久久久久| 一区二区三区中文字幕| 丁香婷婷综合网| 久久奇米777| 高清shemale亚洲人妖| 亚洲国产高清aⅴ视频| 国产精品69毛片高清亚洲| 国产日韩欧美在线一区| 国产东北露脸精品视频| 91麻豆精品国产综合久久久久久 | 99精品一区二区| 一区精品在线播放| 91蜜桃婷婷狠狠久久综合9色| 一区在线观看视频| 日本精品一区二区三区高清 | 26uuu精品一区二区三区四区在线| 五月激情丁香一区二区三区| 欧美日韩国产免费| 亚洲成人资源在线| 91麻豆精品国产91久久久| 蜜桃av噜噜一区二区三区小说| 精品视频在线免费看| 亚洲一区二区三区免费视频| 成人国产亚洲欧美成人综合网| 日韩午夜在线观看视频| 日本欧洲一区二区| 欧美男人的天堂一二区| 日本强好片久久久久久aaa| 久久综合色天天久久综合图片| 青青草成人在线观看| 久久久久久电影| 97成人超碰视| 天天色 色综合| 日韩欧美精品在线视频| 韩国三级在线一区| 国产精品白丝在线| 欧美日韩www| 国产一区二区看久久| 国产精品久久久久久户外露出 | 91视频国产观看| 偷拍与自拍一区| 丁香激情综合五月| 青草av.久久免费一区| 精品1区2区在线观看| 波多野洁衣一区| 日韩高清一区二区| 欧美极品少妇xxxxⅹ高跟鞋| 色婷婷av一区二区三区之一色屋| 亚洲精选视频在线| 欧美精品久久久久久久久老牛影院| 国产伦精一区二区三区| 综合在线观看色| 欧美亚洲综合久久| 日本欧美肥老太交大片| 中文字幕乱码一区二区免费| 欧美人动与zoxxxx乱| 老司机精品视频导航| 精品国产免费久久| 欧美性受极品xxxx喷水| 国产盗摄精品一区二区三区在线 | 国产精品一区不卡| 亚洲成人免费看| 国产精品午夜电影| 欧美电影精品一区二区| 色女孩综合影院| 国内欧美视频一区二区 | 亚洲国产高清在线观看视频| 欧美裸体一区二区三区| 精品在线观看免费| 亚洲欧美日韩国产另类专区| 26uuu成人网一区二区三区| 欧美视频精品在线| 成人ar影院免费观看视频| 奇米综合一区二区三区精品视频| 亚洲欧美日韩精品久久久久| 久久午夜老司机| 91麻豆精品91久久久久同性| 色哟哟国产精品免费观看| 国产精品911| 蜜桃91丨九色丨蝌蚪91桃色| 亚洲国产日产av| 18成人在线视频| 日本一区二区三区在线观看| 欧美日韩在线免费视频| 成a人片亚洲日本久久| 韩国女主播成人在线| 天堂影院一区二区| 一区二区三区日韩精品| 日本一区二区三区视频视频| 日韩免费电影一区| 欧美一区二区三区四区五区| 欧美在线三级电影| 色综合色综合色综合| 成人国产精品免费网站| 老司机精品视频一区二区三区| 久久久国产午夜精品 | 国产精品―色哟哟| 国产精品视频九色porn| 国产色产综合色产在线视频| 久久综合成人精品亚洲另类欧美 | 国产精品久久毛片a| 国产乱码精品一区二区三区av| 一区免费观看视频| 国产精品乱人伦| 精品欧美一区二区久久| 日韩一级成人av| 欧美电视剧在线看免费| 欧美电视剧免费观看| 日韩欧美中文字幕制服| 日韩欧美一级在线播放| 欧美岛国在线观看| 日韩精品影音先锋| 日韩欧美一区二区不卡| 精品国产三级a在线观看| 欧美xfplay| 久久伊99综合婷婷久久伊| 91麻豆精品国产综合久久久久久| 欧美剧情片在线观看| 91精品国产一区二区三区|