1 /*****************************************************************************
2 * headphone.c : headphone virtual spatialization channel mixer module
3 * -> gives the feeling of a real room with a simple headphone
4 *****************************************************************************
5 * Copyright (C) 2002-2006 the VideoLAN team
8 * Authors: Boris Dorès <babal@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
28 #include <stdlib.h> /* malloc(), free() */
30 #include <math.h> /* sqrt */
34 #include <vlc_filter.h>
35 #include <vlc_block.h>
37 /*****************************************************************************
39 *****************************************************************************/
40 static int Create ( vlc_object_t * );
41 static void Destroy ( vlc_object_t * );
43 static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
47 static int OpenFilter ( vlc_object_t * );
48 static void CloseFilter( vlc_object_t * );
49 static block_t *Convert( filter_t *, block_t * );
51 /*****************************************************************************
53 *****************************************************************************/
54 #define MODULE_DESCRIPTION N_ ( \
55 "This effect gives you the feeling that you are standing in a room " \
56 "with a complete 7.1 speaker set when using only a headphone, " \
57 "providing a more realistic sound experience. It should also be " \
58 "more comfortable and less tiring when listening to music for " \
59 "long periods of time.\nIt works with any source format from mono " \
62 #define HEADPHONE_DIM_TEXT N_("Characteristic dimension")
63 #define HEADPHONE_DIM_LONGTEXT N_( \
64 "Distance between front left speaker and listener in meters.")
66 #define HEADPHONE_COMPENSATE_TEXT N_("Compensate delay")
67 #define HEADPHONE_COMPENSATE_LONGTEXT N_( \
68 "The delay which is introduced by the physical algorithm may "\
69 "sometimes be disturbing for the synchronization between lips-movement "\
70 "and speech. In case, turn this on to compensate.")
72 #define HEADPHONE_DOLBY_TEXT N_("No decoding of Dolby Surround")
73 #define HEADPHONE_DOLBY_LONGTEXT N_( \
74 "Dolby Surround encoded streams won't be decoded before being " \
75 "processed by this filter. Enabling this setting is not recommended.")
78 set_description( _("Headphone virtual spatialization effect") );
79 set_shortname( _("Headphone effect") );
80 set_help( MODULE_DESCRIPTION );
81 set_category( CAT_AUDIO );
82 set_subcategory( SUBCAT_AUDIO_AFILTER );
84 add_integer( "headphone-dim", 10, NULL, HEADPHONE_DIM_TEXT,
85 HEADPHONE_DIM_LONGTEXT, VLC_FALSE );
86 add_bool( "headphone-compensate", 0, NULL, HEADPHONE_COMPENSATE_TEXT,
87 HEADPHONE_COMPENSATE_LONGTEXT, VLC_TRUE );
88 add_bool( "headphone-dolby", 0, NULL, HEADPHONE_DOLBY_TEXT,
89 HEADPHONE_DOLBY_LONGTEXT, VLC_TRUE );
91 set_capability( "audio filter", 0 );
92 set_callbacks( Create, Destroy );
93 add_shortcut( "headphone" );
97 set_description( _("Headphone virtual spatialization effect") );
98 set_capability( "audio filter2", 0 );
99 set_callbacks( OpenFilter, CloseFilter );
103 /*****************************************************************************
104 * Internal data structures
105 *****************************************************************************/
106 struct atomic_operation_t
108 int i_source_channel_offset;
109 int i_dest_channel_offset;
110 unsigned int i_delay;/* in sample unit */
111 double d_amplitude_factor;
114 struct aout_filter_sys_t
116 size_t i_overflow_buffer_size;/* in bytes */
117 byte_t * p_overflow_buffer;
118 unsigned int i_nb_atomic_operations;
119 struct atomic_operation_t * p_atomic_operations;
124 size_t i_overflow_buffer_size;/* in bytes */
125 byte_t * p_overflow_buffer;
126 unsigned int i_nb_atomic_operations;
127 struct atomic_operation_t * p_atomic_operations;
130 /*****************************************************************************
131 * Init: initialize internal data structures
132 * and computes the needed atomic operations
133 *****************************************************************************/
134 /* x and z represent the coordinates of the virtual speaker
135 * relatively to the center of the listener's head, measured in meters :
144 * rear left rear right
148 static void ComputeChannelOperations( struct aout_filter_sys_t * p_data
149 , unsigned int i_rate, unsigned int i_next_atomic_operation
150 , int i_source_channel_offset, double d_x, double d_z
151 , double d_compensation_length, double d_channel_amplitude_factor )
153 double d_c = 340; /*sound celerity (unit: m/s)*/
154 double d_compensation_delay = (d_compensation_length-0.1) / d_c * i_rate;
157 p_data->p_atomic_operations[i_next_atomic_operation]
158 .i_source_channel_offset = i_source_channel_offset;
159 p_data->p_atomic_operations[i_next_atomic_operation]
160 .i_dest_channel_offset = 0;/* left */
161 p_data->p_atomic_operations[i_next_atomic_operation]
162 .i_delay = (int)( sqrt( (-0.1-d_x)*(-0.1-d_x) + (0-d_z)*(0-d_z) )
163 / d_c * i_rate - d_compensation_delay );
166 p_data->p_atomic_operations[i_next_atomic_operation]
167 .d_amplitude_factor = d_channel_amplitude_factor * 1.1 / 2;
171 p_data->p_atomic_operations[i_next_atomic_operation]
172 .d_amplitude_factor = d_channel_amplitude_factor * 0.9 / 2;
176 p_data->p_atomic_operations[i_next_atomic_operation]
177 .d_amplitude_factor = d_channel_amplitude_factor / 2;
181 p_data->p_atomic_operations[i_next_atomic_operation + 1]
182 .i_source_channel_offset = i_source_channel_offset;
183 p_data->p_atomic_operations[i_next_atomic_operation + 1]
184 .i_dest_channel_offset = 1;/* right */
185 p_data->p_atomic_operations[i_next_atomic_operation + 1]
186 .i_delay = (int)( sqrt( (0.1-d_x)*(0.1-d_x) + (0-d_z)*(0-d_z) )
187 / d_c * i_rate - d_compensation_delay );
190 p_data->p_atomic_operations[i_next_atomic_operation + 1]
191 .d_amplitude_factor = d_channel_amplitude_factor * 0.9 / 2;
195 p_data->p_atomic_operations[i_next_atomic_operation + 1]
196 .d_amplitude_factor = d_channel_amplitude_factor * 1.1 / 2;
200 p_data->p_atomic_operations[i_next_atomic_operation + 1]
201 .d_amplitude_factor = d_channel_amplitude_factor / 2;
205 static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
206 , unsigned int i_nb_channels, uint32_t i_physical_channels
207 , unsigned int i_rate )
209 double d_x = config_GetInt( p_this, "headphone-dim" );
211 double d_z_rear = -d_x/3;
213 unsigned int i_next_atomic_operation;
214 int i_source_channel_offset;
219 msg_Dbg( p_this, "passing a null pointer as argument" );
223 if( config_GetInt( p_this, "headphone-compensate" ) )
225 /* minimal distance to any speaker */
226 if( i_physical_channels & AOUT_CHAN_REARCENTER )
236 /* Number of elementary operations */
237 p_data->i_nb_atomic_operations = i_nb_channels * 2;
238 if( i_physical_channels & AOUT_CHAN_CENTER )
240 p_data->i_nb_atomic_operations += 2;
242 p_data->p_atomic_operations = malloc( sizeof(struct atomic_operation_t)
243 * p_data->i_nb_atomic_operations );
244 if( p_data->p_atomic_operations == NULL )
246 msg_Err( p_this, "out of memory" );
250 /* For each virtual speaker, computes elementary wave propagation time
252 i_next_atomic_operation = 0;
253 i_source_channel_offset = 0;
254 if( i_physical_channels & AOUT_CHAN_LEFT )
256 ComputeChannelOperations( p_data , i_rate
257 , i_next_atomic_operation , i_source_channel_offset
258 , -d_x , d_z , d_min , 2.0 / i_nb_channels );
259 i_next_atomic_operation += 2;
260 i_source_channel_offset++;
262 if( i_physical_channels & AOUT_CHAN_RIGHT )
264 ComputeChannelOperations( p_data , i_rate
265 , i_next_atomic_operation , i_source_channel_offset
266 , d_x , d_z , d_min , 2.0 / i_nb_channels );
267 i_next_atomic_operation += 2;
268 i_source_channel_offset++;
270 if( i_physical_channels & AOUT_CHAN_MIDDLELEFT )
272 ComputeChannelOperations( p_data , i_rate
273 , i_next_atomic_operation , i_source_channel_offset
274 , -d_x , 0 , d_min , 1.5 / i_nb_channels );
275 i_next_atomic_operation += 2;
276 i_source_channel_offset++;
278 if( i_physical_channels & AOUT_CHAN_MIDDLERIGHT )
280 ComputeChannelOperations( p_data , i_rate
281 , i_next_atomic_operation , i_source_channel_offset
282 , d_x , 0 , d_min , 1.5 / i_nb_channels );
283 i_next_atomic_operation += 2;
284 i_source_channel_offset++;
286 if( i_physical_channels & AOUT_CHAN_REARLEFT )
288 ComputeChannelOperations( p_data , i_rate
289 , i_next_atomic_operation , i_source_channel_offset
290 , -d_x , d_z_rear , d_min , 1.5 / i_nb_channels );
291 i_next_atomic_operation += 2;
292 i_source_channel_offset++;
294 if( i_physical_channels & AOUT_CHAN_REARRIGHT )
296 ComputeChannelOperations( p_data , i_rate
297 , i_next_atomic_operation , i_source_channel_offset
298 , d_x , d_z_rear , d_min , 1.5 / i_nb_channels );
299 i_next_atomic_operation += 2;
300 i_source_channel_offset++;
302 if( i_physical_channels & AOUT_CHAN_REARCENTER )
304 ComputeChannelOperations( p_data , i_rate
305 , i_next_atomic_operation , i_source_channel_offset
306 , 0 , -d_z , d_min , 1.5 / i_nb_channels );
307 i_next_atomic_operation += 2;
308 i_source_channel_offset++;
310 if( i_physical_channels & AOUT_CHAN_CENTER )
312 /* having two center channels increases the spatialization effect */
313 ComputeChannelOperations( p_data , i_rate
314 , i_next_atomic_operation , i_source_channel_offset
315 , d_x / 5.0 , d_z , d_min , 0.75 / i_nb_channels );
316 i_next_atomic_operation += 2;
317 ComputeChannelOperations( p_data , i_rate
318 , i_next_atomic_operation , i_source_channel_offset
319 , -d_x / 5.0 , d_z , d_min , 0.75 / i_nb_channels );
320 i_next_atomic_operation += 2;
321 i_source_channel_offset++;
323 if( i_physical_channels & AOUT_CHAN_LFE )
325 ComputeChannelOperations( p_data , i_rate
326 , i_next_atomic_operation , i_source_channel_offset
327 , 0 , d_z_rear , d_min , 5.0 / i_nb_channels );
328 i_next_atomic_operation += 2;
329 i_source_channel_offset++;
332 /* Initialize the overflow buffer
333 * we need it because the process induce a delay in the samples */
334 p_data->i_overflow_buffer_size = 0;
335 for( i = 0 ; i < p_data->i_nb_atomic_operations ; i++ )
337 if( p_data->i_overflow_buffer_size
338 < p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float) )
340 p_data->i_overflow_buffer_size
341 = p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float);
344 p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size );
345 if( p_data->p_atomic_operations == NULL )
347 msg_Err( p_this, "out of memory" );
350 memset( p_data->p_overflow_buffer, 0 , p_data->i_overflow_buffer_size );
356 /*****************************************************************************
357 * Create: allocate headphone downmixer
358 *****************************************************************************/
359 static int Create( vlc_object_t *p_this )
361 aout_filter_t * p_filter = (aout_filter_t *)p_this;
362 vlc_bool_t b_fit = VLC_TRUE;
364 /* Activate this filter only with stereo devices */
365 if( p_filter->output.i_physical_channels
366 != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT) )
368 msg_Dbg( p_filter, "filter discarded (incompatible format)" );
372 /* Request a specific format if not already compatible */
373 if( p_filter->input.i_original_channels
374 != p_filter->output.i_original_channels )
377 p_filter->input.i_original_channels =
378 p_filter->output.i_original_channels;
380 if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
381 || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
384 p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
385 p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
387 if( p_filter->input.i_rate != p_filter->output.i_rate )
390 p_filter->input.i_rate = p_filter->output.i_rate;
392 if( p_filter->input.i_physical_channels == (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
393 && ( p_filter->input.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
394 && ! config_GetInt ( p_filter , "headphone-dolby" ) )
397 p_filter->input.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
404 msg_Dbg( p_filter, "requesting specific format" );
408 /* Allocate the memory needed to store the module's structure */
409 p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
410 if( p_filter->p_sys == NULL )
412 msg_Err( p_filter, "out of memory" );
415 p_filter->p_sys->i_overflow_buffer_size = 0;
416 p_filter->p_sys->p_overflow_buffer = NULL;
417 p_filter->p_sys->i_nb_atomic_operations = 0;
418 p_filter->p_sys->p_atomic_operations = NULL;
420 if( Init( VLC_OBJECT(p_filter), p_filter->p_sys
421 , aout_FormatNbChannels ( &p_filter->input )
422 , p_filter->input.i_physical_channels
423 , p_filter->input.i_rate ) < 0 )
428 p_filter->pf_do_work = DoWork;
429 p_filter->b_in_place = 0;
434 /*****************************************************************************
435 * Destroy: deallocate resources associated with headphone downmixer
436 *****************************************************************************/
437 static void Destroy( vlc_object_t *p_this )
439 aout_filter_t * p_filter = (aout_filter_t *)p_this;
441 if( p_filter->p_sys != NULL )
443 if( p_filter->p_sys->p_overflow_buffer != NULL )
445 free( p_filter->p_sys->p_overflow_buffer );
447 if( p_filter->p_sys->p_atomic_operations != NULL )
449 free( p_filter->p_sys->p_atomic_operations );
451 free( p_filter->p_sys );
452 p_filter->p_sys = NULL;
456 /*****************************************************************************
457 * DoWork: convert a buffer
458 *****************************************************************************/
459 static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
460 aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
462 int i_input_nb = aout_FormatNbChannels( &p_filter->input );
463 int i_output_nb = aout_FormatNbChannels( &p_filter->output );
465 float * p_in = (float*) p_in_buf->p_buffer;
470 size_t i_overflow_size; /* in bytes */
471 size_t i_out_size; /* in bytes */
475 int i_source_channel_offset;
476 int i_dest_channel_offset;
477 unsigned int i_delay;
478 double d_amplitude_factor;
480 /* out buffer characterisitcs */
481 p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
482 p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * i_output_nb / i_input_nb;
483 p_out = p_out_buf->p_buffer;
484 i_out_size = p_out_buf->i_nb_bytes;
486 if( p_filter->p_sys != NULL )
488 /* Slide the overflow buffer */
489 p_overflow = p_filter->p_sys->p_overflow_buffer;
490 i_overflow_size = p_filter->p_sys->i_overflow_buffer_size;
492 memset( p_out, 0, i_out_size );
493 if ( i_out_size > i_overflow_size )
494 memcpy( p_out, p_overflow, i_overflow_size );
496 memcpy( p_out, p_overflow, i_out_size );
498 p_slide = p_filter->p_sys->p_overflow_buffer;
499 while( p_slide < p_overflow + i_overflow_size )
501 if( p_slide + i_out_size < p_overflow + i_overflow_size )
503 memset( p_slide, 0, i_out_size );
504 if( p_slide + 2 * i_out_size < p_overflow + i_overflow_size )
505 memcpy( p_slide, p_slide + i_out_size, i_out_size );
507 memcpy( p_slide, p_slide + i_out_size,
508 p_overflow + i_overflow_size - ( p_slide + i_out_size ) );
512 memset( p_slide, 0, p_overflow + i_overflow_size - p_slide );
514 p_slide += i_out_size;
517 /* apply the atomic operations */
518 for( i = 0; i < p_filter->p_sys->i_nb_atomic_operations; i++ )
520 /* shorter variable names */
521 i_source_channel_offset
522 = p_filter->p_sys->p_atomic_operations[i].i_source_channel_offset;
523 i_dest_channel_offset
524 = p_filter->p_sys->p_atomic_operations[i].i_dest_channel_offset;
525 i_delay = p_filter->p_sys->p_atomic_operations[i].i_delay;
527 = p_filter->p_sys->p_atomic_operations[i].d_amplitude_factor;
529 if( p_out_buf->i_nb_samples > i_delay )
531 /* current buffer coefficients */
532 for( j = 0; j < p_out_buf->i_nb_samples - i_delay; j++ )
534 ((float*)p_out)[ (i_delay+j)*i_output_nb + i_dest_channel_offset ]
535 += p_in[ j * i_input_nb + i_source_channel_offset ]
536 * d_amplitude_factor;
539 /* overflow buffer coefficients */
540 for( j = 0; j < i_delay; j++ )
542 ((float*)p_overflow)[ j*i_output_nb + i_dest_channel_offset ]
543 += p_in[ (p_out_buf->i_nb_samples - i_delay + j)
544 * i_input_nb + i_source_channel_offset ]
545 * d_amplitude_factor;
550 /* overflow buffer coefficients only */
551 for( j = 0; j < p_out_buf->i_nb_samples; j++ )
553 ((float*)p_overflow)[ (i_delay - p_out_buf->i_nb_samples + j)
554 * i_output_nb + i_dest_channel_offset ]
555 += p_in[ j * i_input_nb + i_source_channel_offset ]
556 * d_amplitude_factor;
563 memset( p_out, 0, i_out_size );
570 /*****************************************************************************
572 *****************************************************************************/
573 static int OpenFilter( vlc_object_t *p_this )
575 filter_t *p_filter = (filter_t *)p_this;
576 vlc_bool_t b_fit = VLC_TRUE;
578 /* Activate this filter only with stereo devices */
579 if( p_filter->fmt_out.audio.i_physical_channels
580 != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT) )
582 msg_Dbg( p_filter, "filter discarded (incompatible format)" );
586 /* Request a specific format if not already compatible */
587 if( p_filter->fmt_in.audio.i_original_channels
588 != p_filter->fmt_out.audio.i_original_channels )
591 p_filter->fmt_in.audio.i_original_channels =
592 p_filter->fmt_out.audio.i_original_channels;
594 if( p_filter->fmt_in.audio.i_format != VLC_FOURCC('f','l','3','2')
595 || p_filter->fmt_out.audio.i_format != VLC_FOURCC('f','l','3','2') )
598 p_filter->fmt_in.audio.i_format = VLC_FOURCC('f','l','3','2');
599 p_filter->fmt_out.audio.i_format = VLC_FOURCC('f','l','3','2');
601 if( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
604 p_filter->fmt_in.audio.i_rate = p_filter->fmt_out.audio.i_rate;
606 if( p_filter->fmt_in.audio.i_physical_channels == (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
607 && ( p_filter->fmt_in.audio.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
608 && !config_GetInt( p_filter, "headphone-dolby" ) )
611 p_filter->fmt_in.audio.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
618 msg_Dbg( p_filter, "requesting specific format" );
622 /* Allocate the memory needed to store the module's structure */
623 p_filter->p_sys = malloc( sizeof(struct filter_sys_t) );
624 if( p_filter->p_sys == NULL )
626 msg_Err( p_filter, "out of memory" );
629 p_filter->p_sys->i_overflow_buffer_size = 0;
630 p_filter->p_sys->p_overflow_buffer = NULL;
631 p_filter->p_sys->i_nb_atomic_operations = 0;
632 p_filter->p_sys->p_atomic_operations = NULL;
634 if( Init( VLC_OBJECT(p_filter), (struct aout_filter_sys_t *)p_filter->p_sys
635 , aout_FormatNbChannels ( &(p_filter->fmt_in.audio) )
636 , p_filter->fmt_in.audio.i_physical_channels
637 , p_filter->fmt_in.audio.i_rate ) < 0 )
642 p_filter->pf_audio_filter = Convert;
643 p_filter->fmt_out.audio.i_rate = p_filter->fmt_in.audio.i_rate;
648 /*****************************************************************************
649 * CloseFilter : deallocate data structures
650 *****************************************************************************/
651 static void CloseFilter( vlc_object_t *p_this )
653 filter_t *p_filter = (filter_t *)p_this;
655 if( p_filter->p_sys != NULL )
657 if( p_filter->p_sys->p_overflow_buffer != NULL )
659 free ( p_filter->p_sys->p_overflow_buffer );
661 if( p_filter->p_sys->p_atomic_operations != NULL )
663 free ( p_filter->p_sys->p_atomic_operations );
665 free( p_filter->p_sys );
666 p_filter->p_sys = NULL;
670 static block_t *Convert( filter_t *p_filter, block_t *p_block )
672 aout_filter_t aout_filter;
673 aout_buffer_t in_buf, out_buf;
677 if( !p_block || !p_block->i_samples )
679 if( p_block ) p_block->pf_release( p_block );
683 i_out_size = p_block->i_samples *
684 p_filter->fmt_out.audio.i_bitspersample/8 *
685 aout_FormatNbChannels( &(p_filter->fmt_out.audio) );
687 p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size );
690 msg_Warn( p_filter, "can't get output buffer" );
691 if( p_block ) p_block->pf_release( p_block );
695 p_out->i_samples = p_block->i_samples;
696 p_out->i_dts = p_block->i_dts;
697 p_out->i_pts = p_block->i_pts;
698 p_out->i_length = p_block->i_length;
700 aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
701 aout_filter.input = p_filter->fmt_in.audio;
702 aout_filter.input.i_format = p_filter->fmt_in.i_codec;
703 aout_filter.output = p_filter->fmt_out.audio;
704 aout_filter.output.i_format = p_filter->fmt_out.i_codec;
705 aout_filter.b_in_place = 0;
707 in_buf.p_buffer = p_block->p_buffer;
708 in_buf.i_nb_bytes = p_block->i_buffer;
709 in_buf.i_nb_samples = p_block->i_samples;
710 out_buf.p_buffer = p_out->p_buffer;
711 out_buf.i_nb_bytes = p_out->i_buffer;
712 out_buf.i_nb_samples = p_out->i_samples;
714 DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
716 p_out->i_buffer = out_buf.i_nb_bytes;
717 p_out->i_samples = out_buf.i_nb_samples;
719 if( p_block ) p_block->pf_release( p_block );