diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 03:31:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 03:31:32 +0100 |
commit | 92cbd775687204f9750a09c69f97702719036aab (patch) | |
tree | 16a375879e56045652edd2dd8f604bb7fb2fb4d0 /libavcodec/ulti.c | |
parent | 9ad477d9098b5281cede0bd8525ca90b0e52436d (diff) | |
parent | d48c20630214a4effcc920e93a5044bee4e2002e (diff) | |
download | ffmpeg-92cbd775687204f9750a09c69f97702719036aab.tar.gz |
Merge commit 'd48c20630214a4effcc920e93a5044bee4e2002e'
* commit 'd48c20630214a4effcc920e93a5044bee4e2002e':
qtrleenc: use the AVFrame API properly.
ulti: use the AVFrame API properly.
vc1: use the AVFrame API properly.
flashsv: use the AVFrame API properly.
Conflicts:
libavcodec/flashsv.c
libavcodec/qtrleenc.c
libavcodec/ulti.c
libavcodec/vc1dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ulti.c')
-rw-r--r-- | libavcodec/ulti.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index aee713fe1d..6b762148bb 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -37,7 +37,7 @@ typedef struct UltimotionDecodeContext { AVCodecContext *avctx; int width, height, blocks; - AVFrame frame; + AVFrame *frame; const uint8_t *ulti_codebook; GetByteContext gb; } UltimotionDecodeContext; @@ -51,19 +51,19 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx) s->height = avctx->height; s->blocks = (s->width / 8) * (s->height / 8); avctx->pix_fmt = AV_PIX_FMT_YUV410P; - avctx->coded_frame = &s->frame; - avctx->coded_frame = (AVFrame*) &s->frame; s->ulti_codebook = ulti_codebook; - avcodec_get_frame_defaults(&s->frame); + + s->frame = av_frame_alloc(); + if (!s->frame) + return AVERROR(ENOMEM); return 0; } static av_cold int ulti_decode_end(AVCodecContext *avctx){ UltimotionDecodeContext *s = avctx->priv_data; - AVFrame *pic = &s->frame; - av_frame_unref(pic); + av_frame_free(&s->frame); return 0; } @@ -227,7 +227,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, int skip; int tmp; - if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) return ret; bytestream2_init(&s->gb, buf, buf_size); @@ -368,7 +368,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, Luma[14] = (tmp >> 6) & 0x3F; Luma[15] = tmp & 0x3F; - ulti_convert_yuv(&s->frame, tx, ty, Luma, chroma); + ulti_convert_yuv(s->frame, tx, ty, Luma, chroma); } else { if (bytestream2_get_bytes_left(&s->gb) < 4) goto err; @@ -380,20 +380,20 @@ static int ulti_decode_frame(AVCodecContext *avctx, Y[1] = tmp & 0x3F; Y[2] = bytestream2_get_byteu(&s->gb) & 0x3F; Y[3] = bytestream2_get_byteu(&s->gb) & 0x3F; - ulti_grad(&s->frame, tx, ty, Y, chroma, angle); //draw block + ulti_grad(s->frame, tx, ty, Y, chroma, angle); //draw block } else { // some patterns int f0, f1; f0 = bytestream2_get_byteu(&s->gb); f1 = tmp; Y[0] = bytestream2_get_byteu(&s->gb) & 0x3F; Y[1] = bytestream2_get_byteu(&s->gb) & 0x3F; - ulti_pattern(&s->frame, tx, ty, f1, f0, Y[0], Y[1], chroma); + ulti_pattern(s->frame, tx, ty, f1, f0, Y[0], Y[1], chroma); } } break; } if(code != 3) - ulti_grad(&s->frame, tx, ty, Y, chroma, angle); // draw block + ulti_grad(s->frame, tx, ty, Y, chroma, angle); // draw block } blocks++; x += 8; @@ -405,7 +405,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, } *got_frame = 1; - if ((ret = av_frame_ref(data, &s->frame)) < 0) + if ((ret = av_frame_ref(data, s->frame)) < 0) return ret; return buf_size; |