[Ffmpeg-devel] sse sigsegv and libavcodec/wmadec.c

Benjamin Larsson banan
Thu Dec 7 10:50:15 CET 2006


Franz Bakan skrev:
> Hi,
>
> wmadec.c line 720 and 1110 :
>  DECLARE_ALIGNED_16()
> does not work for stack-variables inside functions.
> (at least not for GCC 331 on OS/2) but IIRC this is a
> cross-platform-restriction.
> If I move the two declarations to the top of the file
> I get rid of these nasty SIGSEGVs on my PIII computer.
>
> Please patch
>
> Thanks
> Franz
> ------------------------------------------------------------------------
>
> --- wmadec.c	2006-12-01 22:26:06.000000000 +0100
> +++ o:wmadec.c	2006-12-01 22:36:06.000000000 +0100
> @@ -67,6 +67,9 @@
>  #define HGAINVLCBITS 9
>  #define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS)
>  
> +DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]);
> +DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]);
>   

Hi, can you move these 2 buffers to the WMADecodeContext and see if that 
fixes the problem ?

> +
>  typedef struct WMADecodeContext {
>      GetBitContext gb;
>      int sample_rate;
> @@ -717,7 +720,6 @@
>  {
>      int n, v, a, ch, code, bsize;
>      int coef_nb_bits, total_gain, parse_exponents;
> -    DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]);
>      int nb_coefs[MAX_CHANNELS];
>      float mdct_norm;
>  
> @@ -1107,7 +1109,6 @@
>  
>      for(ch = 0; ch < s->nb_channels; ch++) {
>          if (s->channel_coded[ch]) {
> -            DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]);
>              float *ptr;
>              int n4, index, n;
>   

MvH
Benjamin Larsson




More information about the ffmpeg-devel mailing list