mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
Simplify: use a for instead of unrolling by hand
Originally committed as revision 15213 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
fb17d9ff54
commit
1b0dc0120d
@ -317,7 +317,7 @@ static int mace3_decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
short *samples = data;
|
short *samples = data;
|
||||||
MACEContext *ctx = avctx->priv_data;
|
MACEContext *ctx = avctx->priv_data;
|
||||||
int i, j;
|
int i, j, k;
|
||||||
|
|
||||||
for(i = 0; i < avctx->channels; i++) {
|
for(i = 0; i < avctx->channels; i++) {
|
||||||
ctx->index = ctx->lev = 0;
|
ctx->index = ctx->lev = 0;
|
||||||
@ -325,15 +325,12 @@ static int mace3_decode_frame(AVCodecContext *avctx,
|
|||||||
ctx->outPtr = samples + i;
|
ctx->outPtr = samples + i;
|
||||||
|
|
||||||
for (j=0; j < buf_size / 2 / avctx->channels; j++) {
|
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++) {
|
||||||
chomp3(ctx, pkt & 7, MACEtab1, MACEtab2, avctx->channels);
|
uint8_t pkt = buf[i*2 + j*2*avctx->channels + k];
|
||||||
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 & 7, MACEtab1, MACEtab2, avctx->channels);
|
||||||
chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, avctx->channels);
|
chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, avctx->channels);
|
||||||
chomp3(ctx, pkt >> 5 , MACEtab1, MACEtab2, avctx->channels);
|
chomp3(ctx, pkt >> 5 , MACEtab1, MACEtab2, avctx->channels);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user