On Mon, Sep 01, 2014 at 03:19:00PM -0400, Gabriel Dume wrote:
> --- a/libavcodec/wma.c
> +++ b/libavcodec/wma.c
> @@ -78,19 +78,20 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
> int sample_rate1;
> int coef_vlc_table;
>
> - if ( avctx->sample_rate <= 0 || avctx->sample_rate > 50000
> - || avctx->channels <= 0 || avctx->channels > 2
> - || avctx->bit_rate <= 0)
> + if (avctx->sample_rate <= 0 ||
> + avctx->sample_rate > 50000 ||
> + avctx->channels <= 0 ||
> + avctx->channels > 2 ||
> + avctx->bit_rate <= 0)
The more compact style on three lines was OK before, just adjust the
placement of the ||.
> @@ -341,14 +332,13 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int
> flags2)
> - s->coef_vlcs[0]= &coef_vlcs[coef_vlc_table * 2 ];
> - s->coef_vlcs[1]= &coef_vlcs[coef_vlc_table * 2 + 1];
> + s->coef_vlcs[0] = &coef_vlcs[coef_vlc_table * 2 ];
> + s->coef_vlcs[1] = &coef_vlcs[coef_vlc_table * 2 + 1];
Drop the spaces inside [].
> --- a/libavcodec/wmadata.h
> +++ b/libavcodec/wmadata.h
> @@ -1381,22 +1381,22 @@ static const uint16_t levels5[40] = {
>
> static const CoefVLCTable coef_vlcs[6] = {
> {
> - sizeof(coef0_huffbits), sizeof(levels0)/2, coef0_huffcodes,
> coef0_huffbits, levels0,
> + sizeof(coef0_huffbits), sizeof(levels0) / 2, coef0_huffcodes,
> coef0_huffbits, levels0,
> },
> {
> - sizeof(coef1_huffbits), sizeof(levels1)/2, coef1_huffcodes,
> coef1_huffbits, levels1,
> + sizeof(coef1_huffbits), sizeof(levels1) / 2, coef1_huffcodes,
> coef1_huffbits, levels1,
> },
> {
> - sizeof(coef2_huffbits), sizeof(levels2)/2, coef2_huffcodes,
> coef2_huffbits, levels2,
> + sizeof(coef2_huffbits), sizeof(levels2) / 2, coef2_huffcodes,
> coef2_huffbits, levels2,
> },
> {
> - sizeof(coef3_huffbits), sizeof(levels3)/2, coef3_huffcodes,
> coef3_huffbits, levels3,
> + sizeof(coef3_huffbits), sizeof(levels3) / 2, coef3_huffcodes,
> coef3_huffbits, levels3,
> },
> {
> - sizeof(coef4_huffbits), sizeof(levels4)/2, coef4_huffcodes,
> coef4_huffbits, levels4,
> + sizeof(coef4_huffbits), sizeof(levels4) / 2, coef4_huffcodes,
> coef4_huffbits, levels4,
> },
> {
> - sizeof(coef5_huffbits), sizeof(levels5)/2, coef5_huffcodes,
> coef5_huffbits, levels5,
> + sizeof(coef5_huffbits), sizeof(levels5) / 2, coef5_huffcodes,
> coef5_huffbits, levels5,
> },
> };
>
static const CoefVLCTable coef_vlcs[6] = {
{ sizeof(coef0_huffbits), sizeof(levels0) / 2, coef0_huffcodes,
coef0_huffbits, levels0, },
{ sizeof(coef1_huffbits), sizeof(levels1) / 2, coef1_huffcodes,
coef1_huffbits, levels1, },
{ sizeof(coef2_huffbits), sizeof(levels2) / 2, coef2_huffcodes,
coef2_huffbits, levels2, },
{ sizeof(coef3_huffbits), sizeof(levels3) / 2, coef3_huffcodes,
coef3_huffbits, levels3, },
{ sizeof(coef4_huffbits), sizeof(levels4) / 2, coef4_huffcodes,
coef4_huffbits, levels4, },
{ sizeof(coef5_huffbits), sizeof(levels5) / 2, coef5_huffcodes,
coef5_huffbits, levels5, },
};
> --- a/libavcodec/wmadec.c
> +++ b/libavcodec/wmadec.c
> @@ -592,12 +596,11 @@ static int wma_decode_block(WMACodecContext *s)
>
> /* normalize */
> {
> - int n4 = s->block_len / 2;
> - mdct_norm = 1.0 / (float)n4;
> - if (s->version == 1) {
> + int n4 = s->block_len / 2;
> + mdct_norm = 1.0 / (float) n4;
> + if (s->version == 1)
> mdct_norm *= sqrt(n4);
> - }
> - }
> + }
Indentation for the last } is off.
> @@ -607,16 +610,16 @@ static int wma_decode_block(WMACodecContext *s)
> 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++) {
> *coefs++ = s->noise_table[s->noise_index] *
> exponents[i<<bsize>>esize] * mult1;
Indentation is off on the last line.
> @@ -628,17 +631,17 @@ static int wma_decode_block(WMACodecContext *s)
> exponents = s->exponents[ch] +
> (s->high_band_start[bsize]<<bsize>>esize);
same here
> last_high_band = 0; /* avoid warning */
> - for(j=0;j<n1;j++) {
> + for (j = 0; j < n1; j++) {
> n = s->exponent_high_bands[s->frame_len_bits -
> s->block_len_bits][j];
and here
> - for(i = 0;i < n; i++) {
> - v = exponents[i<<bsize>>esize];
> + for (i = 0; i < n; i++) {
> + v = exponents[i<<bsize>>esize];
spaces around >>
> @@ -647,7 +650,7 @@ static int wma_decode_block(WMACodecContext *s)
>
> /* main freqs and high freqs */
> exponents = s->exponents[ch] +
> (s->coefs_start<<bsize>>esize);
same
> @@ -682,22 +685,22 @@ static int wma_decode_block(WMACodecContext *s)
> /* very high freqs : noise */
> - n = s->block_len - s->coefs_end[bsize];
> + n = s->block_len - s->coefs_end[bsize];
> mult1 = mult * exponents[((-1<<bsize))>>esize];
more
> n = nb_coefs[ch];
> - for(i = 0;i < n; i++) {
> + for (i = 0; i < n; i++) {
> *coefs++ = coefs1[i] * exponents[i<<bsize>>esize] * mult;
> }
more
useless {}
> @@ -922,8 +923,8 @@ static av_cold void flush(AVCodecContext *avctx)
>
> - s->last_bitoffset=
> - s->last_superframe_len= 0;
> + s->last_bitoffset =
> + s->last_superframe_len = 0;
Align the =.
> --- a/libavcodec/wmaenc.c
> +++ b/libavcodec/wmaenc.c
> @@ -79,32 +79,31 @@ static av_cold int encode_init(AVCodecContext *avctx)
> avctx->block_align = block_align;
> avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate /
> s->frame_len;
> - avctx->frame_size = avctx->delay = s->frame_len;
> + avctx->frame_size = avctx->delay = s->frame_len;
Break the double assignment into two lines.
> @@ -158,21 +159,29 @@ static void encode_exp_vlc(WMACodecContext *s, int ch,
> const int *exp_param){
>
> -static int encode_block(WMACodecContext *s, float
> (*src_coefs)[BLOCK_MAX_SIZE], int total_gain){
> +static int encode_block(WMACodecContext *s,
> + float (*src_coefs)[BLOCK_MAX_SIZE], int total_gain)
static int encode_block(WMACodecContext *s, float
(*src_coefs)[BLOCK_MAX_SIZE],
int total_gain)
> @@ -243,18 +249,18 @@ static int encode_block(WMACodecContext *s, float
> (*src_coefs)[BLOCK_MAX_SIZE],
> n = s->exponent_high_sizes[bsize];
> - for(i=0;i<n;i++) {
> + for (i = 0; i < n; i++) {
> put_bits(&s->pb, 1, s->high_band_coded[ch][i]= 0);
space before =
> @@ -274,69 +279,69 @@ static int encode_block(WMACodecContext *s, float
> (*src_coefs)[BLOCK_MAX_SIZE],
>
> -static int encode_frame(WMACodecContext *s, float
> (*src_coefs)[BLOCK_MAX_SIZE], uint8_t *buf, int buf_size, int total_gain){
> +static int encode_frame(WMACodecContext *s,
> + float (*src_coefs)[BLOCK_MAX_SIZE],
> + uint8_t *buf, int buf_size, int total_gain)
static int encode_frame(WMACodecContext *s, float
(*src_coefs)[BLOCK_MAX_SIZE],
uint8_t *buf, int buf_size, int total_gain)
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel