65 memcpy(s->
buf + 4, buf, len);
72 int len,
int sbits,
int ebits,
int m)
96 memcpy(s->
buf + 8, buf, len);
105 int len, sbits = 0, ebits = 0;
109 int mb_info_pos = 0, mb_info_count = mb_info_size / 12;
138 while (mb_info_pos < mb_info_count) {
139 uint32_t pos =
AV_RL32(&mb_info[12*mb_info_pos])/8;
140 if (pos >= buf - buf_base)
145 while (mb_info_pos + 1 < mb_info_count) {
146 uint32_t pos =
AV_RL32(&mb_info[12*(mb_info_pos + 1)])/8;
147 if (pos >= end - buf_base)
151 if (mb_info_pos < mb_info_count) {
152 const uint8_t *ptr = &mb_info[12*mb_info_pos];
154 uint32_t bit_pos =
AV_RL32(ptr);
156 uint32_t pos_next_mb_info = (bit_pos + 7)/8;
158 if (pos_next_mb_info <= end - buf_base) {
159 state.
quant = ptr[4];
162 state.
hmv1 = (int8_t) ptr[8];
163 state.
vmv1 = (int8_t) ptr[9];
164 state.
hmv2 = (int8_t) ptr[10];
165 state.
vmv2 = (int8_t) ptr[11];
166 ebits = 8 * pos_next_mb_info - bit_pos;
167 len = pos_next_mb_info - (buf - buf_base);
172 "use -mb_info %d or -ps 1.\n",
178 if (size > 2 && !buf[0] && !buf[1])
179 send_mode_a(s1, &info, buf, len, ebits, len == size);
181 send_mode_b(s1, &info, &packet_start_state, buf, len, sbits,