Revision fd9451c6 libavcodec/mpegaudiodec.c

View differences:

libavcodec/mpegaudiodec.c
1318 1318
    return 3 * 12;
1319 1319
}
1320 1320

  
1321
//FIXME optimze this shit
1322
static inline void lsf_sf_expand(int *slen,
1321
#define SPLIT(dst,sf,n)\
1322
    if(n==3){\
1323
        int m= (sf*171)>>9;\
1324
        dst= sf - 3*m;\
1325
        sf=m;\
1326
    }else if(n==4){\
1327
        dst= sf&3;\
1328
        sf>>=2;\
1329
    }else if(n==5){\
1330
        int m= (sf*205)>>10;\
1331
        dst= sf - 5*m;\
1332
        sf=m;\
1333
    }else if(n==6){\
1334
        int m= (sf*171)>>10;\
1335
        dst= sf - 6*m;\
1336
        sf=m;\
1337
    }else{\
1338
        dst=0;\
1339
    }
1340

  
1341
static av_always_inline void lsf_sf_expand(int *slen,
1323 1342
                                 int sf, int n1, int n2, int n3)
1324 1343
{
1325
    if (n3) {
1326
        slen[3] = sf % n3;
1327
        sf /= n3;
1328
    } else {
1329
        slen[3] = 0;
1330
    }
1331
    if (n2) {
1332
        slen[2] = sf % n2;
1333
        sf /= n2;
1334
    } else {
1335
        slen[2] = 0;
1336
    }
1337
    slen[1] = sf % n1;
1338
    sf /= n1;
1344
    SPLIT(slen[3], sf, n3)
1345
    SPLIT(slen[2], sf, n2)
1346
    SPLIT(slen[1], sf, n1)
1339 1347
    slen[0] = sf;
1340 1348
}
1341 1349

  

Also available in: Unified diff