Ignore:
Timestamp:
Aug 1, 2009 9:20:59 AM (13 years ago)
Author:
bennylp
Message:

Initial commit for ticket #929: Improve packet lost concealment (PLC) when handling burst of lost packets

WSOLA improvements:

  • Introduce fade-out and fade-in effect
  • Limit the number of continuous synthetic samples (only take effect when fading is used)
  • Export many settings as macros:
    • PJMEDIA_WSOLA_DELAY_MSEC (was HANNING_PTIME)
    • PJMEDIA_WSOLA_TEMPLATE_LENGTH_MSEC (was TEMPLATE_PTIME)
    • PJMEDIA_WSOLA_MAX_EXPAND_MSEC

PLC:

  • added compile time macro PJMEDIA_WSOLA_PLC_NO_FADING to disable fading (default enabled)

Stream:

  • fixed bug when stream is not PLC-ing subsequent packet loss (only the first)
  • also add maximum PLC limit just as precaution if PLC doesn't limit number of synthetic frames
  • unrelated: fixed warning about unused send_keep_alive() function

Delaybuf:

  • modified to NOT use fading in WSOLA since we don't expect it to generate many continuous synthetic frames
File:
1 edited

Legend:

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

    r2759 r2850  
    150150#ifndef PJMEDIA_WSOLA_IMP 
    151151#   define PJMEDIA_WSOLA_IMP                PJMEDIA_WSOLA_IMP_WSOLA 
     152#endif 
     153 
     154 
     155/** 
     156 * Specify the default maximum duration of synthetic audio that is generated 
     157 * by WSOLA. This value should be long enough to cover burst of packet losses.  
     158 * but not too long, because as the duration increases the quality would  
     159 * degrade considerably. 
     160 * 
     161 * Note that this limit is only applied when fading is enabled in the WSOLA 
     162 * session. 
     163 * 
     164 * Default: 80 
     165 */ 
     166#ifndef PJMEDIA_WSOLA_MAX_EXPAND_MSEC 
     167#   define PJMEDIA_WSOLA_MAX_EXPAND_MSEC    80 
     168#endif 
     169 
     170 
     171/** 
     172 * Specify WSOLA template length, in milliseconds. The longer the template, 
     173 * the smoother signal to be generated at the expense of more computation 
     174 * needed, since the algorithm will have to compare more samples to find 
     175 * the most similar pitch. 
     176 * 
     177 * Default: 5 
     178 */ 
     179#ifndef PJMEDIA_WSOLA_TEMPLATE_LENGTH_MSEC 
     180#   define PJMEDIA_WSOLA_TEMPLATE_LENGTH_MSEC   5 
     181#endif 
     182 
     183 
     184/** 
     185 * Specify WSOLA algorithm delay, in milliseconds. The algorithm delay is 
     186 * used to merge synthetic samples with real samples in the transition 
     187 * between real to synthetic and vice versa. The longer the delay, the  
     188 * smoother signal to be generated, at the expense of longer latency and 
     189 * a slighty more computation. 
     190 * 
     191 * Default: 5 
     192 */ 
     193#ifndef PJMEDIA_WSOLA_DELAY_MSEC 
     194#   define PJMEDIA_WSOLA_DELAY_MSEC         5 
     195#endif 
     196 
     197 
     198/** 
     199 * Set this to non-zero to disable fade-out/in effect in the PLC when it 
     200 * instructs WSOLA to generate synthetic frames. The use of fading may 
     201 * or may not improve the quality of audio, depending on the nature of 
     202 * packet loss and the type of audio input (e.g. speech vs music). 
     203 * Disabling fading also implicitly remove the maximum limit of synthetic 
     204 * audio samples generated by WSOLA (see PJMEDIA_WSOLA_MAX_EXPAND_MSEC). 
     205 * 
     206 * Default: 0 
     207 */ 
     208#ifndef PJMEDIA_WSOLA_PLC_NO_FADING 
     209#   define PJMEDIA_WSOLA_PLC_NO_FADING      0 
    152210#endif 
    153211 
Note: See TracChangeset for help on using the changeset viewer.