mpeg_enc.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:3k
源码类别:

DVD

开发平台:

Others

  1. #include "PlaycoreCoremainCoreGDef.h"
  2. #include "PlaycoreCaptureLogompeg_encdct.h"
  3. #include "PlaycoreCaptureLogompeg_encquantize.h"
  4. #include "PlaycoreCaptureLogompeg_encput_block.h"
  5. #include "PlaycoreCaptureLogompeg_encputbits.h"
  6. #include "PlaycoreCaptureLogompeg_encenc_io.h"
  7. #include "PlaycoreCaptureLogompeg_encenc.h"
  8. #include "Drivedrv_api.h"
  9. #include "config.h"
  10. #ifdef SUPPORT_CAPTURE_LOGO
  11. extern CONST unsigned short reflasher[1536];
  12. LOGOCAPTURE* pLogoCapture = NULL;
  13. void init_io(void);
  14. void io_end(void);
  15. int StartCaptureLogo( int hsize, int vsize , int aspect_ratio, int out_scale)
  16. {
  17. int iSectorCount;
  18. // drv_to_wait_for_logo_capture_finish();
  19. asm{cli}; // clear interrupt enable flag
  20. Init_FLASH_Burner_API();
  21.   if(NULL == pLogoCapture)
  22.  pLogoCapture = malloc(sizeof(LOGOCAPTURE));
  23.   if(vsize < 480)
  24.     pLogoCapture->bSingleField = 1;
  25.   else
  26.     pLogoCapture->bSingleField = 0;
  27.   pLogoCapture->TopFld=1;
  28. pLogoCapture->Hsize = hsize;
  29. pLogoCapture->Vsize = vsize;
  30. init_io();
  31. putseq(pLogoCapture->Hsize,pLogoCapture->Vsize,aspect_ratio,0,LOGO_QUALITY); //jerry LOGO_QUALITY was 16
  32. io_end();
  33. iSectorCount = pLogoCapture->sectors_cnt;
  34. free(pLogoCapture);
  35.    pLogoCapture = NULL;
  36. // drv_logo_capture_finished();
  37. asm{sti}; // set interrupt enable flag
  38. #ifdef _DEBUG
  39. tr_printf(("hsize: %8xn", hsize));
  40. tr_printf(("vsize: %8xn", vsize));
  41. tr_printf(("aspect_ratio: %8xn", aspect_ratio));
  42. tr_printf(("iSectorCount: %8xn", iSectorCount));
  43. #endif
  44. return iSectorCount;
  45. }
  46. int CL_GetBitsAspectRatio(void)
  47. {
  48. return gps->cl_AR;
  49. }
  50. int CL_GetOutScalling(void)
  51. {
  52. return gps->cl_OutScalling;
  53. }
  54. /**********************************************************************************
  55.  Purpose          : return if logo was captured
  56.  Input Parameters :
  57.  Return Value     :
  58.  Comment:   :
  59. **********************************************************************************/
  60. int CL_IsLogoCaptured(void)
  61. {
  62. if( gps->captureLogoKWords == -1 || gps->captureLogoKWords > LOGO_SIZE_IN_DVD_SECTORS)
  63.     return 0;
  64. else
  65.     return 1;
  66. }
  67. /**********************************************************************************
  68.  Purpose          :  write captured logo bitstream to DVP
  69.  Input Parameters :  none
  70.  Return Value     :
  71.  Comment:   :
  72. **********************************************************************************/
  73. void CL_WriteBitstream(void)
  74. {
  75. int i;
  76. unsigned short huge *FlashADDR;
  77. FlashADDR = LOGO_ADDR;
  78. for(i = 0; i < gps->captureLogoKWords; i++)
  79.    {
  80. if(!I49_BitstreamWrite8Bit((BYTE*)FlashADDR , 2048 ))
  81. {
  82.     tr_printf (("Timeout while sending bitstreamn"));
  83. }
  84. FlashADDR += 1024;
  85. }
  86. }
  87. #endif