Ignore:
Timestamp:
Mar 21, 2006 11:59:15 AM (18 years ago)
Author:
bennylp
Message:

Added macro to exclude filters in resample and added options to select resample algorithm in conference

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/resample.c

    r323 r347  
    6666#include <pjmedia/errno.h> 
    6767#include <pj/assert.h> 
     68#include <pj/log.h> 
    6869#include <pj/pool.h> 
    6970 
     71 
     72#define THIS_FILE   "resample.c" 
    7073 
    7174 
     
    192195#endif 
    193196 
    194 #include "smallfilter.h" 
    195 #include "largefilter.h" 
     197#if defined(PJMEDIA_HAS_SMALL_FILTER) && PJMEDIA_HAS_SMALL_FILTER!=0 
     198#   include "smallfilter.h" 
     199#else 
     200#   define SMALL_FILTER_NMULT   0 
     201#   define SMALL_FILTER_SCALE   0 
     202#   define SMALL_FILTER_NWING   0 
     203#   define SMALL_FILTER_IMP     NULL 
     204#   define SMALL_FILTER_IMPD    NULL 
     205#endif 
     206 
     207#if defined(PJMEDIA_HAS_LARGE_FILTER) && PJMEDIA_HAS_LARGE_FILTER!=0 
     208#   include "largefilter.h" 
     209#else 
     210#   define LARGE_FILTER_NMULT   0 
     211#   define LARGE_FILTER_SCALE   0 
     212#   define LARGE_FILTER_NWING   0 
     213#   define LARGE_FILTER_IMP     NULL 
     214#   define LARGE_FILTER_IMPD    NULL 
     215#endif 
     216 
    196217 
    197218#undef INLINE 
     
    481502    } 
    482503 
     504#if !defined(PJMEDIA_HAS_LARGE_FILTER) || PJMEDIA_HAS_LARGE_FILTER==0 
     505    /* 
     506     * If large filter is excluded in the build, then prevent application 
     507     * from using it. 
     508     */ 
     509    if (high_quality && large_filter) { 
     510        large_filter = PJ_FALSE; 
     511        PJ_LOG(5,(THIS_FILE,  
     512                  "Resample uses small filter because large filter is " 
     513                  "disabled")); 
     514    } 
     515#endif 
     516 
     517#if !defined(PJMEDIA_HAS_SMALL_FILTER) || PJMEDIA_HAS_SMALL_FILTER==0 
     518    /* 
     519     * If small filter is excluded in the build and application wants to 
     520     * use it, then drop to linear conversion. 
     521     */ 
     522    if (high_quality && large_filter == 0) { 
     523        high_quality = PJ_FALSE; 
     524        PJ_LOG(4,(THIS_FILE,  
     525                  "Resample uses linear because small filter is disabled")); 
     526    } 
     527#endif 
     528 
    483529    resample->factor = rate_out * 1.0 / rate_in; 
    484530    resample->large_filter = large_filter; 
Note: See TracChangeset for help on using the changeset viewer.