diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-07-10 22:24:31 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-02 04:14:43 +0200 |
commit | d12c624ea8c58be40181cfbd7816f50e9e6c00ce (patch) | |
tree | 2c5706c559e3897f40e7912d72562440c5328a86 /libmpcodecs/ad_imaadpcm.c | |
parent | 1663d97a112261c10f989b70547545048f9e31c3 (diff) | |
download | mpv-d12c624ea8c58be40181cfbd7816f50e9e6c00ce.tar.bz2 mpv-d12c624ea8c58be40181cfbd7816f50e9e6c00ce.tar.xz |
Use AV_RL* macros instead of typecasts where appropriate
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31680 b3059339-0415-0410-9bf9-f77b7e298cf2
100l compialtion fix and use AV_RB32.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31683 b3059339-0415-0410-9bf9-f77b7e298cf2
Current FFmpeg installs intreadwrite.h, but keep using the internal
version for now to keep the possibility of compiling against older
FFmpeg lib versions.
Diffstat (limited to 'libmpcodecs/ad_imaadpcm.c')
-rw-r--r-- | libmpcodecs/ad_imaadpcm.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libmpcodecs/ad_imaadpcm.c b/libmpcodecs/ad_imaadpcm.c index 11a561315a..2ca71f29de 100644 --- a/libmpcodecs/ad_imaadpcm.c +++ b/libmpcodecs/ad_imaadpcm.c @@ -39,7 +39,7 @@ #include <inttypes.h> #include "config.h" -#include "libavutil/common.h" +#include "ffmpeg_files/intreadwrite.h" #include "mpbswap.h" #include "ad_internal.h" @@ -49,9 +49,6 @@ #define QT_IMA_ADPCM_BLOCK_SIZE 0x22 #define QT_IMA_ADPCM_SAMPLES_PER_BLOCK 64 -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) - // pertinent tables for IMA ADPCM static const int16_t adpcm_step[89] = { @@ -189,7 +186,7 @@ static int qt_ima_adpcm_decode_block(unsigned short *output, return -1; for (i = 0; i < channels; i++) { - initial_index[i] = initial_predictor[i] = (int16_t)BE_16(&input[i * QT_IMA_ADPCM_BLOCK_SIZE]); + initial_index[i] = initial_predictor[i] = (int16_t)AV_RB16(&input[i * QT_IMA_ADPCM_BLOCK_SIZE]); // mask, sign-extend, and clamp the predictor portion initial_predictor[i] &= ~0x7F; @@ -239,7 +236,7 @@ static int ms_ima_adpcm_decode_block(unsigned short *output, return -1; for (i = 0; i < channels; i++) { - predictor[i] = (int16_t)LE_16(&input[i * 4]); + predictor[i] = (int16_t)AV_RL16(&input[i * 4]); index[i] = input[i * 4 + 2]; } @@ -303,7 +300,7 @@ static int dk4_ima_adpcm_decode_block(unsigned short *output, for (i = 0; i < channels; i++) { // the first predictor value goes straight to the output - predictor[i] = output[i] = (int16_t)LE_16(&input[i * 4]); + predictor[i] = output[i] = (int16_t)AV_RL16(&input[i * 4]); index[i] = input[i * 4 + 2]; } |