]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - wmadec_filter.c
NEWS update.
[paraslash.git] / wmadec_filter.c
index a03463d465d64e06f47f6a6b8fd37e701bbb138b..fdf3da91c44e8b7b5acd6920cbd8175c838ec30a 100644 (file)
@@ -290,13 +290,12 @@ static int wma_init(struct private_wmadec_data *pwd)
                return -E_WMA_BAD_PARAMS;
 
        /* compute MDCT block size */
                return -E_WMA_BAD_PARAMS;
 
        /* compute MDCT block size */
-       if (ahi->sample_rate <= 16000) {
+       if (ahi->sample_rate <= 16000)
                pwd->frame_len_bits = 9;
                pwd->frame_len_bits = 9;
-       } else if (ahi->sample_rate <= 22050) {
+       else if (ahi->sample_rate <= 22050)
                pwd->frame_len_bits = 10;
                pwd->frame_len_bits = 10;
-       } else {
+       else
                pwd->frame_len_bits = 11;
                pwd->frame_len_bits = 11;
-       }
        pwd->frame_len = 1 << pwd->frame_len_bits;
        if (pwd->use_variable_block_len) {
                int nb_max, nb;
        pwd->frame_len = 1 << pwd->frame_len_bits;
        if (pwd->use_variable_block_len) {
                int nb_max, nb;
@@ -353,24 +352,22 @@ static int wma_init(struct private_wmadec_data *pwd)
                        high_freq = high_freq * 0.5;
                else
                        high_freq = high_freq * 0.3;
                        high_freq = high_freq * 0.5;
                else
                        high_freq = high_freq * 0.3;
-       } else if (sample_rate1 == 11025) {
+       } else if (sample_rate1 == 11025)
                high_freq = high_freq * 0.7;
                high_freq = high_freq * 0.7;
-       else if (sample_rate1 == 8000) {
-               if (bps <= 0.625) {
+       else if (sample_rate1 == 8000) {
+               if (bps <= 0.625)
                        high_freq = high_freq * 0.5;
                        high_freq = high_freq * 0.5;
-               } else if (bps > 0.75) {
+               else if (bps > 0.75)
                        pwd->use_noise_coding = 0;
                        pwd->use_noise_coding = 0;
-               } else {
+               else
                        high_freq = high_freq * 0.65;
                        high_freq = high_freq * 0.65;
-               }
        } else {
        } else {
-               if (bps >= 0.8) {
+               if (bps >= 0.8)
                        high_freq = high_freq * 0.75;
                        high_freq = high_freq * 0.75;
-               } else if (bps >= 0.6) {
+               else if (bps >= 0.6)
                        high_freq = high_freq * 0.6;
                        high_freq = high_freq * 0.6;
-               } else {
+               else
                        high_freq = high_freq * 0.5;
                        high_freq = high_freq * 0.5;
-               }
        }
        PARA_INFO_LOG("channels=%d sample_rate=%d "
                "bitrate=%d block_align=%d\n",
        }
        PARA_INFO_LOG("channels=%d sample_rate=%d "
                "bitrate=%d block_align=%d\n",
@@ -1076,7 +1073,6 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data,
 {
        int ret;
        int16_t *samples;
 {
        int ret;
        int16_t *samples;
-       static int frame_count;
 
        if (buf_size == 0) {
                pwd->last_superframe_len = 0;
 
        if (buf_size == 0) {
                pwd->last_superframe_len = 0;
@@ -1130,7 +1126,6 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data,
                        ret = wma_decode_frame(pwd, samples);
                        if (ret < 0)
                                goto fail;
                        ret = wma_decode_frame(pwd, samples);
                        if (ret < 0)
                                goto fail;
-                       frame_count++;
                        samples += pwd->ahi.channels * pwd->frame_len;
                }
 
                        samples += pwd->ahi.channels * pwd->frame_len;
                }
 
@@ -1147,7 +1142,6 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data,
                        ret = wma_decode_frame(pwd, samples);
                        if (ret < 0)
                                goto fail;
                        ret = wma_decode_frame(pwd, samples);
                        if (ret < 0)
                                goto fail;
-                       frame_count++;
                        samples += pwd->ahi.channels * pwd->frame_len;
                }
 
                        samples += pwd->ahi.channels * pwd->frame_len;
                }
 
@@ -1171,12 +1165,10 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data,
                ret = wma_decode_frame(pwd, samples);
                if (ret < 0)
                        goto fail;
                ret = wma_decode_frame(pwd, samples);
                if (ret < 0)
                        goto fail;
-               frame_count++;
                samples += pwd->ahi.channels * pwd->frame_len;
        }
                samples += pwd->ahi.channels * pwd->frame_len;
        }
-       PARA_DEBUG_LOG("frame_count: %d frame_len: %d, block_len: %d, "
-               "outbytes: %zd, eaten: %d\n",
-               frame_count, pwd->frame_len, pwd->block_len,
+       PARA_DEBUG_LOG("frame_len: %d, block_len: %d, outbytes: %zd, eaten: %d\n",
+               pwd->frame_len, pwd->block_len,
                (int8_t *) samples - (int8_t *) data, pwd->ahi.block_align);
        *data_size = (int8_t *)samples - (int8_t *)data;
        return pwd->ahi.block_align;
                (int8_t *) samples - (int8_t *) data, pwd->ahi.block_align);
        *data_size = (int8_t *)samples - (int8_t *)data;
        return pwd->ahi.block_align;