forked from len0rd/rockbox
Reformat and code police (tabs, trailing whitespace, annoying overuse of parentheses, etc.) in libmpeg2 so I can stomach working on it. Don't call IDCT functions through pointers - I don't feel like extracting that change just for relevance sake.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15892 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5886efabf5
commit
2b5f979d75
10 changed files with 1772 additions and 1098 deletions
|
|
@ -21,35 +21,35 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define GETWORD(bit_buf,shift,bit_ptr) \
|
||||
do { \
|
||||
bit_buf |= ((bit_ptr[0] << 8) | bit_ptr[1]) << (shift); \
|
||||
bit_ptr += 2; \
|
||||
#define GETWORD(bit_buf, shift, bit_ptr) \
|
||||
do { \
|
||||
bit_buf |= ((bit_ptr[0] << 8) | bit_ptr[1]) << (shift); \
|
||||
bit_ptr += 2; \
|
||||
} while (0)
|
||||
|
||||
static inline void bitstream_init (mpeg2_decoder_t * decoder,
|
||||
const uint8_t * start)
|
||||
const uint8_t * start)
|
||||
{
|
||||
decoder->bitstream_buf =
|
||||
(start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3];
|
||||
(start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3];
|
||||
decoder->bitstream_ptr = start + 4;
|
||||
decoder->bitstream_bits = -16;
|
||||
}
|
||||
|
||||
/* make sure that there are at least 16 valid bits in bit_buf */
|
||||
#define NEEDBITS(bit_buf,bits,bit_ptr) \
|
||||
do { \
|
||||
if (unlikely (bits > 0)) { \
|
||||
GETWORD (bit_buf, bits, bit_ptr); \
|
||||
bits -= 16; \
|
||||
} \
|
||||
#define NEEDBITS(bit_buf, bits, bit_ptr) \
|
||||
do { \
|
||||
if (unlikely (bits > 0)) { \
|
||||
GETWORD (bit_buf, bits, bit_ptr); \
|
||||
bits -= 16; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* remove num valid bits from bit_buf */
|
||||
#define DUMPBITS(bit_buf,bits,num) \
|
||||
do { \
|
||||
bit_buf <<= (num); \
|
||||
bits += (num); \
|
||||
#define DUMPBITS(bit_buf, bits, num) \
|
||||
do { \
|
||||
bit_buf <<= (num); \
|
||||
bits += (num); \
|
||||
} while (0)
|
||||
|
||||
/* take num bits from the high part of bit_buf and zero extend them */
|
||||
|
|
@ -124,7 +124,7 @@ static const MBtab MB_B [] ICONST_ATTR = {
|
|||
{0, 0}, {INTRA|QUANT, 6},
|
||||
{BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6},
|
||||
{INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5},
|
||||
{INTRA, 5}, {INTRA, 5},
|
||||
{INTRA, 5}, {INTRA, 5},
|
||||
{FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4},
|
||||
{FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4},
|
||||
{BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3},
|
||||
|
|
@ -301,7 +301,7 @@ static const DCTtab DCT_B14_8 [] ICONST_ATTR = {
|
|||
};
|
||||
|
||||
static const DCTtab DCT_B14AC_5 [] ICONST_ATTR = {
|
||||
{ 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
|
||||
{ 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
|
||||
{ 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4},
|
||||
{ 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
|
||||
{129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2},
|
||||
|
|
@ -311,7 +311,7 @@ static const DCTtab DCT_B14AC_5 [] ICONST_ATTR = {
|
|||
};
|
||||
|
||||
static const DCTtab DCT_B14DC_5 [] ICONST_ATTR = {
|
||||
{ 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
|
||||
{ 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
|
||||
{ 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4},
|
||||
{ 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
|
||||
{ 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1},
|
||||
|
|
@ -393,7 +393,7 @@ static const DCTtab DCT_B15_8 [] ICONST_ATTR = {
|
|||
|
||||
|
||||
static const MBAtab MBA_5 [] ICONST_ATTR = {
|
||||
{6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4},
|
||||
{6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4},
|
||||
{2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
|
||||
{0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1},
|
||||
{0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue