changeset 4958:842b30b88d9a libavcodec

Use AV_XX16 macros
author ramiro
date Wed, 09 May 2007 23:15:19 +0000
parents 3fcb2f0d9ef1
children e00e16be833a
files pcm.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pcm.c	Wed May 09 23:13:43 2007 +0000
+++ b/pcm.c	Wed May 09 23:15:19 2007 +0000
@@ -176,8 +176,8 @@
     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 @@
     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;