Mercurial > libavcodec.hg
comparison ac3dec.c @ 5472:11585a021898 libavcodec
move some variables to a more local scope.
author | jbr |
---|---|
date | Sat, 04 Aug 2007 13:30:37 +0000 |
parents | 37c1944ca4ee |
children | 3e07472540c6 |
comparison
equal
deleted
inserted
replaced
5471:37c1944ca4ee | 5472:11585a021898 |
---|---|
698 int nfchans = ctx->nfchans; | 698 int nfchans = ctx->nfchans; |
699 int acmod = ctx->acmod; | 699 int acmod = ctx->acmod; |
700 int i, bnd, seg, ch; | 700 int i, bnd, seg, ch; |
701 GetBitContext *gb = &ctx->gb; | 701 GetBitContext *gb = &ctx->gb; |
702 int bit_alloc_flags = 0; | 702 int bit_alloc_flags = 0; |
703 int mstrcplco, cplcoexp, cplcomant; | |
704 int chbwcod, skipl; | |
705 | 703 |
706 for (i = 0; i < nfchans; i++) /*block switch flag */ | 704 for (i = 0; i < nfchans; i++) /*block switch flag */ |
707 ctx->blksw[i] = get_bits1(gb); | 705 ctx->blksw[i] = get_bits1(gb); |
708 | 706 |
709 ctx->dither_all = 1; | 707 ctx->dither_all = 1; |
765 int cplcoe = 0; | 763 int cplcoe = 0; |
766 | 764 |
767 for (i = 0; i < nfchans; i++) { | 765 for (i = 0; i < nfchans; i++) { |
768 if (ctx->chincpl[i]) { | 766 if (ctx->chincpl[i]) { |
769 if (get_bits1(gb)) { /* coupling co-ordinates */ | 767 if (get_bits1(gb)) { /* coupling co-ordinates */ |
768 int mstrcplco, cplcoexp, cplcomant; | |
770 cplcoe = 1; | 769 cplcoe = 1; |
771 mstrcplco = 3 * get_bits(gb, 2); | 770 mstrcplco = 3 * get_bits(gb, 2); |
772 for (bnd = 0; bnd < ctx->ncplbnd; bnd++) { | 771 for (bnd = 0; bnd < ctx->ncplbnd; bnd++) { |
773 cplcoexp = get_bits(gb, 4); | 772 cplcoexp = get_bits(gb, 4); |
774 cplcomant = get_bits(gb, 4); | 773 cplcomant = get_bits(gb, 4); |
813 for (i = 0; i < nfchans; i++) { /* channel bandwidth code */ | 812 for (i = 0; i < nfchans; i++) { /* channel bandwidth code */ |
814 if (ctx->chexpstr[i] != EXP_REUSE) { | 813 if (ctx->chexpstr[i] != EXP_REUSE) { |
815 if (ctx->chincpl[i]) | 814 if (ctx->chincpl[i]) |
816 ctx->endmant[i] = ctx->cplstrtmant; | 815 ctx->endmant[i] = ctx->cplstrtmant; |
817 else { | 816 else { |
818 chbwcod = get_bits(gb, 6); | 817 int chbwcod = get_bits(gb, 6); |
819 if (chbwcod > 60) { | 818 if (chbwcod > 60) { |
820 av_log(NULL, AV_LOG_ERROR, "chbwcod = %d > 60", chbwcod); | 819 av_log(NULL, AV_LOG_ERROR, "chbwcod = %d > 60", chbwcod); |
821 return -1; | 820 return -1; |
822 } | 821 } |
823 ctx->endmant[i] = chbwcod * 3 + 73; | 822 ctx->endmant[i] = chbwcod * 3 + 73; |
962 DBA_NONE, 0, NULL, NULL, NULL); | 961 DBA_NONE, 0, NULL, NULL, NULL); |
963 } | 962 } |
964 } | 963 } |
965 | 964 |
966 if (get_bits1(gb)) { /* unused dummy data */ | 965 if (get_bits1(gb)) { /* unused dummy data */ |
967 skipl = get_bits(gb, 9); | 966 int skipl = get_bits(gb, 9); |
968 while(skipl--) | 967 while(skipl--) |
969 skip_bits(gb, 8); | 968 skip_bits(gb, 8); |
970 } | 969 } |
971 /* unpack the transform coefficients | 970 /* unpack the transform coefficients |
972 * * this also uncouples channels if coupling is in use. | 971 * * this also uncouples channels if coupling is in use. |