Lines Matching defs:avctx

54 static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst,
63 if (12ULL + ((avctx->width * avctx->height) >> 4) + AV_RB32(src + 0) + AV_RB32(src + 4) > srcsize)
67 data = code + ((avctx->width * avctx->height) >> 4);
71 for(j = 0; j < avctx->height; j += 4){
72 for(i = 0; i < avctx->width; i += 4){
82 if (i < -x || avctx->width - i - 4 < x ||
83 j < -y || avctx->height - j - 4 < y) {
84 av_log(avctx, AV_LOG_ERROR, "MV %d %d out of bounds\n", x,y);
144 if (i + 2*(k & 1) < -x || avctx->width - i - 2*(k & 1) - 2 < x ||
145 j + (k & 2) < -y || avctx->height - j - (k & 2) - 2 < y) {
146 av_log(avctx, AV_LOG_ERROR, "MV %d %d out of bounds\n", x,y);
201 av_log(avctx, AV_LOG_ERROR, "Unknown opcode %d\n", type);
211 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
214 DxaDecContext * const c = avctx->priv_data;
233 if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
253 av_log(avctx, AV_LOG_ERROR, "Uncompress failed!\n");
259 if (avctx->debug & FF_DEBUG_PICT_INFO)
260 av_log(avctx, AV_LOG_DEBUG, "compr:%2d, dsize:%d\n", compr, (int)dsize);
267 memcpy(frame->data[0], c->prev->data[0], frame->linesize[0] * avctx->height);
269 memset(frame->data[0], 0, frame->linesize[0] * avctx->height);
278 for (j = 0; j < avctx->height; j++) {
279 memcpy(outptr, srcptr, avctx->width);
281 srcptr += avctx->width;
287 av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
288 if (!(avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL))
293 for (j = 0; j < avctx->height; j++) {
295 for(i = 0; i < avctx->width; i++)
299 memcpy(outptr, srcptr, avctx->width);
301 srcptr += avctx->width;
309 av_log(avctx, AV_LOG_ERROR, "Missing reference frame\n");
312 decode_13(avctx, c, frame->data[0], frame->linesize[0], srcptr, dsize, c->prev->data[0]);
315 av_log(avctx, AV_LOG_ERROR, "Unknown/unsupported compression type %d\n", compr);
329 static av_cold int decode_init(AVCodecContext *avctx)
331 DxaDecContext * const c = avctx->priv_data;
333 if (avctx->width%4 || avctx->height%4) {
334 avpriv_request_sample(avctx, "dimensions are not a multiple of 4");
342 avctx->pix_fmt = AV_PIX_FMT_PAL8;
344 c->dsize = avctx->width * avctx->height * 2;
347 av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
354 static av_cold int decode_end(AVCodecContext *avctx)
356 DxaDecContext * const c = avctx->priv_data;