[FFmpeg-devel] [PATCH] updated LGPL AC-3 decoder

Diego Biurrun diego
Fri May 4 21:29:33 CEST 2007


On Thu, May 03, 2007 at 12:42:09AM -0400, Justin Ruggles wrote:
> 
> Here is an update of the AC-3 decoder patch.  I've included most of
> Michael's suggestions.  Also, the downmixing is much simpler now.
> 
> --- libavcodec/ac3dec.c	(revision 0)
> +++ libavcodec/ac3dec.c	(revision 0)
> @@ -0,0 +1,1112 @@
> +/*
> + * AC-3 Audio Decoder.
> + * This code was developed as part of the Google Summer of Code 2006 Program.
> + *
> + * Copyright (c) 2006 Kartikey Mahendra BHATT (bhattkm at gmail dot com)
> + * Copyright (c) 2007 Justin Ruggles
> + *
> + * This file is part of FFmpeg.
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */

wrong license header

> +static void uncouple_channels(AC3DecodeContext *ctx)
> +{
> +
> +    for(i=ctx->cplstrtmant,bnd=0; i<ctx->cplendmant; bnd++) {
> +        do {
> +            for(j=0; j<12; j++) {
> +                for(ch=0; ch<ctx->nfchans; ch++) {
> +                if(ctx->chincpl[ch]) {
> +                    ctx->transform_coeffs[ch][i] = ctx->cpl_coeffs[i] *
> +                                                   ctx->cplco[ch][bnd];

May I suggest adding a space between for/if and the opening parentheses?
It makes things much more readable IMO.

Diego




More information about the ffmpeg-devel mailing list