On Thu, Sep 04, 2014 at 06:22:13PM -0400, Gabriel Dume wrote:
> --- a/libavcodec/dca_parser.c
> +++ b/libavcodec/dca_parser.c
> @@ -51,9 +51,9 @@ static int dca_find_frame_end(DCAParseContext * pc1, const 
> uint8_t * buf,
>      ParseContext *pc = &pc1->pc;
>  
>      start_found = pc->frame_start_found;
> -    state = pc->state;
> +    state       = pc->state;
>  
> -    i = 0;
> +    i           = 0;
>      if (!start_found) {
>          for (i = 0; i < buf_size; i++) {
>              state = (state << 8) | buf[i];

I'd skip aligning the assignment to i.

> @@ -88,15 +88,15 @@ static int dca_find_frame_end(DCAParseContext * pc1, 
> const uint8_t * buf,
> -static av_cold int dca_parse_init(AVCodecParserContext * s)
> +static av_cold int dca_parse_init(AVCodecParserContext *s)
>  {
>      DCAParseContext *pc1 = s->priv_data;
>  
> -    pc1->lastmarker = 0;
> +    pc1->lastmarker      = 0;

same, no relation between the assignments

> @@ -134,18 +134,18 @@ static int dca_parse_params(const uint8_t *buf, int 
> buf_size, int *duration,
>  
> -static int dca_parse(AVCodecParserContext * s,
> -                     AVCodecContext * avctx,
> -                     const uint8_t ** poutbuf, int *poutbuf_size,
> -                     const uint8_t * buf, int buf_size)
> +static int dca_parse(AVCodecParserContext *s,
> +                     AVCodecContext *avctx,
> +                     const uint8_t **poutbuf, int *poutbuf_size,
> +                     const uint8_t *buf, int buf_size)

static int dca_parse(AVCodecParserContext *s, AVCodecContext *avctx,
                     const uint8_t **poutbuf, int *poutbuf_size,
                     const uint8_t *buf, int buf_size)

> --- a/libavcodec/dcadata.h
> +++ b/libavcodec/dcadata.h
> @@ -38,13 +37,11 @@ static const uint32_t dca_bit_rates[32] =
>      2048000, 3072000, 3840000, 1/*open*/, 2/*variable*/, 3/*lossless*/

Some spaces around the comment markers would not hurt.

> @@ -4218,8 +4214,7 @@ static const float lossless_quant_d[32] = {
>  
> -DECLARE_ALIGNED(8, static const int8_t, high_freq_vq)[1024][32] =
> -{
> +DECLARE_ALIGNED(8, static const int8_t, high_freq_vq)[1024][32] = {
>    {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
>       0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
>    { -4, -2,  2,  1,-16,-10,  1,  3,  1,  0,  6,  1, -3,  7,  1,-22,

Some spaces after comma seem missing, if you feel motivated.

> @@ -6273,1042 +6268,1039 @@ DECLARE_ALIGNED(8, static const int8_t, 
> high_freq_vq)[1024][32] =
>  /* FIR filter coefficients, they can be cut on half and maybe use float 
> instead of double*/

space before *

> --- a/libavcodec/dcadec.c
> +++ b/libavcodec/dcadec.c
> @@ -429,7 +429,7 @@ static av_cold void dca_init_vlcs(void)
>                   bitalloc_12_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
>      }
>      dca_scalefactor.offset = -64;
> -    dca_scalefactor.wrap = 2;
> +    dca_scalefactor.wrap   = 2;
>      for (i = 0; i < 5; i++) {
>          dca_scalefactor.vlc[i].table = &dca_table[dca_vlc_offs[i + 5]];
>          dca_scalefactor.vlc[i].table_allocated = dca_vlc_offs[i + 6] - 
> dca_vlc_offs[i + 5];

Align the =.

> @@ -438,7 +438,7 @@ static av_cold void dca_init_vlcs(void)
>      }
>      dca_tmode.offset = 0;
> -    dca_tmode.wrap = 1;
> +    dca_tmode.wrap   = 1;
>      for (i = 0; i < 4; i++) {
>          dca_tmode.vlc[i].table = &dca_table[dca_vlc_offs[i + 10]];
>          dca_tmode.vlc[i].table_allocated = dca_vlc_offs[i + 11] - 
> dca_vlc_offs[i + 10];

same

> @@ -517,10 +517,8 @@ static int dca_parse_audio_coding_header(DCAContext *s, 
> int base_channel)
>  
> -    if (s->crc_present) {
> -        /* Audio header CRC check */
> -        get_bits(&s->gb, 16);
> -    }
> +    if (s->crc_present)
> +        get_bits(&s->gb, 16); /* Audio header CRC check */

No need to move the comment IMO.

> @@ -694,10 +691,8 @@ static int dca_subframe_header(DCAContext *s, int 
> base_channel, int block_index)
>      /* Get prediction codebook */
>      for (j = base_channel; j < s->prim_channels; j++) {
>          for (k = 0; k < s->subband_activity[j]; k++) {
> -            if (s->prediction_mode[j][k] > 0) {
> -                /* (Prediction coefficient VQ address) */
> -                s->prediction_vq[j][k] = get_bits(&s->gb, 12);
> -            }
> +            if (s->prediction_mode[j][k] > 0)
> +                s->prediction_vq[j][k] = get_bits(&s->gb, 12); /* 
> (Prediction coefficient VQ address) */

same

> @@ -712,10 +707,8 @@ static int dca_subframe_header(DCAContext *s, int 
> base_channel, int block_index)
> -            } else {
> -                s->bitalloc[j][k] =
> -                    get_bitalloc(&s->gb, &dca_bitalloc_index, 
> s->bitalloc_huffman[j]);
> -            }
> +            } else
> +                s->bitalloc[j][k] = get_bitalloc(&s->gb, 
> &dca_bitalloc_index, s->bitalloc_huffman[j]);

I'd keep the line short.

> --- a/libavcodec/dcadsp.c
> +++ b/libavcodec/dcadsp.c
> @@ -103,10 +103,12 @@ static void dca_lfe_fir1_c(float *out, const float *in, 
> const float *coefs)
>  
>  av_cold void ff_dcadsp_init(DCADSPContext *s)
>  {
> -    s->lfe_fir[0] = dca_lfe_fir0_c;
> -    s->lfe_fir[1] = dca_lfe_fir1_c;
> +    s->lfe_fir[0]      = dca_lfe_fir0_c;
> +    s->lfe_fir[1]      = dca_lfe_fir1_c;
>      s->qmf_32_subbands = dca_qmf_32_subbands;
> -    s->decode_hf = decode_hf_c;
> -    if (ARCH_ARM) ff_dcadsp_init_arm(s);
> -    if (ARCH_X86) ff_dcadsp_init_x86(s);
> +    s->decode_hf       = decode_hf_c;
> +    if (ARCH_ARM)
> +        ff_dcadsp_init_arm(s);
> +    if (ARCH_X86)
> +        ff_dcadsp_init_x86(s);

Please add an empty line before the ARCH_FOO block while you're at it.

> --- a/libavcodec/dcahuff.h
> +++ b/libavcodec/dcahuff.h
> @@ -29,632 +29,563 @@
>  #define BITALLOC_12_COUNT 5
>  #define BITALLOC_12_VLC_BITS 9
>  static const uint8_t bitalloc_12_vlc_bits[BITALLOC_12_COUNT] = {
> -  9, 7, 7, 9, 9
> +    9, 7, 7, 9, 9
>  };
>  static const uint16_t bitalloc_12_codes[BITALLOC_12_COUNT][12] = {

Add an empty line between tables.

> -  {
> -    0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE,
> -    0x01FB, 0x01FA, 0x01F9, 0x01F8,
> -  },
> +    {
> +        0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE,
> +        0x01FB, 0x01FA, 0x01F9, 0x01F8,
> +    },

    { 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE,
      0x01FB, 0x01FA, 0x01F9, 0x01F8, },


same below

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to