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,
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
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)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
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)
static av_cold int end(AVCodecContext *avctx)
bitstream reader API header.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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.
const uint8_t * ff_h263_find_resync_marker_reverse(const uint8_t *av_restrict start, const uint8_t *av_restrict end)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32