Mercurial > libavcodec.hg
changeset 7797:09b73aceebaf libavcodec
Simplify: use a for instead of unrolling by hand
author | vitor |
---|---|
date | Fri, 05 Sep 2008 00:00:20 +0000 |
parents | a7caaa2b56e9 |
children | e7ec66d55d9e |
files | mace.c |
diffstat | 1 files changed, 4 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mace.c Thu Sep 04 23:54:57 2008 +0000 +++ b/mace.c Fri Sep 05 00:00:20 2008 +0000 @@ -317,7 +317,7 @@ { 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 @@ ctx->outPtr = samples + i; for (j=0; j < buf_size / 2 / avctx->channels; j++) { - uint8_t pkt = buf[i*2 + j*2*avctx->channels]; + 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); - - pkt = buf[i*2 + j*2*avctx->channels + 1]; - 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); + } } }