Lines Matching defs:buf
61 const uint8_t *buf, const uint8_t *buf_end)
66 for (i=0; i < s->avctx->height && buf_end - buf >= s->avctx->width; i++) {
67 memcpy(dst, buf, s->avctx->width);
69 buf += s->avctx->width;
92 static void cmv_decode_inter(CmvContext *s, AVFrame *frame, const uint8_t *buf,
95 const uint8_t *raw = buf + (s->avctx->width*s->avctx->height/16);
100 for(x=0; x<s->avctx->width/4 && buf_end - buf > i; x++) {
101 if (buf[i]==0xFF) {
120 int xoffset = (buf[i] & 0xF) - 7;
121 int yoffset = ((buf[i] >> 4)) - 7;
131 static int cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
135 if(buf_end - buf < 16) {
140 s->width = AV_RL16(&buf[4]);
141 s->height = AV_RL16(&buf[6]);
153 fps = AV_RL16(&buf[10]);
157 pal_start = AV_RL16(&buf[12]);
158 pal_count = AV_RL16(&buf[14]);
160 buf += 16;
161 for (i=pal_start; i<pal_start+pal_count && i<AVPALETTE_COUNT && buf_end - buf >= 3; i++) {
162 s->palette[i] = 0xFFU << 24 | AV_RB24(buf);
163 buf += 3;
175 const uint8_t *buf = avpkt->data;
178 const uint8_t *buf_end = buf + buf_size;
181 if (buf_end - buf < EA_PREAMBLE_SIZE)
184 if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) {
185 unsigned size = AV_RL32(buf + 4);
186 ret = cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end);
189 if (size > buf_end - buf - EA_PREAMBLE_SIZE)
191 buf += size;
202 buf += EA_PREAMBLE_SIZE;
203 if ((buf[0]&1)) { // subtype
204 cmv_decode_inter(s, frame, buf+2, buf_end);
210 cmv_decode_intra(s, frame, buf+2, buf_end);