mpeg_enc.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:3k
- #include "PlaycoreCoremainCoreGDef.h"
- #include "PlaycoreCaptureLogompeg_encdct.h"
- #include "PlaycoreCaptureLogompeg_encquantize.h"
- #include "PlaycoreCaptureLogompeg_encput_block.h"
- #include "PlaycoreCaptureLogompeg_encputbits.h"
- #include "PlaycoreCaptureLogompeg_encenc_io.h"
- #include "PlaycoreCaptureLogompeg_encenc.h"
- #include "Drivedrv_api.h"
- #include "config.h"
- #ifdef SUPPORT_CAPTURE_LOGO
- extern CONST unsigned short reflasher[1536];
- LOGOCAPTURE* pLogoCapture = NULL;
- void init_io(void);
- void io_end(void);
- int StartCaptureLogo( int hsize, int vsize , int aspect_ratio, int out_scale)
- {
- int iSectorCount;
- // drv_to_wait_for_logo_capture_finish();
- asm{cli}; // clear interrupt enable flag
- Init_FLASH_Burner_API();
- if(NULL == pLogoCapture)
- pLogoCapture = malloc(sizeof(LOGOCAPTURE));
- if(vsize < 480)
- pLogoCapture->bSingleField = 1;
- else
- pLogoCapture->bSingleField = 0;
- pLogoCapture->TopFld=1;
- pLogoCapture->Hsize = hsize;
- pLogoCapture->Vsize = vsize;
- init_io();
- putseq(pLogoCapture->Hsize,pLogoCapture->Vsize,aspect_ratio,0,LOGO_QUALITY); //jerry LOGO_QUALITY was 16
- io_end();
- iSectorCount = pLogoCapture->sectors_cnt;
- free(pLogoCapture);
- pLogoCapture = NULL;
- // drv_logo_capture_finished();
- asm{sti}; // set interrupt enable flag
- #ifdef _DEBUG
- tr_printf(("hsize: %8xn", hsize));
- tr_printf(("vsize: %8xn", vsize));
- tr_printf(("aspect_ratio: %8xn", aspect_ratio));
- tr_printf(("iSectorCount: %8xn", iSectorCount));
- #endif
- return iSectorCount;
- }
- int CL_GetBitsAspectRatio(void)
- {
- return gps->cl_AR;
- }
- int CL_GetOutScalling(void)
- {
- return gps->cl_OutScalling;
- }
- /**********************************************************************************
- Purpose : return if logo was captured
- Input Parameters :
- Return Value :
- Comment: :
- **********************************************************************************/
- int CL_IsLogoCaptured(void)
- {
- if( gps->captureLogoKWords == -1 || gps->captureLogoKWords > LOGO_SIZE_IN_DVD_SECTORS)
- return 0;
- else
- return 1;
- }
- /**********************************************************************************
- Purpose : write captured logo bitstream to DVP
- Input Parameters : none
- Return Value :
- Comment: :
- **********************************************************************************/
- void CL_WriteBitstream(void)
- {
- int i;
- unsigned short huge *FlashADDR;
- FlashADDR = LOGO_ADDR;
- for(i = 0; i < gps->captureLogoKWords; i++)
- {
- if(!I49_BitstreamWrite8Bit((BYTE*)FlashADDR , 2048 ))
- {
- tr_printf (("Timeout while sending bitstreamn"));
- }
- FlashADDR += 1024;
- }
- }
- #endif