X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favs.c;h=3b29c853b4b5c499caf070aaf359a418fe6406d8;hb=6708cfc4d3a079527409b2ba2fc75997a7975104;hp=557e9becb32c130ac075f57c27d5de300b4906d1;hpb=26376701446a51fc505ea998fe477118af3f1c59;p=ffmpeg diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 557e9becb32..3b29c853b4b 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -2,19 +2,21 @@ * AVS video decoder. * Copyright (c) 2006 Aurelien Jacobs * - * This library is free software; you can redistribute it and/or + * This file is part of FFmpeg. + * + * 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 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * - * This library 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 this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avcodec.h" @@ -23,34 +25,35 @@ typedef struct { AVFrame picture; -} avs_context_t; +} AvsContext; typedef enum { AVS_VIDEO = 0x01, AVS_AUDIO = 0x02, AVS_PALETTE = 0x03, AVS_GAME_DATA = 0x04, -} avs_block_type_t; +} AvsBlockType; typedef enum { AVS_I_FRAME = 0x00, AVS_P_FRAME_3X3 = 0x01, AVS_P_FRAME_2X2 = 0x02, AVS_P_FRAME_2X3 = 0x03, -} avs_video_sub_type_t; +} AvsVideoSubType; static int avs_decode_frame(AVCodecContext * avctx, - void *data, int *data_size, uint8_t * buf, int buf_size) + void *data, int *data_size, const uint8_t * buf, int buf_size) { - avs_context_t *const avs = avctx->priv_data; + AvsContext *const avs = avctx->priv_data; AVFrame *picture = data; AVFrame *const p = (AVFrame *) & avs->picture; - uint8_t *table, *vect, *out; + const uint8_t *table, *vect; + uint8_t *out; int i, j, x, y, stride, vect_w = 3, vect_h = 3; - int sub_type; - avs_block_type_t type; + AvsVideoSubType sub_type; + AvsBlockType type; GetBitContext change_map; if (avctx->reget_buffer(avctx, p)) { @@ -72,8 +75,8 @@ avs_decode_frame(AVCodecContext * avctx, int first, last; uint32_t *pal = (uint32_t *) avs->picture.data[1]; - first = LE_16(buf); - last = first + LE_16(buf + 2); + first = AV_RL16(buf); + last = first + AV_RL16(buf + 2); buf += 4; for (i=first; ipix_fmt = PIX_FMT_PAL8; return 0; @@ -149,10 +152,11 @@ AVCodec avs_decoder = { "avs", CODEC_TYPE_VIDEO, CODEC_ID_AVS, - sizeof(avs_context_t), + sizeof(AvsContext), avs_decode_init, NULL, NULL, avs_decode_frame, CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"), };