[libav-devel] [PATCH 1/2] wma: cosmetics: Fix coding style inconsistencies

Diego Biurrun diego at biurrun.de
Tue Sep 2 23:50:59 CEST 2014


On Tue, Sep 02, 2014 at 03:28:50PM -0400, Gabriel Dume wrote:
> --- a/libavcodec/wma.c
> +++ b/libavcodec/wma.c
> @@ -428,23 +418,23 @@ unsigned int ff_wma_get_large_val(GetBitContext* gb)
> -int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb,
> -                            VLC *vlc,
> -                            const float *level_table, const uint16_t *run_table,
> -                            int version, WMACoef *ptr, int offset,
> -                            int num_coefs, int block_len, int frame_len_bits,
> +int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb,
> +                            VLC *vlc,const float *level_table,
> +                            const uint16_t *run_table, int version,
> +                            WMACoef *ptr, int offset, int num_coefs,
> +                            int block_len, int frame_len_bits,
>                              int coef_nb_bits)

You reformatted the declaration here, but

> --- a/libavcodec/wma.h
> +++ b/libavcodec/wma.h
> @@ -145,11 +145,11 @@ extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16];
>  int ff_wma_total_gain_to_bits(int total_gain);
>  int ff_wma_end(AVCodecContext *avctx);
> -unsigned int ff_wma_get_large_val(GetBitContext* gb);
> -int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb,
> +unsigned int ff_wma_get_large_val(GetBitContext *gb);
> +int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb,
>                              VLC *vlc,
>                              const float *level_table, const uint16_t *run_table,
>                              int version, WMACoef *ptr, int offset,

not here ..

> @@ -51,7 +51,7 @@
>  
>  //FIXME should be in wmadec
>  #define VLCBITS 9

space after //

> --- a/libavcodec/wmadec.c
> +++ b/libavcodec/wmadec.c
>              if (s->use_noise_coding) {
>                  mult1 = mult;
>                  /* very low freqs : noise */
> -                for(i = 0;i < s->coefs_start; i++) {
> +                for (i = 0;i < s->coefs_start; i++) {

space after ;

> @@ -662,42 +665,41 @@ static int wma_decode_block(WMACodecContext *s)
> -                n = s->block_len - s->coefs_end[bsize];
> -                mult1 = mult * exponents[((-1<<bsize))>>esize];
> -                for(i = 0; i < n; i++) {
> +                n     = s->block_len - s->coefs_end[bsize];
> +                mult1 = mult * exponents[((-1 << bsize)) >> esize];
> +                for (i = 0; i < n; i++) {
>                      *coefs++ = s->noise_table[s->noise_index] * mult1;
>                      s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);

= could be aligned here.

> --- a/libavcodec/wmaenc.c
> +++ b/libavcodec/wmaenc.c
> @@ -115,20 +115,21 @@ static void apply_window_and_mdct(AVCodecContext * avctx, const AVFrame *frame)
> +
> +    // FIXME remove duplication relative to decoder
> +    if (s->use_variable_block_len)
>          assert(0); //FIXME not implemented

space after //


Patch LGTM, will push with these nits fixed.

Diego


More information about the libav-devel mailing list