aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mace.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-09-05 00:00:20 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-09-05 00:00:20 +0000
commit1b0dc0120d97377cddcafa0467a424df71c876dd (patch)
treee08332dac603b4eae369e5b000492fbac3342af9 /libavcodec/mace.c
parentfb17d9ff54ddd3d9f39f6d666ed49a7113832753 (diff)
downloadffmpeg-1b0dc0120d97377cddcafa0467a424df71c876dd.tar.gz
Simplify: use a for instead of unrolling by hand
Originally committed as revision 15213 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mace.c')
-rw-r--r--libavcodec/mace.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index be766bc135..79967f6a5b 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -317,7 +317,7 @@ static int mace3_decode_frame(AVCodecContext *avctx,
{
short *samples = data;
MACEContext *ctx = avctx->priv_data;
- int i, j;
+ int i, j, k;
for(i = 0; i < avctx->channels; i++) {
ctx->index = ctx->lev = 0;
@@ -325,15 +325,12 @@ static int mace3_decode_frame(AVCodecContext *avctx,
ctx->outPtr = samples + i;
for (j=0; j < buf_size / 2 / avctx->channels; j++) {
- uint8_t pkt = buf[i*2 + j*2*avctx->channels];
- chomp3(ctx, pkt & 7, MACEtab1, MACEtab2, avctx->channels);
- chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, avctx->channels);
- chomp3(ctx, pkt >> 5 , MACEtab1, MACEtab2, avctx->channels);
-
- pkt = buf[i*2 + j*2*avctx->channels + 1];
+ for (k=0; k < 2; k++) {
+ uint8_t pkt = buf[i*2 + j*2*avctx->channels + k];
chomp3(ctx, pkt & 7, MACEtab1, MACEtab2, avctx->channels);
chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, avctx->channels);
chomp3(ctx, pkt >> 5 , MACEtab1, MACEtab2, avctx->channels);
+ }
}
}