[FFmpeg-cvslog] r15067 - trunk/libavcodec/eac3dec.c

Michael Niedermayer michaelni
Sun Aug 31 02:18:56 CEST 2008


On Sun, Aug 31, 2008 at 01:13:10AM +0200, jbr wrote:
> Author: jbr
> Date: Sun Aug 31 01:13:10 2008
> New Revision: 15067
> 
> Log:
> commit more OKed parts of the E-AC-3 decoder

[...]

> +    /* coupling strategy occurance and coupling use per block */
> +    num_cpl_blocks = 0;
> +    if (s->channel_mode > 1) {
> +        for (blk = 0; blk < s->num_blocks; blk++) {
> +            s->cpl_strategy_exists[blk] = (!blk || get_bits1(gbc));
> +            if (s->cpl_strategy_exists[blk]) {
> +                s->cpl_in_use[blk] = get_bits1(gbc);
> +            } else {
> +                s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
> +            }
> +            num_cpl_blocks += s->cpl_in_use[blk];
> +        }
> +    } else {
> +        memset(s->cpl_in_use, 0, sizeof(s->cpl_in_use));
> +    }
> +
> +    /* exponent strategy data */
> +    if (ac3_exponent_strategy) {
> +        /* AC-3-style exponent strategy syntax */
> +        for (blk = 0; blk < s->num_blocks; blk++) {
> +            for (ch = !s->cpl_in_use[blk]; ch <= s->fbw_channels; ch++) {
> +                s->exp_strategy[blk][ch] = get_bits(gbc, 2);
> +            }
> +        }
> +    } else {

> +        /* LUT-based exponent strategy syntax */
> +        int frmchexpstr;
> +        for (ch = !((s->channel_mode > 1) && num_cpl_blocks); ch <= s->fbw_channels; ch++) {
> +            frmchexpstr = get_bits(gbc, 5);
> +            for (blk = 0; blk < 6; blk++) {
> +                s->exp_strategy[blk][ch] = ff_eac3_frm_expstr[frmchexpstr][blk];
> +            }
> +        }

You did commit a little more than i approved ...
here declaration and init can be merged


> +    }
> +    /* LFE exponent strategy */
> +    if (s->lfe_on) {
> +        for (blk = 0; blk < s->num_blocks; blk++) {
> +            s->exp_strategy[blk][s->lfe_ch] = get_bits1(gbc);
> +        }
> +    }
> +    /* original exponent strategies if this stream was converted from AC-3 */
> +    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT &&
> +            (s->num_blocks == 6 || get_bits1(gbc))) {

> +        for (ch = 1; ch <= s->fbw_channels; ch++) {
> +            skip_bits(gbc, 5); // skip converter channel exponent strategy
> +        }

skip_bits(gbc, 5 * s->fbw_channels);


> +    }
> +
> +    /* determine which channels use AHT */
> +    if (parse_aht_info) {
> +        /* AHT is only available when there are 6 blocks in the frame.
> +           The coupling channel can only use AHT when coupling is in use for
> +           all blocks.
> +           reference: Section E3.3.2 Bit Stream Helper Variables */
> +        s->channel_uses_aht[CPL_CH]=0;
> +        for (ch = (num_cpl_blocks != 6); ch <= s->channels; ch++) {
> +            int nchregs = 0;
> +            for (blk = 0; blk < 6; blk++) {
> +                if (ch)
> +                    nchregs += (s->exp_strategy[blk][ch] != EXP_REUSE);
> +                else
> +                    nchregs += s->cpl_strategy_exists[blk] ||
> +                               (s->exp_strategy[blk][CPL_CH] != EXP_REUSE);
> +            }
> +            s->channel_uses_aht[ch] = (nchregs == 1) && get_bits1(gbc);
> +        }
> +    } else {
> +        memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
> +    }

I think this code needs to be commented a little more, i cannot really relate
the comment with the code.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Thouse who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080831/a4f052f8/attachment.pgp>



More information about the ffmpeg-cvslog mailing list