Mercurial > mplayer.hg
diff libmpcodecs/ad_imaadpcm.c @ 31614:b40d593a463f
Use AV_RL* macros instead of typecasts where appropriate.
author | reimar |
---|---|
date | Sat, 10 Jul 2010 22:24:31 +0000 |
parents | cc27da5d7286 |
children |
line wrap: on
line diff
--- a/libmpcodecs/ad_imaadpcm.c Sat Jul 10 22:12:38 2010 +0000 +++ b/libmpcodecs/ad_imaadpcm.c Sat Jul 10 22:24:31 2010 +0000 @@ -39,7 +39,7 @@ #include <inttypes.h> #include "config.h" -#include "libavutil/common.h" +#include "libavutil/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 @@ 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 @@ 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 @@ 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]; }