amr: remove shift out of the AMR_BIT() macro.

MSVC doesn't like the offsetof(..) >> 1 construct, it interprets it as
a non-literal, thus causing use of this in static tables to fail
compilation.
pull/59/head
Ronald S. Bultje 13 years ago
parent 723b266d72
commit c51838478c
  1. 2
      libavcodec/amr.h
  2. 2
      libavcodec/amrnbdata.h
  3. 2
      libavcodec/amrwbdata.h

@ -61,7 +61,7 @@ static inline void ff_amr_bit_reorder(uint16_t *out, int size,
field <<= 1; field <<= 1;
field |= data[bit >> 3] >> (bit & 7) & 1; field |= data[bit >> 3] >> (bit & 7) & 1;
} }
out[field_offset] = field; out[field_offset >> 1] = field;
} }
} }

@ -71,7 +71,7 @@ typedef struct {
} AMRNBFrame; } AMRNBFrame;
/** The index of a frame parameter */ /** The index of a frame parameter */
#define AMR_BIT(field) (offsetof(AMRNBFrame, field) >> 1) #define AMR_BIT(field) (offsetof(AMRNBFrame, field))
/** The index of a subframe-specific parameter */ /** The index of a subframe-specific parameter */
#define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable) #define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable)

@ -82,7 +82,7 @@ typedef struct {
} AMRWBFrame; } AMRWBFrame;
/** The index of a frame parameter */ /** The index of a frame parameter */
#define AMR_BIT(field) (offsetof(AMRWBFrame, field) >> 1) #define AMR_BIT(field) (offsetof(AMRWBFrame, field))
/** The index of a subframe-specific parameter */ /** The index of a subframe-specific parameter */
#define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable) #define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable)

Loading…
Cancel
Save