diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2007-05-09 23:15:19 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2007-05-09 23:15:19 +0000 |
commit | a32c2ce423c4749b403f02a0e320cd97410f42d2 (patch) | |
tree | c037c586137a89c262c8ed801746d761fdb70217 /libavcodec/pcm.c | |
parent | df495dbd9a5fc5053d5e7e6976932bb104cde4a6 (diff) | |
download | ffmpeg-streaming-a32c2ce423c4749b403f02a0e320cd97410f42d2.zip ffmpeg-streaming-a32c2ce423c4749b403f02a0e320cd97410f42d2.tar.gz |
Use AV_XX16 macros
Originally committed as revision 8963 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r-- | libavcodec/pcm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 693e14b..6921ee4 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -176,8 +176,8 @@ static inline void encode_from16(int bps, int le, int us, for(;n>0;n--) { register int v = *(*samples)++; v += usum; - (*dst)[le] = v >> 8; - (*dst)[1 - le] = v; + if (le) AV_WL16(*dst, v); + else AV_WB16(*dst, v); *dst += bps; } if (le) *dst -= bps - 2; @@ -366,7 +366,11 @@ static inline void decode_to16(int bps, int le, int us, register int n = src_len / bps; if (le) *src += bps - 2; for(;n>0;n--) { - *(*samples)++ = ((*src)[le] << 8 | (*src)[1 - le]) + usum; + register int v; + if (le) v = AV_RL16(*src); + else v = AV_RB16(*src); + v += usum; + *(*samples)++ = v; *src += bps; } if (le) *src -= bps - 2; |