[FFmpeg-cvslog] amr: remove shift out of the AMR_BIT() macro.

Ronald S. Bultje git at videolan.org
Wed Jul 4 21:09:50 CEST 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Tue Jul  3 20:36:44 2012 -0700| [c51838478cab37488883f49ce940c4a0f0b235ba] | committer: Ronald S. Bultje

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c51838478cab37488883f49ce940c4a0f0b235ba
---

 libavcodec/amr.h       |    2 +-
 libavcodec/amrnbdata.h |    2 +-
 libavcodec/amrwbdata.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/amr.h b/libavcodec/amr.h
index ae6e4d1..9498d57 100644
--- a/libavcodec/amr.h
+++ b/libavcodec/amr.h
@@ -61,7 +61,7 @@ static inline void ff_amr_bit_reorder(uint16_t *out, int size,
            field <<= 1;
            field |= data[bit >> 3] >> (bit & 7) & 1;
         }
-        out[field_offset] = field;
+        out[field_offset >> 1] = field;
     }
 }
 
diff --git a/libavcodec/amrnbdata.h b/libavcodec/amrnbdata.h
index 26ff7fb..c2e2f8a 100644
--- a/libavcodec/amrnbdata.h
+++ b/libavcodec/amrnbdata.h
@@ -71,7 +71,7 @@ typedef struct {
 } AMRNBFrame;
 
 /** 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 */
 #define AMR_OF(frame_num, variable)     AMR_BIT(subframe[frame_num].variable)
 
diff --git a/libavcodec/amrwbdata.h b/libavcodec/amrwbdata.h
index 5421c23..83a93e9 100644
--- a/libavcodec/amrwbdata.h
+++ b/libavcodec/amrwbdata.h
@@ -82,7 +82,7 @@ typedef struct {
 } AMRWBFrame;
 
 /** 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 */
 #define AMR_OF(frame_num, variable)     AMR_BIT(subframe[frame_num].variable)
 



More information about the ffmpeg-cvslog mailing list