[FFmpeg-devel] [PATCH] AAC Decoder round 4
Robert Swain
robert.swain
Wed Jul 30 21:55:34 CEST 2008
2008/7/30 Michael Niedermayer <michaelni at gmx.at>:
> On Wed, Jul 30, 2008 at 07:24:44PM +0100, Robert Swain wrote:
>> Again, I thought you mean line-breaks in the code, not in how the
>> patch was coming through in the e-mail. Again, see attached
>> (20080728-1344-refactor_excluded_channels.diff).
> [...]
>> Index: aac.c
>> ===================================================================
>> --- aac.c (revision 2918)
>> +++ aac.c (working copy)
>> @@ -279,7 +279,7 @@
>> int dyn_rng_sgn[17]; ///< DRC sign information; 0 - positive, 1 - negative
>> int dyn_rng_ctl[17]; ///< DRC magnitude information
>> int exclude_mask[MAX_CHANNELS]; ///< Channels to be excluded from DRC processing.
>> - int additional_excluded_chns[MAX_CHANNELS]; /**< The exclude_mask bits are
>> + int additional_excluded_chns[MAX_CHANNELS / 7]; /**< The exclude_mask bits are
>> coded in groups of 7 with 1 bit preceeding each group (except the first)
>> indicating that 7 more mask bits are coded. */
>> int band_incr; ///< Number of DRC bands greater than 1 having DRC info.
>> @@ -1607,21 +1607,13 @@
>> * @return Returns number of bytes consumed.
>> */
>> static int decode_drc_channel_exclusions(AACContext * ac, GetBitContext * gb) {
>> - int i;
>> - int n = 1;
>> - int num_excl_chan = 7;
>> + int i, n;
>>
>> - for (i = 0; i < 7; i++)
>> - ac->che_drc.exclude_mask[i] = get_bits1(gb);
>> + for (i=0, n=0; i < MAX_CHANNELS && (((i+1)%7) || (ac->che_drc.additional_excluded_chns[n++] = get_bits1(gb))); i++)
>> + ac->che_drc.exclude_mask[i] = get_bits1(gb);
>
> i think this is a little obfuscated
>
> what i meant was more along the lines of:
>
> do{
> for (i = 0; i < 7; i++)
> ac->che_drc.exclude_mask[i+X] = get_bits1(gb);
> X+= 7;
> }while(get_bits1(gb));
>
> (note this likely is not correct, its just to show what i meant)
See attached. I agree it's much more readable.
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20080730-refactor_excluded_channels.diff
Type: text/x-diff
Size: 1813 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080730/c0180689/attachment.diff>
More information about the ffmpeg-devel
mailing list