On Wed, Oct 26, 2011 at 12:16:19PM -0400, Justin Ruggles wrote:
> ---
>  libavcodec/mpegaudiodec.c |  867 
> ++++++++++++++++++++++-----------------------
>  1 files changed, 432 insertions(+), 435 deletions(-)
> 
> diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
> index 3a90bc9..bd4b633 100644
> --- a/libavcodec/mpegaudiodec.c
> +++ b/libavcodec/mpegaudiodec.c
> @@ -21,7 +21,7 @@
>  
>  /**
>   * @file
> - * MPEG Audio decoder.
> + * MPEG Audio decoder
>   */
>  
>  #include "libavutil/audioconvert.h"
> @@ -63,7 +63,7 @@ typedef struct GranuleDef {
>  
>  typedef struct MPADecodeContext {
>      MPA_DECODE_HEADER
> -    uint8_t last_buf[2*BACKSTEP_SIZE + EXTRABYTES];
> +    uint8_t last_buf[2 * BACKSTEP_SIZE + EXTRABYTES];
>      int last_buf_size;
>      /* next header (used in free format parsing) */
>      uint32_t free_format_next_header;
> @@ -92,7 +92,7 @@ typedef struct MPADecodeContext {
>  #   define OUT_FMT AV_SAMPLE_FMT_FLT
>  #else
>  #   define SHR(a,b)       ((a)>>(b))
> -/* WARNING: only correct for posititive numbers */
> +/* WARNING: only correct for positive numbers */
>  #   define FIXR_OLD(a)    ((int)((a) * FRAC_ONE + 0.5))
>  #   define FIXR(a)        ((int)((a) * FRAC_ONE + 0.5))
>  #   define FIXHR(a)       ((int)((a) * (1LL<<32) + 0.5))
> @@ -112,18 +112,16 @@ typedef struct MPADecodeContext {
>  /* vlc structure for decoding layer 3 huffman tables */
>  static VLC huff_vlc[16];
>  static VLC_TYPE huff_vlc_tables[
> -  0+128+128+128+130+128+154+166+
> -  142+204+190+170+542+460+662+414
> +    0+ 128+ 128+ 128+ 130+ 128+ 154+ 166+
> +  142+ 204+ 190+ 170+ 542+ 460+ 662+ 414

a space before plus would be nice too

>    ][2];
>  static const int huff_vlc_tables_sizes[16] = {
> -  0, 128, 128, 128, 130, 128, 154, 166,
> +    0, 128, 128, 128, 130, 128, 154, 166,
>    142, 204, 190, 170, 542, 460, 662, 414
>  };
>  static VLC huff_quad_vlc[2];
> -static VLC_TYPE huff_quad_vlc_tables[128+16][2];
> -static const int huff_quad_vlc_tables_sizes[2] = {
> -  128, 16
> -};
> +static VLC_TYPE  huff_quad_vlc_tables[128+16][2];
> +static const int huff_quad_vlc_tables_sizes[2] = { 128, 16 };
>  /* computed from band_size_long */
>  static uint16_t band_index_long[9][23];
>  #include "mpegaudio_tablegen.h"
[...]
> @@ -1577,39 +1573,39 @@ static int mp_decode_layer3(MPADecodeContext *s)
>                  if (g->block_type == 2) {
>                      n = g->switch_point ? 17 : 18;
>                      j = 0;
> -                    if(slen1){
> -                        for(i=0;i<n;i++)
> +                    if (slen1) {
> +                        for (i = 0; i < n; i++)
>                              g->scale_factors[j++] = get_bits(&s->gb, slen1);
> -                    }else{
> -                        for(i=0;i<n;i++)
> +                    } else {
> +                        for (i = 0; i < n; i++)
>                              g->scale_factors[j++] = 0;
>                      }
> -                    if(slen2){
> -                        for(i=0;i<18;i++)
> +                    if (slen2) {
> +                        for (i = 0; i < 18; i++)
>                              g->scale_factors[j++] = get_bits(&s->gb, slen2);
> -                        for(i=0;i<3;i++)
> +                        for (i = 0; i < 3; i++)
>                              g->scale_factors[j++] = 0;
> -                    }else{
> -                        for(i=0;i<21;i++)
> +                    } else {
> +                        for (i = 0; i < 21; i++)
>                              g->scale_factors[j++] = 0;
>                      }
>                  } else {
>                      sc = s->granules[ch][0].scale_factors;
> -                    j = 0;
> -                    for(k=0;k<4;k++) {
> -                        n = (k == 0 ? 6 : 5);
> +                    j  = 0;

this one change is uncalled for

> +                    for (k = 0; k < 4; k++) {
> +                        n = k == 0 ? 6 : 5;
>                          if ((g->scfsi & (0x8 >> k)) == 0) {
>                              slen = (k < 2) ? slen1 : slen2;
> -                            if(slen){
> -                                for(i=0;i<n;i++)
> +                            if (slen) {
> +                                for (i = 0; i < n; i++)
>                                      g->scale_factors[j++] = get_bits(&s->gb, 
> slen);
> -                            }else{
> -                                for(i=0;i<n;i++)
> +                            } else {
> +                                for (i = 0; i < n; i++)
>                                      g->scale_factors[j++] = 0;
>                              }
>                          } else {
>                              /* simply copy from last granule */
> -                            for(i=0;i<n;i++) {
> +                            for (i = 0; i < n; i++) {
>                                  g->scale_factors[j] = sc[j];
>                                  j++;
>                              }
[...]
> @@ -1903,17 +1897,20 @@ typedef struct MP3On4DecodeContext {
>  #include "mpeg4audio.h"
>  
>  /* Next 3 arrays are indexed by channel config number (passed via codecdata) 
> */
> -static const uint8_t mp3Frames[8] = {0,1,1,2,3,3,4,5};   /* number of mp3 
> decoder instances */
> +
> +/* number of mp3 decoder instances */
> +static const uint8_t mp3Frames[8] = { 0,1,1,2,3,3,4,5 };
> +
>  /* offsets into output buffer, assume output order is FL FR C LFE BL BR SL 
> SR */
>  static const uint8_t chan_offset[8][5] = {
> -    {0},
> -    {0},            // C
> -    {0},            // FLR
> -    {2,0},          // C FLR
> -    {2,0,3},        // C FLR BS
> -    {2,0,3},        // C FLR BLRS
> -    {2,0,4,3},      // C FLR BLRS LFE
> -    {2,0,6,4,3},    // C FLR BLRS BLR LFE
> +    { 0         },
> +    { 0         },  // C
> +    { 0         },  // FLR
> +    { 2,0       },  // C FLR
> +    { 2,0,3     },  // C FLR BS
> +    { 2,0,3     },  // C FLR BLRS
> +    { 2,0,4,3   },  // C FLR BLRS LFE
> +    { 2,0,6,4,3 },  // C FLR BLRS BLR LFE

some spaces after commas wouldn't hurt either

And thanks for doing the task Diego was too lazy or distracted to undertake.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to