summaryrefslogtreecommitdiff
path: root/libavcodec/mpc7.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-28 21:01:50 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-28 21:01:50 +0000
commit836fc7778513fa97c1852444155f82627ecbb8cd (patch)
treec07fd9ed16d599a2981f46db42f30f02d7d91345 /libavcodec/mpc7.c
parentdd0cd3d2730b93958a34dea7c7890e71d2d72bf6 (diff)
Move variable declaration to block where it is used and simplify code.
Avoids a (incorrect) "possibly used uninitialized" warning, no measurable speed difference. Originally committed as revision 21518 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpc7.c')
-rw-r--r--libavcodec/mpc7.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
index ac57f4a62a..f6eb12cdb4 100644
--- a/libavcodec/mpc7.c
+++ b/libavcodec/mpc7.c
@@ -192,7 +192,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx,
MPCContext *c = avctx->priv_data;
GetBitContext gb;
uint8_t *bits;
- int i, ch, t;
+ int i, ch;
int mb = -1;
Band *bands = c->bands;
int off;
@@ -211,8 +211,9 @@ static int mpc7_decode_frame(AVCodecContext * avctx,
/* read subband indexes */
for(i = 0; i <= c->maxbands; i++){
for(ch = 0; ch < 2; ch++){
+ int t = 4;
if(i) t = get_vlc2(&gb, hdr_vlc.table, MPC7_HDR_BITS, 1) - 5;
- if(!i || (t == 4)) bands[i].res[ch] = get_bits(&gb, 4);
+ if(t == 4) bands[i].res[ch] = get_bits(&gb, 4);
else bands[i].res[ch] = bands[i-1].res[ch] + t;
}