diff options
Diffstat (limited to 'libavcodec/zmbvenc.c')
-rw-r--r-- | libavcodec/zmbvenc.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index c039383df5..2907c99abc 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -2,20 +2,20 @@ * Zip Motion Blocks Video (ZMBV) encoder * Copyright (c) 2006 Konstantin Shishkov * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -44,8 +44,6 @@ */ typedef struct ZmbvEncContext { AVCodecContext *avctx; - AVFrame pic; - int range; uint8_t *comp_buf, *work_buf; uint8_t pal[768]; @@ -121,7 +119,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { ZmbvEncContext * const c = avctx->priv_data; - AVFrame * const p = &c->pic; + AVFrame * const p = (AVFrame *)pict; uint8_t *src, *prev, *buf; uint32_t *palptr; int keyframe, chpal; @@ -134,7 +132,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, c->curfrm++; if(c->curfrm == c->keyint) c->curfrm = 0; - *p = *pict; p->pict_type= keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; p->key_frame= keyframe; chpal = !keyframe && memcmp(p->data[1], c->pal2, 1024); @@ -229,10 +226,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, } pkt_size = c->zstream.total_out + 1 + 6*keyframe; - if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) { - av_log(avctx, AV_LOG_ERROR, "Error getting packet of size %d.\n", pkt_size); + if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0) return ret; - } buf = pkt->data; fl = (keyframe ? ZMBV_KEYFRAME : 0) | (chpal ? ZMBV_DELTAPAL : 0); @@ -314,8 +309,6 @@ static av_cold int encode_init(AVCodecContext *avctx) return -1; } - avctx->coded_frame = &c->pic; - return 0; } |