Mercurial > libavcodec.hg
comparison mpegaudiodec.c @ 11711:7ca3795af11b libavcodec
Do the same sign flip optimization to the low freq decoder.
as with the high freq 10-20 cycles faster
author | michael |
---|---|
date | Tue, 11 May 2010 21:31:54 +0000 |
parents | 8e3a3bc4fb24 |
children | fcb1d0addf28 |
comparison
equal
deleted
inserted
replaced
11710:8e3a3bc4fb24 | 11711:7ca3795af11b |
---|---|
1452 } | 1452 } |
1453 | 1453 |
1454 /* read huffcode and compute each couple */ | 1454 /* read huffcode and compute each couple */ |
1455 for(;j>0;j--) { | 1455 for(;j>0;j--) { |
1456 int exponent, x, y; | 1456 int exponent, x, y; |
1457 INTFLOAT v; | 1457 int v; |
1458 int pos= get_bits_count(&s->gb); | 1458 int pos= get_bits_count(&s->gb); |
1459 | 1459 |
1460 if (pos >= end_pos){ | 1460 if (pos >= end_pos){ |
1461 // av_log(NULL, AV_LOG_ERROR, "pos: %d %d %d %d\n", pos, end_pos, end_pos2, s_index); | 1461 // av_log(NULL, AV_LOG_ERROR, "pos: %d %d %d %d\n", pos, end_pos, end_pos2, s_index); |
1462 switch_buffer(s, &pos, &end_pos, &end_pos2); | 1462 switch_buffer(s, &pos, &end_pos, &end_pos2); |
1479 i, g->region_size[i] - j, x, y, exponent); | 1479 i, g->region_size[i] - j, x, y, exponent); |
1480 if(y&16){ | 1480 if(y&16){ |
1481 x = y >> 5; | 1481 x = y >> 5; |
1482 y = y & 0x0f; | 1482 y = y & 0x0f; |
1483 if (x < 15){ | 1483 if (x < 15){ |
1484 v = RENAME(expval_table)[ exponent ][ x ]; | 1484 READ_FLIP_SIGN(g->sb_hybrid+s_index, RENAME(expval_table)[ exponent ]+x) |
1485 // v = RENAME(expval_table)[ (exponent&3) ][ x ] >> FFMIN(0 - (exponent>>2), 31); | |
1486 }else{ | 1485 }else{ |
1487 x += get_bitsz(&s->gb, linbits); | 1486 x += get_bitsz(&s->gb, linbits); |
1488 v = l3_unscale(x, exponent); | 1487 v = l3_unscale(x, exponent); |
1488 if (get_bits1(&s->gb)) | |
1489 v = -v; | |
1490 g->sb_hybrid[s_index] = v; | |
1489 } | 1491 } |
1490 if (get_bits1(&s->gb)) | |
1491 v = -v; | |
1492 g->sb_hybrid[s_index] = v; | |
1493 if (y < 15){ | 1492 if (y < 15){ |
1494 v = RENAME(expval_table)[ exponent ][ y ]; | 1493 READ_FLIP_SIGN(g->sb_hybrid+s_index+1, RENAME(expval_table)[ exponent ]+y) |
1495 }else{ | 1494 }else{ |
1496 y += get_bitsz(&s->gb, linbits); | 1495 y += get_bitsz(&s->gb, linbits); |
1497 v = l3_unscale(y, exponent); | 1496 v = l3_unscale(y, exponent); |
1497 if (get_bits1(&s->gb)) | |
1498 v = -v; | |
1499 g->sb_hybrid[s_index+1] = v; | |
1498 } | 1500 } |
1499 if (get_bits1(&s->gb)) | |
1500 v = -v; | |
1501 g->sb_hybrid[s_index+1] = v; | |
1502 }else{ | 1501 }else{ |
1503 x = y >> 5; | 1502 x = y >> 5; |
1504 y = y & 0x0f; | 1503 y = y & 0x0f; |
1505 x += y; | 1504 x += y; |
1506 if (x < 15){ | 1505 if (x < 15){ |
1507 v = RENAME(expval_table)[ exponent ][ x ]; | 1506 READ_FLIP_SIGN(g->sb_hybrid+s_index+!!y, RENAME(expval_table)[ exponent ]+x) |
1508 }else{ | 1507 }else{ |
1509 x += get_bitsz(&s->gb, linbits); | 1508 x += get_bitsz(&s->gb, linbits); |
1510 v = l3_unscale(x, exponent); | 1509 v = l3_unscale(x, exponent); |
1510 if (get_bits1(&s->gb)) | |
1511 v = -v; | |
1512 g->sb_hybrid[s_index+!!y] = v; | |
1511 } | 1513 } |
1512 if (get_bits1(&s->gb)) | |
1513 v = -v; | |
1514 g->sb_hybrid[s_index+!!y] = v; | |
1515 g->sb_hybrid[s_index+ !y] = 0; | 1514 g->sb_hybrid[s_index+ !y] = 0; |
1516 } | 1515 } |
1517 s_index+=2; | 1516 s_index+=2; |
1518 } | 1517 } |
1519 } | 1518 } |