Revision cee4bb89 libavcodec/wma.c

View differences:

libavcodec/wma.c
62 62
    *pint_table   = int_table;
63 63
}
64 64

  
65
/**
66
 *@brief Get the samples per frame for this stream.
67
 *@param sample_rate output sample_rate
68
 *@param version wma version
69
 *@param decode_flags codec compression features
70
 *@return log2 of the number of output samples per frame
71
 */
72
int av_cold ff_wma_get_frame_len_bits(int sample_rate, int version,
73
                                      unsigned int decode_flags)
74
{
75

  
76
    int frame_len_bits;
77

  
78
    if (sample_rate <= 16000)
79
        frame_len_bits = 9;
80
    else if (sample_rate <= 22050 ||
81
             (sample_rate <= 32000 && version == 1))
82
        frame_len_bits = 10;
83
    else
84
        frame_len_bits = 11;
85

  
86
    return frame_len_bits;
87
}
88

  
65 89
int ff_wma_init(AVCodecContext *avctx, int flags2)
66 90
{
67 91
    WMACodecContext *s = avctx->priv_data;
......
90 114
    }
91 115

  
92 116
    /* compute MDCT block size */
93
    if (s->sample_rate <= 16000) {
94
        s->frame_len_bits = 9;
95
    } else if ( s->sample_rate <= 22050 ||
96
               (s->sample_rate <= 32000 && s->version == 1)) {
97
        s->frame_len_bits = 10;
98
    } else {
99
        s->frame_len_bits = 11;
100
    }
117
    s->frame_len_bits = ff_wma_get_frame_len_bits(s->sample_rate, s->version, 0);
118

  
101 119
    s->frame_len = 1 << s->frame_len_bits;
102 120
    if (s->use_variable_block_len) {
103 121
        int nb_max, nb;

Also available in: Unified diff