MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / H2V1Convert

Method H2V1Convert

encoder/jpgd.cpp:1580–1622  ·  view source on GitHub ↗

YCbCr H2V1 (2x1:1:1, 4 m_blocks per MCU) to RGB

Source from the content-addressed store, hash-verified

1578
1579 // YCbCr H2V1 (2x1:1:1, 4 m_blocks per MCU) to RGB
1580 void jpeg_decoder::H2V1Convert()
1581 {
1582 int row = m_max_mcu_y_size - m_mcu_lines_left;
1583 uint8* d0 = m_pScan_line_0;
1584 uint8* y = m_pSample_buf + row * 8;
1585 uint8* c = m_pSample_buf + 2 * 64 + row * 8;
1586
1587 for (int i = m_max_mcus_per_row; i > 0; i--)
1588 {
1589 for (int l = 0; l < 2; l++)
1590 {
1591 for (int j = 0; j < 4; j++)
1592 {
1593 int cb = c[0];
1594 int cr = c[64];
1595
1596 int rc = m_crr[cr];
1597 int gc = ((m_crg[cr] + m_cbg[cb]) >> 16);
1598 int bc = m_cbb[cb];
1599
1600 int yy = y[j << 1];
1601 d0[0] = clamp(yy + rc);
1602 d0[1] = clamp(yy + gc);
1603 d0[2] = clamp(yy + bc);
1604 d0[3] = 255;
1605
1606 yy = y[(j << 1) + 1];
1607 d0[4] = clamp(yy + rc);
1608 d0[5] = clamp(yy + gc);
1609 d0[6] = clamp(yy + bc);
1610 d0[7] = 255;
1611
1612 d0 += 8;
1613
1614 c++;
1615 }
1616 y += 64;
1617 }
1618
1619 y += 64 * 4 - 64 * 2;
1620 c += 64 * 4 - 8;
1621 }
1622 }
1623
1624 // YCbCr H2V1 (2x1:1:1, 4 m_blocks per MCU) to RGB
1625 void jpeg_decoder::H2V1ConvertFiltered()

Callers

nothing calls this directly

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected