summaryrefslogtreecommitdiff
path: root/libavcodec/s302m.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-10-11 18:50:30 +0200
committerDiego Biurrun <diego@biurrun.de>2012-10-12 20:39:18 +0200
commitd5c62122a7b26704bf867a1262df358623bf5edf (patch)
tree187a81249ccd692b0d25c951185721055ef3c797 /libavcodec/s302m.c
parent930c9d4373e0f3cb7c64fcfc129127a309f6d066 (diff)
downloadffmpeg-d5c62122a7b26704bf867a1262df358623bf5edf.tar.gz
Move av_reverse table to libavcodec
It is only used in that library.
Diffstat (limited to 'libavcodec/s302m.c')
-rw-r--r--libavcodec/s302m.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index 087e948dd1..132c094935 100644
--- a/libavcodec/s302m.c
+++ b/libavcodec/s302m.c
@@ -20,9 +20,10 @@
* 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
@@ -105,34 +106,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;
}
}