I found dvb_bch_bb_impl.cc use shift register to implement BCH encode,
but it seems different with my knowledge.
If I remember right, after shift the register, we should add the info
bit to register's LSB
dvb_bch_bb_impl.cc:526~535
b = (temp ^ (shift[5] & 1));
reg_6_shift(shift);
if (b) {
shift[0] ^= m_poly_n_12[0];
shift[1] ^= m_poly_n_12[1];
shift[2] ^= m_poly_n_12[2];
shift[3] ^= m_poly_n_12[3];
shift[4] ^= m_poly_n_12[4];
shift[5] ^= m_poly_n_12[5];
}
should be like this ===========>
b = shift[5] & 1; // use register's MSB to decide
whether need to XOR poly
reg_6_shift(shift);
shift[0] = shift[0] ^ (temp<<31);// add the info bit to
register's LSB
if (b) {
shift[0] ^= m_poly_n_12[0];
shift[1] ^= m_poly_n_12[1];
shift[2] ^= m_poly_n_12[2];
shift[3] ^= m_poly_n_12[3];
shift[4] ^= m_poly_n_12[4];
shift[5] ^= m_poly_n_12[5];
}