Changeset 1034:c82afd5c2522 in mediastreamer2
- Timestamp:
- Jun 30, 2010 10:11:37 AM (3 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
src/speexec.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/speexec.c
r1031 r1034 31 31 #endif 32 32 33 //#define EC_DUMP 1 34 35 #define EC_DUMP_PREFIX "/sdcard" 36 33 37 static const int framesize=128; 34 static const int ref_max_delay=80; 35 36 #if 0 37 typedef struct _BufferSizeEstimator{ 38 float mean; 39 float jitter; 40 }BufferSizeEstimator; 41 42 void buffer_size_estimator_update(BufferSizeEstimator *bse, int size){ 43 static const float smooth=0.04; 44 } 45 46 #endif 38 static const int ref_max_delay=60; 39 47 40 48 41 typedef struct SpeexECState{ … … 58 51 int delay_ms; 59 52 int tail_length_ms; 53 #ifdef EC_DUMP 54 FILE *echofile; 55 FILE *reffile; 56 #endif 60 57 bool_t using_silence; 61 58 bool_t echostarted; … … 77 74 s->echostarted=FALSE; 78 75 76 #ifdef EC_DUMP 77 { 78 char *fname=ms_strdup_printf("%s/msspeexec-%p-echo.raw", EC_DUMP_PREFIX,f); 79 s->echofile=fopen(fname,"w"); 80 ms_free(fname); 81 fname=ms_strdup_printf("%s/msspeexec-%p-ref.raw", EC_DUMP_PREFIX,f); 82 s->reffile=fopen(fname,"w"); 83 ms_free(fname); 84 } 85 #endif 86 79 87 f->data=s; 80 88 } … … 84 92 ms_bufferizer_uninit(&s->ref); 85 93 ms_bufferizer_uninit(&s->delayed_ref); 94 #ifdef EC_DUMP 95 if (s->echofile) 96 fclose(s->echofile); 97 if (s->reffile) 98 fclose(s->reffile); 99 #endif 86 100 ms_free(s); 87 101 } … … 166 180 oref->b_wptr+=nbytes; 167 181 ms_queue_put(f->outputs[0],oref); 182 #ifdef EC_DUMP 183 if (s->reffile) 184 fwrite(ref,nbytes,1,s->reffile); 185 if (s->echofile) 186 fwrite(echo,nbytes,1,s->echofile); 187 #endif 168 188 speex_echo_cancellation(s->ecstate,(short*)echo,(short*)ref,(short*)oecho->b_wptr); 169 189 speex_preprocess_run(s->den, (short*)oecho->b_wptr);
Note: See TracChangeset
for help on using the changeset viewer.
