Changeset 1041:985498c76f96 in mediastreamer2


Ignore:
Timestamp:
Jun 30, 2010 10:12:48 AM (3 years ago)
Author:
Simon Morlat <simon.morlat@…>
Branch:
default
Parents:
1034:c82afd5c2522 (diff), 1040:8e8716785083 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of git.linphone.org:mediastreamer2

Conflicts:

src/speexec.c

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/speexec.c

    r1034 r1041  
    138138                maxsize=ms_bufferizer_get_avail(&s->echo); 
    139139                if (s->echostarted==FALSE && maxsize>0){ 
     140                        ms_message("speex_ec: starting receiving echo signal"); 
    140141                        s->echostarted=TRUE; 
    141142                } 
  • src/speexec.c

    r1040 r1041  
    3131#endif 
    3232 
     33//#define EC_DUMP 1 
     34 
     35#define EC_DUMP_PREFIX "/sdcard" 
     36 
    3337static const int framesize=128; 
    34 static const int ref_max_delay=70; 
    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 
     38static const int ref_max_delay=60; 
     39 
    4740 
    4841typedef struct SpeexECState{ 
     
    5851        int delay_ms; 
    5952        int tail_length_ms; 
     53#ifdef EC_DUMP 
     54        FILE *echofile; 
     55        FILE *reffile; 
     56#endif 
    6057        bool_t using_silence; 
    6158        bool_t echostarted; 
     
    7774        s->echostarted=FALSE; 
    7875 
     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         
    7987        f->data=s; 
    8088} 
     
    8492        ms_bufferizer_uninit(&s->ref); 
    8593        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 
    86100        ms_free(s); 
    87101} 
     
    167181                oref->b_wptr+=nbytes; 
    168182                ms_queue_put(f->outputs[0],oref); 
     183#ifdef EC_DUMP 
     184                if (s->reffile) 
     185                        fwrite(ref,nbytes,1,s->reffile); 
     186                if (s->echofile) 
     187                        fwrite(echo,nbytes,1,s->echofile); 
     188#endif 
    169189                speex_echo_cancellation(s->ecstate,(short*)echo,(short*)ref,(short*)oecho->b_wptr); 
    170190                speex_preprocess_run(s->den, (short*)oecho->b_wptr); 
Note: See TracChangeset for help on using the changeset viewer.