enc_qsv: factor out bitstream parsing.