aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-09-04 23:12:20 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-09-04 23:12:20 +0000
commitb97c4138323ad9b19a94cecf6477511bead7500c (patch)
tree340b721cd8d203d59d584d22a7fa75dcdb867a1c
parent62c24705c84204fdcd44318d20caace076636eb1 (diff)
downloadffmpeg-b97c4138323ad9b19a94cecf6477511bead7500c.tar.gz
Simplify mace_decode_frame()
Originally committed as revision 15207 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mace.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 4154cc98ed..464f30d3dc 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -395,23 +395,26 @@ static int mace_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
- short *samples;
+ short *samples = data;
MACEContext *c = avctx->priv_data;
+ int i;
- samples = (short *)data;
switch (avctx->codec->id) {
case CODEC_ID_MACE3:
dprintf(avctx, "mace_decode_frame[3]()");
- Exp1to3(c, buf, samples, buf_size / 2 / avctx->channels, avctx->channels, 1);
- if (avctx->channels == 2)
- Exp1to3(c, buf, samples+1, buf_size / 2 / 2, 2, 2);
+ for(i = 0; i < avctx->channels; i++)
+ Exp1to3(c, buf, samples + i, buf_size / 2 / avctx->channels,
+ avctx->channels, i + 1);
+
*data_size = 2 * 3 * buf_size;
break;
case CODEC_ID_MACE6:
dprintf(avctx, "mace_decode_frame[6]()");
- Exp1to6(c, buf, samples, buf_size / avctx->channels, avctx->channels, 1);
- if (avctx->channels == 2)
- Exp1to6(c, buf, samples+1, buf_size / 2, 2, 2);
+
+ for(i = 0; i < avctx->channels; i++)
+ Exp1to6(c, buf, samples + i, buf_size / avctx->channels,
+ avctx->channels, i + 1);
+
*data_size = 2 * 6 * buf_size;
break;
default: