comparison ulti.c @ 10399:136334ad62b3 libavcodec

Release frame after decoding is done
author kostya
date Wed, 14 Oct 2009 05:28:24 +0000
parents a16f74116015
children 8a137661f31e
comparison
equal deleted inserted replaced
10398:11b685acd280 10399:136334ad62b3
49 s->height = avctx->height; 49 s->height = avctx->height;
50 s->blocks = (s->width / 8) * (s->height / 8); 50 s->blocks = (s->width / 8) * (s->height / 8);
51 avctx->pix_fmt = PIX_FMT_YUV410P; 51 avctx->pix_fmt = PIX_FMT_YUV410P;
52 avctx->coded_frame = (AVFrame*) &s->frame; 52 avctx->coded_frame = (AVFrame*) &s->frame;
53 s->ulti_codebook = ulti_codebook; 53 s->ulti_codebook = ulti_codebook;
54
55 return 0;
56 }
57
58 static av_cold int ulti_decode_end(AVCodecContext *avctx){
59 UltimotionDecodeContext *s = avctx->priv_data;
60 AVFrame *pic = &s->frame;
61
62 if (pic->data[0])
63 avctx->release_buffer(avctx, pic);
64 av_freep(&s->frame);
54 65
55 return 0; 66 return 0;
56 } 67 }
57 68
58 static const int block_coords[8] = // 4x4 block coords in 8x8 superblock 69 static const int block_coords[8] = // 4x4 block coords in 8x8 superblock
399 CODEC_TYPE_VIDEO, 410 CODEC_TYPE_VIDEO,
400 CODEC_ID_ULTI, 411 CODEC_ID_ULTI,
401 sizeof(UltimotionDecodeContext), 412 sizeof(UltimotionDecodeContext),
402 ulti_decode_init, 413 ulti_decode_init,
403 NULL, 414 NULL,
404 NULL, 415 ulti_decode_end,
405 ulti_decode_frame, 416 ulti_decode_frame,
406 CODEC_CAP_DR1, 417 CODEC_CAP_DR1,
407 NULL, 418 NULL,
408 .long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"), 419 .long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"),
409 }; 420 };