Changeset f9dfd9843c0419ff992fd6be0de091528c522dc2

Show
Ignore:
Timestamp:
08/29/06 20:54:05 (2 years ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1156877645 +0000
git-parent:

[b19ddef0a3927085ea92fa972accef615c72aa41]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1156877645 +0000
Message:

combine two channels into mono for the dowmix as last step.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/audio_filter/converter/mono.c

    r17afdb9 rf9dfd98  
    5656static unsigned int stereo_to_mono( aout_instance_t *, aout_filter_t *, 
    5757                                    aout_buffer_t *, aout_buffer_t * ); 
     58static unsigned int mono( aout_instance_t *, aout_filter_t *, 
     59                                    aout_buffer_t *, aout_buffer_t * ); 
    5860static void stereo2mono_downmix( aout_instance_t *, aout_filter_t *, 
    5961                                 aout_buffer_t *, aout_buffer_t * ); 
     
    350352        return -1; 
    351353    } 
    352     memset( p_data->p_overflow_buffer, 0 , p_data->i_overflow_buffer_size ); 
     354    memset( p_data->p_overflow_buffer, 0, p_data->i_overflow_buffer_size ); 
    353355 
    354356    /* end */ 
     
    527529        stereo2mono_downmix( (aout_instance_t *)p_filter, &aout_filter, 
    528530                             &in_buf, &out_buf ); 
     531        i_samples = mono( (aout_instance_t *)p_filter, &aout_filter, 
     532                           &out_buf, &in_buf ); 
    529533    } 
    530534    else 
     
    656660 
    657661/* Simple stereo to mono mixing. */ 
     662static unsigned int mono( aout_instance_t * p_aout, aout_filter_t *p_filter, 
     663                          aout_buffer_t *p_output, aout_buffer_t *p_input ) 
     664{ 
     665    filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys; 
     666    int16_t *p_in, *p_out; 
     667    unsigned int n = 0, r = 0; 
     668 
     669    p_in = (int16_t *) p_input->p_buffer; 
     670    p_out = (int16_t *) p_output->p_buffer; 
     671 
     672    while( n < (p_input->i_nb_samples * p_sys->i_nb_channels) ) 
     673    { 
     674        p_out[r] = (p_in[n] + p_in[n+1]) >> 1; 
     675        r++; 
     676        n += 2; 
     677    } 
     678    return r; 
     679} 
     680 
     681/* Simple stereo to mono mixing. */ 
    658682static unsigned int stereo_to_mono( aout_instance_t * p_aout, aout_filter_t *p_filter, 
    659683                                    aout_buffer_t *p_output, aout_buffer_t *p_input )