summaryrefslogtreecommitdiff
path: root/libavcodec/dpcm.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-09-11 12:13:13 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-09-30 18:15:53 -0400
commitfc6faee0d1d8bfea642be462c7fd6dcc964f6110 (patch)
treeae2f7cdadc57aacd712d262338847faf74b4596c /libavcodec/dpcm.c
parent989bb7bd0477ef467f374dd8464a88d039f86ebe (diff)
downloadffmpeg-fc6faee0d1d8bfea642be462c7fd6dcc964f6110.tar.gz
dpcm: move codec-specific variable declarations to their corresponding decoding blocks.
Diffstat (limited to 'libavcodec/dpcm.c')
-rw-r--r--libavcodec/dpcm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index a024671fa2..02267d7641 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -175,8 +175,6 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
int ch = 0;
int stereo = s->channels - 1;
short *output_samples = data;
- int shift[2];
- short diff;
if (!buf_size)
return 0;
@@ -253,8 +251,9 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
break;
case CODEC_ID_XAN_DPCM:
+ {
+ int shift[2] = { 4, 4 };
in = 0;
- shift[0] = shift[1] = 4;
predictor[0] = AV_RL16(&buf[in]);
in += 2;
SE_16BIT(predictor[0]);
@@ -266,7 +265,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
while (in < buf_size) {
uint8_t n = buf[in++];
- diff = (n & 0xFC) << 8;
+ int16_t diff = (n & 0xFC) << 8;
if ((n & 0x03) == 3)
shift[ch]++;
else
@@ -285,6 +284,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
ch ^= stereo;
}
break;
+ }
case CODEC_ID_SOL_DPCM:
in = 0;
if (avctx->codec_tag != 3) {