Mercurial > mplayer.hg
comparison postproc/rgb2rgb_template.c @ 12395:b969547bb0b1
bigendian fix by (Romain Dolbeau <dolbeau at irisa dot fr>)
with #if defined(WORDS_BIGENDIAN) && (WORDS_BIGENDIAN == 1) -> #ifdef WORDS_BIGENDIAN by me
author | michael |
---|---|
date | Sun, 02 May 2004 14:26:28 +0000 |
parents | b5c106b694e4 |
children | 8953c51668e1 |
comparison
equal
deleted
inserted
replaced
12394:b3ff1a576b8c | 12395:b969547bb0b1 |
---|---|
1530 | 1530 |
1531 #else | 1531 #else |
1532 int i, *idst = (int32_t *) dst; | 1532 int i, *idst = (int32_t *) dst; |
1533 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; | 1533 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; |
1534 for(i = 0; i < chromWidth; i++){ | 1534 for(i = 0; i < chromWidth; i++){ |
1535 #ifdef WORDS_BIGENDIAN | |
1536 *idst++ = (yc[0] << 24)+ (uc[0] << 16) + | |
1537 (yc[1] << 8) + (vc[0] << 0); | |
1538 #else | |
1535 *idst++ = yc[0] + (uc[0] << 8) + | 1539 *idst++ = yc[0] + (uc[0] << 8) + |
1536 (yc[1] << 16) + (vc[0] << 24); | 1540 (yc[1] << 16) + (vc[0] << 24); |
1541 #endif | |
1537 yc += 2; | 1542 yc += 2; |
1538 uc++; | 1543 uc++; |
1539 vc++; | 1544 vc++; |
1540 } | 1545 } |
1541 #endif | 1546 #endif |
1632 | 1637 |
1633 #else | 1638 #else |
1634 int i, *idst = (int32_t *) dst; | 1639 int i, *idst = (int32_t *) dst; |
1635 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; | 1640 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; |
1636 for(i = 0; i < chromWidth; i++){ | 1641 for(i = 0; i < chromWidth; i++){ |
1642 #ifdef WORDS_BIGENDIAN | |
1643 *idst++ = (uc[0] << 24)+ (yc[0] << 16) + | |
1644 (vc[0] << 8) + (yc[1] << 0); | |
1645 #else | |
1637 *idst++ = uc[0] + (yc[0] << 8) + | 1646 *idst++ = uc[0] + (yc[0] << 8) + |
1638 (vc[0] << 16) + (yc[1] << 24); | 1647 (vc[0] << 16) + (yc[1] << 24); |
1648 #endif | |
1639 yc += 2; | 1649 yc += 2; |
1640 uc++; | 1650 uc++; |
1641 vc++; | 1651 vc++; |
1642 } | 1652 } |
1643 #endif | 1653 #endif |