YCbCr H2V1 (1x2:1:1, 4 m_blocks per MCU) to RGB
| 1668 | |
| 1669 | // YCbCr H2V1 (1x2:1:1, 4 m_blocks per MCU) to RGB |
| 1670 | void jpeg_decoder::H1V2Convert() |
| 1671 | { |
| 1672 | int row = m_max_mcu_y_size - m_mcu_lines_left; |
| 1673 | uint8* d0 = m_pScan_line_0; |
| 1674 | uint8* d1 = m_pScan_line_1; |
| 1675 | uint8* y; |
| 1676 | uint8* c; |
| 1677 | |
| 1678 | if (row < 8) |
| 1679 | y = m_pSample_buf + row * 8; |
| 1680 | else |
| 1681 | y = m_pSample_buf + 64 * 1 + (row & 7) * 8; |
| 1682 | |
| 1683 | c = m_pSample_buf + 64 * 2 + (row >> 1) * 8; |
| 1684 | |
| 1685 | for (int i = m_max_mcus_per_row; i > 0; i--) |
| 1686 | { |
| 1687 | for (int j = 0; j < 8; j++) |
| 1688 | { |
| 1689 | int cb = c[0 + j]; |
| 1690 | int cr = c[64 + j]; |
| 1691 | |
| 1692 | int rc = m_crr[cr]; |
| 1693 | int gc = ((m_crg[cr] + m_cbg[cb]) >> 16); |
| 1694 | int bc = m_cbb[cb]; |
| 1695 | |
| 1696 | int yy = y[j]; |
| 1697 | d0[0] = clamp(yy + rc); |
| 1698 | d0[1] = clamp(yy + gc); |
| 1699 | d0[2] = clamp(yy + bc); |
| 1700 | d0[3] = 255; |
| 1701 | |
| 1702 | yy = y[8 + j]; |
| 1703 | d1[0] = clamp(yy + rc); |
| 1704 | d1[1] = clamp(yy + gc); |
| 1705 | d1[2] = clamp(yy + bc); |
| 1706 | d1[3] = 255; |
| 1707 | |
| 1708 | d0 += 4; |
| 1709 | d1 += 4; |
| 1710 | } |
| 1711 | |
| 1712 | y += 64 * 4; |
| 1713 | c += 64 * 4; |
| 1714 | } |
| 1715 | } |
| 1716 | |
| 1717 | // YCbCr H2V1 (1x2:1:1, 4 m_blocks per MCU) to RGB |
| 1718 | void jpeg_decoder::H1V2ConvertFiltered() |