diff options
Diffstat (limited to 'libavcodec/pafvideo.c')
-rw-r--r-- | libavcodec/pafvideo.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c index 650d036..a27afed 100644 --- a/libavcodec/pafvideo.c +++ b/libavcodec/pafvideo.c @@ -2,20 +2,20 @@ * Packed Animation File video decoder * Copyright (c) 2012 Paul B Mahol * - * 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 */ @@ -26,15 +26,24 @@ #include "copy_block.h" #include "internal.h" + static const uint8_t block_sequences[16][8] = { - { 0, 0, 0, 0, 0, 0, 0, 0 }, { 2, 0, 0, 0, 0, 0, 0, 0 }, - { 5, 7, 0, 0, 0, 0, 0, 0 }, { 5, 0, 0, 0, 0, 0, 0, 0 }, - { 6, 0, 0, 0, 0, 0, 0, 0 }, { 5, 7, 5, 7, 0, 0, 0, 0 }, - { 5, 7, 5, 0, 0, 0, 0, 0 }, { 5, 7, 6, 0, 0, 0, 0, 0 }, - { 5, 5, 0, 0, 0, 0, 0, 0 }, { 3, 0, 0, 0, 0, 0, 0, 0 }, - { 6, 6, 0, 0, 0, 0, 0, 0 }, { 2, 4, 0, 0, 0, 0, 0, 0 }, - { 2, 4, 5, 7, 0, 0, 0, 0 }, { 2, 4, 5, 0, 0, 0, 0, 0 }, - { 2, 4, 6, 0, 0, 0, 0, 0 }, { 2, 4, 5, 7, 5, 7, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 7, 0, 0, 0, 0, 0, 0 }, + { 5, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 7, 5, 7, 0, 0, 0, 0 }, + { 5, 7, 5, 0, 0, 0, 0, 0 }, + { 5, 7, 6, 0, 0, 0, 0, 0 }, + { 5, 5, 0, 0, 0, 0, 0, 0 }, + { 3, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 6, 0, 0, 0, 0, 0, 0 }, + { 2, 4, 0, 0, 0, 0, 0, 0 }, + { 2, 4, 5, 7, 0, 0, 0, 0 }, + { 2, 4, 5, 0, 0, 0, 0, 0 }, + { 2, 4, 6, 0, 0, 0, 0, 0 }, + { 2, 4, 5, 7, 5, 7, 0, 0 }, }; typedef struct PAFVideoDecContext { @@ -156,9 +165,11 @@ static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code) i = bytestream2_get_byte(&c->gb); if (i) { if (code & 0x10) { - int pos = bytestream2_tell(&c->gb) & 3; - if (pos) - bytestream2_skip(&c->gb, 4 - pos); + int align; + + align = bytestream2_tell(&c->gb) & 3; + if (align) + bytestream2_skip(&c->gb, 4 - align); } do { int page, val, x, y; |