Merge commit 'd5c62122a7b26704bf867a1262df358623bf5edf'
[ffmpeg.git] / libavcodec / s302m.c
index 90406a9..5058ba0 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/log.h"
 #include "avcodec.h"
+#include "mathops.h"
 
 #define AES3_HEADER_LEN 4
 
@@ -118,34 +119,34 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
     if (avctx->bits_per_coded_sample == 24) {
         uint32_t *o = (uint32_t *)s->frame.data[0];
         for (; buf_size > 6; buf_size -= 7) {
-            *o++ = (av_reverse[buf[2]]        << 24) |
-                   (av_reverse[buf[1]]        << 16) |
-                   (av_reverse[buf[0]]        <<  8);
-            *o++ = (av_reverse[buf[6] & 0xf0] << 28) |
-                   (av_reverse[buf[5]]        << 20) |
-                   (av_reverse[buf[4]]        << 12) |
-                   (av_reverse[buf[3] & 0x0f] <<  4);
+            *o++ = (ff_reverse[buf[2]]        << 24) |
+                   (ff_reverse[buf[1]]        << 16) |
+                   (ff_reverse[buf[0]]        <<  8);
+            *o++ = (ff_reverse[buf[6] & 0xf0] << 28) |
+                   (ff_reverse[buf[5]]        << 20) |
+                   (ff_reverse[buf[4]]        << 12) |
+                   (ff_reverse[buf[3] & 0x0f] <<  4);
             buf += 7;
         }
     } else if (avctx->bits_per_coded_sample == 20) {
         uint32_t *o = (uint32_t *)s->frame.data[0];
         for (; buf_size > 5; buf_size -= 6) {
-            *o++ = (av_reverse[buf[2] & 0xf0] << 28) |
-                   (av_reverse[buf[1]]        << 20) |
-                   (av_reverse[buf[0]]        << 12);
-            *o++ = (av_reverse[buf[5] & 0xf0] << 28) |
-                   (av_reverse[buf[4]]        << 20) |
-                   (av_reverse[buf[3]]        << 12);
+            *o++ = (ff_reverse[buf[2] & 0xf0] << 28) |
+                   (ff_reverse[buf[1]]        << 20) |
+                   (ff_reverse[buf[0]]        << 12);
+            *o++ = (ff_reverse[buf[5] & 0xf0] << 28) |
+                   (ff_reverse[buf[4]]        << 20) |
+                   (ff_reverse[buf[3]]        << 12);
             buf += 6;
         }
     } else {
         uint16_t *o = (uint16_t *)s->frame.data[0];
         for (; buf_size > 4; buf_size -= 5) {
-            *o++ = (av_reverse[buf[1]]        <<  8) |
-                    av_reverse[buf[0]];
-            *o++ = (av_reverse[buf[4] & 0xf0] << 12) |
-                   (av_reverse[buf[3]]        <<  4) |
-                   (av_reverse[buf[2]]        >>  4);
+            *o++ = (ff_reverse[buf[1]]        <<  8) |
+                    ff_reverse[buf[0]];
+            *o++ = (ff_reverse[buf[4] & 0xf0] << 12) |
+                   (ff_reverse[buf[3]]        <<  4) |
+                   (ff_reverse[buf[2]]        >>  4);
             buf += 5;
         }
     }