- Timestamp:
- Mar 21, 2006 11:59:15 AM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/conference.h
r333 r347 62 62 microphone device. */ 63 63 PJMEDIA_CONF_NO_DEVICE = 2, /**< Do not create sound device. */ 64 PJMEDIA_CONF_SMALL_FILTER=4,/**< Use small filter table when resampling */ 65 PJMEDIA_CONF_USE_LINEAR=8, /**< Use linear resampling instead of filter 66 based. */ 64 67 }; 65 68 -
pjproject/trunk/pjmedia/include/pjmedia/config.h
r320 r347 42 42 /** 43 43 * Unless specified otherwise, G711 codec is included by default. 44 * Note that there are parts of G711 codec (such as linear2ulaw) that are 45 * needed by other PJMEDIA components (e.g. silence detector, conference). 46 * Thus disabling G711 is generally not a good idea. 44 47 */ 45 48 #ifndef PJMEDIA_HAS_G711_CODEC … … 48 51 49 52 53 /** 54 * Include small filter table in resample. 55 * This adds about 9KB in rdata. 56 */ 57 #ifndef PJMEDIA_HAS_SMALL_FILTER 58 # define PJMEDIA_HAS_SMALL_FILTER 1 59 #endif 60 61 62 /** 63 * Include large filter table in resample. 64 * This adds about 32KB in rdata. 65 */ 66 #ifndef PJMEDIA_HAS_LARGE_FILTER 67 # define PJMEDIA_HAS_LARGE_FILTER 1 68 #endif 69 70 50 71 #endif /* __PJMEDIA_CONFIG_H__ */ 72 -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r333 r347 238 238 if (conf_port->clock_rate != conf->clock_rate) { 239 239 240 double factor; 241 242 factor = 1.0 * conf_port->clock_rate / conf->clock_rate; 240 pj_bool_t high_quality; 241 pj_bool_t large_filter; 242 243 high_quality = ((conf->options & PJMEDIA_CONF_USE_LINEAR)==0); 244 large_filter = ((conf->options & PJMEDIA_CONF_SMALL_FILTER)==0); 243 245 244 246 /* Create resample for rx buffer. */ 245 247 status = pjmedia_resample_create( pool, 246 PJ_TRUE, /* High quality */247 PJ_TRUE, /* Large filter */248 high_quality, 249 large_filter, 248 250 conf_port->clock_rate,/* Rate in */ 249 251 conf->clock_rate, /* Rate out */ 250 (unsigned)(conf->samples_per_frame * 251 factor), 252 conf->samples_per_frame * 253 conf_port->clock_rate / 254 conf->clock_rate, 252 255 &conf_port->rx_resample); 253 256 if (status != PJ_SUCCESS) … … 257 260 /* Create resample for tx buffer. */ 258 261 status = pjmedia_resample_create(pool, 259 PJ_TRUE, /* High quality */260 PJ_TRUE, /* Large filter */262 high_quality, 263 large_filter, 261 264 conf->clock_rate, /* Rate in */ 262 265 conf_port->clock_rate, /* Rate out */ -
pjproject/trunk/pjmedia/src/pjmedia/largefilter.h
r277 r347 3 3 #define LARGE_FILTER_SCALE 14746 /* Unity-gain scale factor */ 4 4 #define LARGE_FILTER_NWING 8192 /* Filter table length */ 5 static HWORD LARGE_FILTER_IMP[] /* Impulse response */ = {5 static const HWORD LARGE_FILTER_IMP[] /* Impulse response */ = { 6 6 32767, 7 7 32766, … … 8197 8197 0}; 8198 8198 8199 static HWORD LARGE_FILTER_IMPD[] /* Impulse response differences */ = {8199 static const HWORD LARGE_FILTER_IMPD[] /* Impulse response differences */ = { 8200 8200 -1, 8201 8201 -2, -
pjproject/trunk/pjmedia/src/pjmedia/resample.c
r323 r347 66 66 #include <pjmedia/errno.h> 67 67 #include <pj/assert.h> 68 #include <pj/log.h> 68 69 #include <pj/pool.h> 69 70 71 72 #define THIS_FILE "resample.c" 70 73 71 74 … … 192 195 #endif 193 196 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 196 217 197 218 #undef INLINE … … 481 502 } 482 503 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 483 529 resample->factor = rate_out * 1.0 / rate_in; 484 530 resample->large_filter = large_filter; -
pjproject/trunk/pjmedia/src/pjmedia/smallfilter.h
r277 r347 3 3 #define SMALL_FILTER_SCALE 13128 /* Unity-gain scale factor */ 4 4 #define SMALL_FILTER_NWING 1536 /* Filter table length */ 5 static HWORD SMALL_FILTER_IMP[] /* Impulse response */ = {5 static const HWORD SMALL_FILTER_IMP[] /* Impulse response */ = { 6 6 32767, 7 7 32766, … … 1542 1542 }; 1543 1543 1544 static HWORD SMALL_FILTER_IMPD[] = {1544 static const HWORD SMALL_FILTER_IMPD[] = { 1545 1545 -1, 1546 1546 -2, -
pjproject/trunk/pjsip-apps/build/samples.dsp
r336 r347 91 91 # Begin Source File 92 92 93 SOURCE=..\src\samples\level.c 94 # End Source File 95 # Begin Source File 96 93 97 SOURCE=..\src\samples\playfile.c 94 98 # End Source File … … 100 104 101 105 SOURCE=..\src\samples\simpleua.c 106 # End Source File 107 # Begin Source File 108 109 SOURCE=..\src\samples\sndinfo.c 102 110 # End Source File 103 111 # End Group
Note: See TracChangeset
for help on using the changeset viewer.