X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Frpza.c;h=7350ef2c4a481464ce0f8c74fbca41c98fc84c87;hb=f73673a770215f2f601ebb6e75d264533f738cc4;hp=ea36393aa21e9e6e153c6812bea23a5f368f298e;hpb=f61bf0526b27509c44e5dae5e7ddd82a6d7515c5;p=ffmpeg diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index ea36393aa21..7350ef2c4a4 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -2,26 +2,26 @@ * Quicktime Video (RPZA) Video Decoder * Copyright (C) 2003 the ffmpeg project * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav 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 FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** - * @file rpza.c - * QT RPZA Video Decoder by Roberto Togni + * @file + * QT RPZA Video Decoder by Roberto Togni * For more information about the RPZA format, visit: * http://www.pcisys.net/~melanson/codecs/ * @@ -30,22 +30,20 @@ * Note that this decoder reads big endian RGB555 pixel values from the * bytestream, arranges them in the host's endian order, and outputs * them to the final rendered map in the same host endian order. This is - * intended behavior as the ffmpeg documentation states that RGB555 pixels - * shall be stored in native CPU endianness. + * intended behavior as the libavcodec documentation states that RGB555 + * pixels shall be stored in native CPU endianness. */ #include #include #include -#include +#include "libavutil/intreadwrite.h" #include "avcodec.h" -#include "dsputil.h" typedef struct RpzaContext { AVCodecContext *avctx; - DSPContext dsp; AVFrame frame; const unsigned char *buf; @@ -228,13 +226,12 @@ static void rpza_decode_stream(RpzaContext *s) } } -static int rpza_decode_init(AVCodecContext *avctx) +static av_cold int rpza_decode_init(AVCodecContext *avctx) { RpzaContext *s = avctx->priv_data; s->avctx = avctx; avctx->pix_fmt = PIX_FMT_RGB555; - dsputil_init(&s->dsp, avctx); s->frame.data[0] = NULL; @@ -243,8 +240,10 @@ static int rpza_decode_init(AVCodecContext *avctx) static int rpza_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - const uint8_t *buf, int buf_size) + AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; RpzaContext *s = avctx->priv_data; s->buf = buf; @@ -266,7 +265,7 @@ static int rpza_decode_frame(AVCodecContext *avctx, return buf_size; } -static int rpza_decode_end(AVCodecContext *avctx) +static av_cold int rpza_decode_end(AVCodecContext *avctx) { RpzaContext *s = avctx->priv_data; @@ -276,14 +275,14 @@ static int rpza_decode_end(AVCodecContext *avctx) return 0; } -AVCodec rpza_decoder = { - "rpza", - CODEC_TYPE_VIDEO, - CODEC_ID_RPZA, - sizeof(RpzaContext), - rpza_decode_init, - NULL, - rpza_decode_end, - rpza_decode_frame, - CODEC_CAP_DR1, +AVCodec ff_rpza_decoder = { + .name = "rpza", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_RPZA, + .priv_data_size = sizeof(RpzaContext), + .init = rpza_decode_init, + .close = rpza_decode_end, + .decode = rpza_decode_frame, + .capabilities = CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"), };