Commit c8ae9eb3 authored by jbr's avatar jbr

change 2 fields from context to local variables

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9823 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2630b206
...@@ -89,8 +89,6 @@ typedef struct { ...@@ -89,8 +89,6 @@ typedef struct {
int cplinu; int cplinu;
int chincpl[AC3_MAX_CHANNELS]; int chincpl[AC3_MAX_CHANNELS];
int phsflginu; int phsflginu;
int cplbegf;
int cplendf;
int cplcoe; int cplcoe;
uint32_t cplbndstrc; uint32_t cplbndstrc;
int rematstr; int rematstr;
...@@ -801,23 +799,25 @@ static int ac3_parse_audio_block(AC3DecodeContext *ctx, int blk) ...@@ -801,23 +799,25 @@ static int ac3_parse_audio_block(AC3DecodeContext *ctx, int blk)
ctx->cplinu = get_bits1(gb); ctx->cplinu = get_bits1(gb);
ctx->cplbndstrc = 0; ctx->cplbndstrc = 0;
if (ctx->cplinu) { /* coupling in use */ if (ctx->cplinu) { /* coupling in use */
int cplbegf, cplendf;
for (i = 0; i < nfchans; i++) for (i = 0; i < nfchans; i++)
ctx->chincpl[i] = get_bits1(gb); ctx->chincpl[i] = get_bits1(gb);
if (acmod == AC3_ACMOD_STEREO) if (acmod == AC3_ACMOD_STEREO)
ctx->phsflginu = get_bits1(gb); //phase flag in use ctx->phsflginu = get_bits1(gb); //phase flag in use
ctx->cplbegf = get_bits(gb, 4); cplbegf = get_bits(gb, 4);
ctx->cplendf = get_bits(gb, 4); cplendf = get_bits(gb, 4);
if (3 + ctx->cplendf - ctx->cplbegf < 0) { if (3 + cplendf - cplbegf < 0) {
av_log(NULL, AV_LOG_ERROR, "cplendf = %d < cplbegf = %d\n", ctx->cplendf, ctx->cplbegf); av_log(NULL, AV_LOG_ERROR, "cplendf = %d < cplbegf = %d\n", cplendf, cplbegf);
return -1; return -1;
} }
ctx->ncplbnd = ctx->ncplsubnd = 3 + ctx->cplendf - ctx->cplbegf; ctx->ncplbnd = ctx->ncplsubnd = 3 + cplendf - cplbegf;
ctx->cplstrtmant = ctx->cplbegf * 12 + 37; ctx->cplstrtmant = cplbegf * 12 + 37;
ctx->cplendmant = ctx->cplendf * 12 + 73; ctx->cplendmant = cplendf * 12 + 73;
for (i = 0; i < ctx->ncplsubnd - 1; i++) /* coupling band structure */ for (i = 0; i < ctx->ncplsubnd - 1; i++) /* coupling band structure */
if (get_bits1(gb)) { if (get_bits1(gb)) {
ctx->cplbndstrc |= 1 << i; ctx->cplbndstrc |= 1 << i;
...@@ -857,13 +857,13 @@ static int ac3_parse_audio_block(AC3DecodeContext *ctx, int blk) ...@@ -857,13 +857,13 @@ static int ac3_parse_audio_block(AC3DecodeContext *ctx, int blk)
if (acmod == AC3_ACMOD_STEREO) {/* rematrixing */ if (acmod == AC3_ACMOD_STEREO) {/* rematrixing */
ctx->rematstr = get_bits1(gb); ctx->rematstr = get_bits1(gb);
if (ctx->rematstr) { if (ctx->rematstr) {
if (!(ctx->cplinu) || ctx->cplbegf > 2) if (!(ctx->cplinu) || ctx->cplstrtmant > 61)
for (rbnd = 0; rbnd < 4; rbnd++) for (rbnd = 0; rbnd < 4; rbnd++)
ctx->rematflg[rbnd] = get_bits1(gb); ctx->rematflg[rbnd] = get_bits1(gb);
if (ctx->cplbegf > 0 && ctx->cplbegf <= 2 && ctx->cplinu) if (ctx->cplstrtmant > 37 && ctx->cplstrtmant <= 61 && ctx->cplinu)
for (rbnd = 0; rbnd < 3; rbnd++) for (rbnd = 0; rbnd < 3; rbnd++)
ctx->rematflg[rbnd] = get_bits1(gb); ctx->rematflg[rbnd] = get_bits1(gb);
if (ctx->cplbegf == 0 && ctx->cplinu) if (ctx->cplstrtmant == 37 && ctx->cplinu)
for (rbnd = 0; rbnd < 2; rbnd++) for (rbnd = 0; rbnd < 2; rbnd++)
ctx->rematflg[rbnd] = get_bits1(gb); ctx->rematflg[rbnd] = get_bits1(gb);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment