Revision 6f718471 libavcodec/ac3enc.c

View differences:

libavcodec/ac3enc.c
178 178
    int frame_bits;                         ///< all frame bits except exponents and mantissas
179 179
    int exponent_bits;                      ///< number of bits used for exponents
180 180

  
181
    /* mantissa encoding */
182
    int mant1_cnt, mant2_cnt, mant4_cnt;    ///< mantissa counts for bap=1,2,4
183
    uint16_t *qmant1_ptr, *qmant2_ptr, *qmant4_ptr; ///< mantissa pointers for bap=1,2,4
184

  
185 181
    SampleType **planar_samples;
186 182
    uint8_t *bap_buffer;
187 183
    uint8_t *bap1_buffer;
......
199 195
    DECLARE_ALIGNED(16, SampleType, windowed_samples)[AC3_WINDOW_SIZE];
200 196
} AC3EncodeContext;
201 197

  
198
typedef struct AC3Mant {
199
    uint16_t *qmant1_ptr, *qmant2_ptr, *qmant4_ptr; ///< mantissa pointers for bap=1,2,4
200
    int mant1_cnt, mant2_cnt, mant4_cnt;    ///< mantissa counts for bap=1,2,4
201
} AC3Mant;
202 202

  
203 203
#define CMIXLEV_NUM_OPTIONS 3
204 204
static const float cmixlev_options[CMIXLEV_NUM_OPTIONS] = {
......
1248 1248
/**
1249 1249
 * Quantize a set of mantissas for a single channel in a single block.
1250 1250
 */
1251
static void quantize_mantissas_blk_ch(AC3EncodeContext *s, int32_t *fixed_coef,
1251
static void quantize_mantissas_blk_ch(AC3Mant *s, int32_t *fixed_coef,
1252 1252
                                      uint8_t *exp,
1253 1253
                                      uint8_t *bap, uint16_t *qmant, int n)
1254 1254
{
......
1350 1350
    for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
1351 1351
        AC3Block *block = &s->blocks[blk];
1352 1352
        AC3Block *ref_block;
1353
        s->mant1_cnt  = s->mant2_cnt  = s->mant4_cnt  = 0;
1354
        s->qmant1_ptr = s->qmant2_ptr = s->qmant4_ptr = NULL;
1353
        AC3Mant m = { 0 };
1355 1354

  
1356 1355
        for (ch = 0; ch < s->channels; ch++) {
1357 1356
            ref_block = block->exp_ref_block[ch];
1358
            quantize_mantissas_blk_ch(s, block->fixed_coef[ch],
1357
            quantize_mantissas_blk_ch(&m, block->fixed_coef[ch],
1359 1358
                                      ref_block->exp[ch], ref_block->bap[ch],
1360 1359
                                      block->qmant[ch], s->nb_coefs[ch]);
1361 1360
        }

Also available in: Unified diff