[FFmpeg-devel] PATCH: cook.c decouple isolation

Benoit Fouet benoit.fouet
Tue Jul 17 09:17:34 CEST 2007


Hi,

Marc Hoffman wrote:
> Separates the arithmetic portion of joint_decode, so we can handle
> various formats.
>   
> ------------------------------------------------------------------------
>
> Index: cook.c
> ===================================================================
> --- cook.c	(revision 9693)
> +++ cook.c	(working copy)
> @@ -741,6 +741,30 @@
>      return;
>  }
>  
> +/*
> + * function decouples a pair of signals from a single signal via multiplication.
> + *
> + * @param q                 pointer to the COOKContext
> + * @param subband           index of the current subband
> + * @param f1                multiplier for channel 1 extraction
> + * @param f2                multiplier for channel 2 extraction
> + * @param decode_buffer     input buffer
> + * @param mlt_buffer1       pointer to left channel mlt coefficients
> + * @param mlt_buffer2       pointer to right channel mlt coefficients
> + */
> +static void decouple_float (COOKContext *q,
> +                            int subband,
> +                            float f1, float f2,
> +                            float *decode_buffer,
> +                            float *mlt_buffer1, float *mlt_buffer2)
> +{
> +    int j, tmp_idx;
> +    for (j=0 ; j<SUBBAND_SIZE ; j++) {
> +        tmp_idx = ((q->js_subband_start + subband)*SUBBAND_SIZE)+j;
> +        mlt_buffer1[SUBBAND_SIZE*subband + j] = f1 * decode_buffer[tmp_idx];
> +        mlt_buffer2[SUBBAND_SIZE*subband + j] = f2 * decode_buffer[tmp_idx];
> +    }
> +}
>  
>  /**
>   * function for decoding joint stereo data
> @@ -785,11 +809,7 @@
>          cplscale = (float*)cplscales[q->js_vlc_bits-2];  //choose decoupler table
>          f1 = cplscale[decouple_tab[cpl_tmp]];
>          f2 = cplscale[idx-1];
> -        for (j=0 ; j<SUBBAND_SIZE ; j++) {
> -            tmp_idx = ((q->js_subband_start + i)*20)+j;
>   

tmp_idx is then unused in joint_decode

-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list