Revision 6b2636bb

View differences:

libavcodec/ac3enc.c
521 521
 */
522 522
static av_cold void exponent_init(AC3EncodeContext *s)
523 523
{
524
    int i;
525
    for (i = 73; i < 256; i++) {
526
        exponent_group_tab[0][i] = (i - 1) /  3;
527
        exponent_group_tab[1][i] = (i + 2) /  6;
528
        exponent_group_tab[2][i] = (i + 8) / 12;
524
    int expstr, i, grpsize;
525

  
526
    for (expstr = EXP_D15-1; expstr <= EXP_D45-1; expstr++) {
527
        grpsize = 3 << expstr;
528
        for (i = 73; i < 256; i++) {
529
            exponent_group_tab[expstr][i] = (i + grpsize - 4) / grpsize;
530
        }
529 531
    }
530 532
    /* LFE */
531 533
    exponent_group_tab[0][7] = 2;

Also available in: Unified diff