DSP3Codec.inc
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:4k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef _DSP3CODEC_INC_
  2. #define _DSP3CODEC_INC_
  3. // **************************************************************************************** //
  4. const DSP3_CODEC_INFO* g_aDSP3CodecInfo[] =
  5. {
  6.     //CODING_MODE_AC3
  7.     &DSP3Info_AC3,
  8.     
  9.     //CODING_MODE_PPCM
  10. #ifdef DVD_AUDIO  
  11.     &DSP3Info_PPCM,
  12. #else
  13.     &DSP3Info_MP3,
  14. #endif
  15.     //CODING_MODE_MP1
  16.     &DSP3Info_MP3,
  17.     
  18.     //CODING_MODE_MP2
  19.     &DSP3Info_MP3,
  20.     
  21.     //CODING_MODE_LPCM
  22.     &DSP3Info_LPCM,
  23.     //CODING_MODE_JPG
  24.     &DSP3Info_MP3,
  25.     
  26.     //CODING_MODE_DTS
  27. #if !defined(NO_DTS_OUTPUT)||defined(FORCE_NO_DTS_OUTPUT)
  28.     &DSP3Info_DTS,
  29. #elif defined(DTS_SPDIF_NO_OUTPUT)
  30.     &DSP3Info_AC3,
  31. #else
  32.     &DSP3Info_SPDIF,
  33. #endif
  34.     //CODING_MODE_SDDS
  35.     &DSP3Info_MP3,
  36.     
  37.     //CODING_MODE_MP3
  38.     &DSP3Info_MP3,
  39.     
  40.     //CODING_MODE_PCM
  41. #ifdef  USE_LPCM_REPLACE_PCM
  42.     &DSP3Info_LPCM,
  43. #else        
  44.     &DSP3Info_CD,
  45. #endif
  46.     //CODING_MODE_MIDI
  47. #ifdef SUPPORT_MIDI
  48.     &DSP3Info_MIDI,
  49. #else
  50.     &DSP3Info_MP3,
  51. #endif
  52.     //CODING_MODE_NES
  53. #ifdef SUPPORT_NESGAME
  54.     &DSP3Info_NES,
  55. #else
  56.     &DSP3Info_MP3,
  57. #endif
  58.     //CODING_MODE_SPDIF
  59. #if ( defined(SDRAM_16Mb_Mode) && !defined(SUPPORT_SDRAM16M_AC3_5_1CH_OUTPUT) && !defined(RAW_HAVE_ANALOG_OUTPUT) ) 
  60.     &DSP3Info_SPDIF,
  61. #else
  62.     &DSP3Info_MP3,
  63. #endif
  64.     //CODING_MODE_DTSCD
  65. #if defined(NO_DTS_OUTPUT) && !defined(FORCE_NO_DTS_OUTPUT)
  66.     #ifdef  USE_LPCM_REPLACE_PCM
  67.         #if defined(DTS_SPDIF_NO_OUTPUT)
  68.     &DSP3Info_AC3,
  69.         #else
  70.     &DSP3Info_LPCM,
  71.         #endif
  72.     #else        
  73.         #if defined(DTS_SPDIF_NO_OUTPUT)
  74.     &DSP3Info_AC3,
  75.         #else
  76.     &DSP3Info_CD,
  77.         #endif        
  78.     #endif
  79. #else
  80.     #if defined(SPHE8202) || defined(SPHE1000)
  81.     &DSP3Info_DTS,
  82.     #else        
  83.     &DSP3Info_DTSCD,
  84.     #endif        
  85. #endif
  86.     
  87.     //CODING_MODE_WMA
  88. #ifdef SUPPORT_WMA
  89.     &DSP3Info_WMA,
  90. #else
  91.     &DSP3Info_MP3,
  92. #endif
  93. #ifdef SUPPORT_SPDIF_IN
  94.     //CODING_MODE_SPDIFINCD
  95.     &DSP3Info_SPDIFINCD,
  96.     
  97.     //CODING_MODE_SPDIFINAC3
  98.     &DSP3Info_SPDIFINAC3,
  99. #ifdef SUPPORT_SPDIF_DTS    
  100.     //CODING_MODE_SPDIFINDTS
  101.     &DSP3Info_SPDIFINDTS,
  102. #endif    
  103. #else
  104.     //CODING_MODE_SPDIFINCD
  105.     &DSP3Info_MP3,
  106.     
  107.     //CODING_MODE_SPDIFINAC3
  108.     &DSP3Info_MP3,
  109.     
  110.     //CODING_MODE_SPDIFINDTS
  111.     &DSP3Info_MP3,
  112. #endif
  113.     //CODING_MODE_TUNER
  114. #if defined(SUPPORT_AV_IN) || defined(SUPPORT_SECOND_AV_IN) || defined(SUPPORT_TUNER_MV114)
  115.     &DSP3Info_TUNER,
  116. #else
  117.     &DSP3Info_MP3,
  118. #endif
  119.     //CODING_MODE_NOISE
  120. #ifdef SUPPORT_TESTSPK
  121.     &DSP3Info_NOISE,
  122. #else
  123.     &DSP3Info_MP3,
  124. #endif
  125.     //CODING_MODE_AAC
  126. #ifdef SUPPORT_AAC
  127.     &DSP3Info_AAC,
  128. #else
  129.     &DSP3Info_MP3,
  130. #endif
  131. };
  132. // **************************************************************************************** //
  133. static inline UINT32 GetDSPCodecIndex( UINT32 uiCodingMode )
  134. {
  135.     UINT32 i = 0;
  136.     for( ; i < 32; i++ )
  137.     {
  138.         if( ( uiCodingMode >> i ) & 0x01 )
  139.             break;
  140.     }
  141.     // if something wrong with our input, using MP3 codec
  142.     return ( i >= sizeof( g_aDSP3CodecInfo ) / sizeof( DSP3_CODEC_INFO* ) ) ? CODING_MODE_MP3 : i;
  143. }
  144. // **************************************************************************************** //
  145. static inline const DSP3_CODEC_INFO* GetDSPCodecInfo( UINT32 uiIndex )
  146. {
  147.     return g_aDSP3CodecInfo[ uiIndex ];
  148. }
  149. // **************************************************************************************** //
  150. #endif