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

Method H1V1Convert

encoder/jpgd.cpp:1553–1577  ·  view source on GitHub ↗

YCbCr H1V1 (1x1:1:1, 3 m_blocks per MCU) to RGB

Source from the content-addressed store, hash-verified

1551
1552 // YCbCr H1V1 (1x1:1:1, 3 m_blocks per MCU) to RGB
1553 void jpeg_decoder::H1V1Convert()
1554 {
1555 int row = m_max_mcu_y_size - m_mcu_lines_left;
1556 uint8* d = m_pScan_line_0;
1557 uint8* s = m_pSample_buf + row * 8;
1558
1559 for (int i = m_max_mcus_per_row; i > 0; i--)
1560 {
1561 for (int j = 0; j < 8; j++)
1562 {
1563 int y = s[j];
1564 int cb = s[64 + j];
1565 int cr = s[128 + j];
1566
1567 d[0] = clamp(y + m_crr[cr]);
1568 d[1] = clamp(y + ((m_crg[cr] + m_cbg[cb]) >> 16));
1569 d[2] = clamp(y + m_cbb[cb]);
1570 d[3] = 255;
1571
1572 d += 4;
1573 }
1574
1575 s += 64 * 3;
1576 }
1577 }
1578
1579 // YCbCr H2V1 (2x1:1:1, 4 m_blocks per MCU) to RGB
1580 void jpeg_decoder::H2V1Convert()

Callers

nothing calls this directly

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected