Changeset f9dfd9843c0419ff992fd6be0de091528c522dc2
- 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
| r17afdb9 |
rf9dfd98 |
|
| 56 | 56 | static unsigned int stereo_to_mono( aout_instance_t *, aout_filter_t *, |
|---|
| 57 | 57 | aout_buffer_t *, aout_buffer_t * ); |
|---|
| | 58 | static unsigned int mono( aout_instance_t *, aout_filter_t *, |
|---|
| | 59 | aout_buffer_t *, aout_buffer_t * ); |
|---|
| 58 | 60 | static void stereo2mono_downmix( aout_instance_t *, aout_filter_t *, |
|---|
| 59 | 61 | aout_buffer_t *, aout_buffer_t * ); |
|---|
| … | … | |
| 350 | 352 | return -1; |
|---|
| 351 | 353 | } |
|---|
| 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 ); |
|---|
| 353 | 355 | |
|---|
| 354 | 356 | /* end */ |
|---|
| … | … | |
| 527 | 529 | stereo2mono_downmix( (aout_instance_t *)p_filter, &aout_filter, |
|---|
| 528 | 530 | &in_buf, &out_buf ); |
|---|
| | 531 | i_samples = mono( (aout_instance_t *)p_filter, &aout_filter, |
|---|
| | 532 | &out_buf, &in_buf ); |
|---|
| 529 | 533 | } |
|---|
| 530 | 534 | else |
|---|
| … | … | |
| 656 | 660 | |
|---|
| 657 | 661 | /* Simple stereo to mono mixing. */ |
|---|
| | 662 | static 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. */ |
|---|
| 658 | 682 | static unsigned int stereo_to_mono( aout_instance_t * p_aout, aout_filter_t *p_filter, |
|---|
| 659 | 683 | aout_buffer_t *p_output, aout_buffer_t *p_input ) |
|---|