Ignore:
Timestamp:
Jun 11, 2010 1:38:42 PM (14 years ago)
Author:
nanang
Message:

Close #1072:

  • Added API pjmedia_codec_g722_set_pcm_shift() to enable configurable level-adjusment setting.
  • Also added macro PJMEDIA_G722_DEFAULT_PCM_SHIFT (default value is 2) to accomplish 14-16 bit PCM conversion for G722 input/output.
  • Added a feature in G722 to stop level-adjusment/PCM-shifting when clipping occured, compile-time configurable via PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING macro.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia-codec/config.h

    r2875 r3202  
    9595#ifndef PJMEDIA_HAS_G722_CODEC 
    9696#   define PJMEDIA_HAS_G722_CODEC    1 
     97#endif 
     98 
     99 
     100/** 
     101 * Default G.722 codec encoder and decoder level adjustment. The G.722 
     102 * specifies that it uses 14 bit PCM for input and output, while PJMEDIA 
     103 * normally uses 16 bit PCM, so the conversion is done by applying 
     104 * level adjustment. If the value is non-zero, then PCM input samples to 
     105 * the encoder will be shifted right by this value, and similarly PCM 
     106 * output samples from the decoder will be shifted left by this value. 
     107 * 
     108 * This can be changed at run-time after initialization by calling 
     109 * #pjmedia_codec_g722_set_pcm_shift(). 
     110 * 
     111 * Default: 2. 
     112 */ 
     113#ifndef PJMEDIA_G722_DEFAULT_PCM_SHIFT 
     114#   define PJMEDIA_G722_DEFAULT_PCM_SHIFT           2 
     115#endif 
     116 
     117 
     118/** 
     119 * Specifies whether G.722 PCM shifting should be stopped when clipping 
     120 * detected in the decoder. Enabling this feature can be useful when 
     121 * talking to G.722 implementation that uses 16 bit PCM for G.722 input/ 
     122 * output (for any reason it seems to work) and the PCM shifting causes 
     123 * audio clipping. 
     124 * 
     125 * See also #PJMEDIA_G722_DEFAULT_PCM_SHIFT. 
     126 * 
     127 * Default: enabled. 
     128 */ 
     129#ifndef PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING 
     130#   define PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING  1 
    97131#endif 
    98132 
Note: See TracChangeset for help on using the changeset viewer.