fixed errors from native qp encoder