On 2014-02-15 20:03:13 +0100, Christophe Gisquet wrote:
> Hi,
> 
> > > diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
> > > index 2d88cb4..371c838 100644
> > > --- a/libavcodec/dcadec.c
> > > +++ b/libavcodec/dcadec.c
> > > @@ -50,14 +50,10 @@
> > >  #if ARCH_ARM
> > >  #   include "arm/dca.h"
> > >  #endif
> > > -#if ARCH_X86
> > > -#   include "x86/dca.h"
> > > -#endif
> > >
> > >  //#define TRACE
> > >
> > >  #define DCA_PRIM_CHANNELS_MAX  (7)
> > > -#define DCA_SUBBANDS          (32)
> > >  #define DCA_ABITS_MAX         (32)      /* Should be 28 */
> > >  #define DCA_SUBSUBFRAMES_MAX   (4)
> > >  #define DCA_SUBFRAMES_MAX     (16)
> > > @@ -340,7 +336,7 @@ typedef struct {
> > >      int prediction_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];      ///<
> prediction VQ coefs
> > >      int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];           ///<
> bit allocation index
> > >      int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];    ///<
> transition mode (transients)
> > > -    int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2];    ///<
> scale factors (2 if transient)
> > > +    int32_t scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2];///<
> scale factors (2 if transient)
> >
> > Don't we assume that int is 32 bit wide? I guess much more would break
> > if that assumption doesn't hold. change of course ok when using it in asm.
> 
> I think it's dangerous because:
> - natural size of int on x86_64 is 64b

no, it's 32 bits wide as on most unix systems. the difference is long
which is 32 bits wide on windows but 64 bits wide on unix like systems

But using strongly defined types is obviously the right thing when
interfacing with asm.

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to