28 size_t dst_len = *dst_bit_len / 8;
29 size_t src_len = (src_bit_len + 7) / 8;
30 int trailing_zeroes = src_len * 8 - src_bit_len;
32 if (dst_len < src_len + 4) {
38 dst[0] = dst[1] = dst[2] = 0;
42 for (sp = 0; sp < src_len; sp++) {
51 if ((src[sp] & ~3) == 0) {
57 zero_run = src[
sp] == 0;
62 *dst_bit_len = 8 * dp - trailing_zeroes;
int ff_vaapi_encode_h26x_nal_unit_to_byte_stream(uint8_t *dst, size_t *dst_bit_len, uint8_t *src, size_t src_bit_len)