40 int hmv1, vmv1, hmv2,
vmv2;
65 memcpy(s->
buf + 4, buf, len);
72 int len,
int sbits,
int ebits,
int m)
96 memcpy(s->
buf + 8, buf, len);
102 const uint8_t *mb_info,
int mb_info_size)
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];
153 uint32_t bit_pos =
AV_RL32(ptr);
154 uint32_t pos = (bit_pos + 7)/8;
155 if (pos <= end - buf_base) {
156 state.
quant = ptr[4];
159 state.
hmv1 = (int8_t) ptr[8];
160 state.
vmv1 = (int8_t) ptr[9];
161 state.
hmv2 = (int8_t) ptr[10];
162 state.
vmv2 = (int8_t) ptr[11];
163 ebits = 8 * pos - bit_pos;
164 len = pos - (buf - buf_base);
168 "Unable to split H263 packet, use -mb_info %d " 173 "use -mb_info %d or -ps 1.\n",
179 if (size > 2 && !buf[0] && !buf[1])
180 send_mode_a(s1, &info, buf, len, ebits, len == size);
182 send_mode_b(s1, &info, &packet_start_state, buf, len, sbits,
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf, int size, const uint8_t *mb_info, int mb_info_size)
static void send_mode_b(AVFormatContext *s1, const struct H263Info *info, const struct H263State *state, const uint8_t *buf, int len, int sbits, int ebits, int m)
bitstream reader API header.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const uint8_t * ff_h263_find_resync_marker_reverse(const uint8_t *restrict start, const uint8_t *restrict end)
void av_log(void *avcl, int level, const char *fmt,...)
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void send_mode_a(AVFormatContext *s1, const struct H263Info *info, const uint8_t *buf, int len, int ebits, int m)
void * priv_data
Format private data.