[FFmpeg-devel] [PATCH] add E-AC-3 support to AC-3 decoder
Michael Niedermayer
michaelni
Sat Jun 7 20:14:40 CEST 2008
On Sat, Jun 07, 2008 at 10:30:31AM -0400, Justin Ruggles wrote:
> Hi,
>
> Here is a patch set to incrementally add support for E-AC-3 to the AC-3
> decoder. There are 32 total patches. I'm just attaching them all in
> this email instead of doing the git-send-email thing.
>
> Commit log messages:
[...]
> [PATCH 13/32] use macro constants for array sizes in decode context
ok
> [PATCH 15/32] cosmetics: add references to spec variable names
comments below
> [PATCH 16/32] store cpl_in_use for all blocks in decode context
comments below
> [PATCH 17/32] store exp_strategy for all blocks in decode context
ok
> [PATCH 18/32] split up header parsing function
ok
rest not reviewed
[...]
> diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
> index fc73cf7..95e6512 100644
> --- a/libavcodec/ac3dec.h
> +++ b/libavcodec/ac3dec.h
> @@ -63,14 +63,14 @@ typedef struct {
> ///@}
>
> ///@defgroup cpl standard coupling
> - int cpl_in_use; ///< coupling in use
> - int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling
> - int phase_flags_in_use; ///< phase flags in use
> - int phase_flags[18]; ///< phase flags
> - int num_cpl_subbands; ///< number of coupling sub bands
> - int num_cpl_bands; ///< number of coupling bands
> - int cpl_band_struct[18]; ///< coupling band structure
> - int cpl_coords[AC3_MAX_CHANNELS][18]; ///< coupling coordinates
> + int cpl_in_use; ///< coupling in use (cplinu)
> + int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl)
> + int phase_flags_in_use; ///< phase flags in use (phsflginu)
> + int phase_flags[18]; ///< phase flags (phsflg)
> + int num_cpl_subbands; ///< number of coupling sub bands (ncplsubnd)
> + int num_cpl_bands; ///< number of coupling bands (ncplbnd)
> + int cpl_band_struct[18]; ///< coupling band structure (cplbndstrc)
> + int cpl_coords[AC3_MAX_CHANNELS][18]; ///< coupling coordinates (cplco)
I think it would be clearer if the (names) where vertically aligned
[...]
> @@ -746,8 +747,8 @@ static int ac3_parse_audio_block(AC3DecodeContext *s, int blk)
> /* coupling strategy */
> if (get_bits1(gbc)) {
> memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS);
> - s->cpl_in_use = get_bits1(gbc);
> - if (s->cpl_in_use) {
> + s->cpl_in_use[blk] = get_bits1(gbc);
> + if (s->cpl_in_use[blk]) {
> /* coupling in use */
> int cpl_begin_freq, cpl_end_freq;
>
> @@ -789,10 +790,13 @@ static int ac3_parse_audio_block(AC3DecodeContext *s, int blk)
> } else if (!blk) {
> av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must be present in block 0\n");
> return -1;
> + } else {
> + s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
> }
> + cpl_in_use = s->cpl_in_use[blk];
following looks simpler:
cpl_in_use= get_bits1(gbc);
if(cpl_in_use){
...
} else {
cpl_in_use = s->cpl_in_use[blk-1];
}
s->cpl_in_use[blk] = cpl_in_use;
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- 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-devel/attachments/20080607/0f97e7e5/attachment.pgp>
More information about the ffmpeg-devel
mailing list