diff options
Diffstat (limited to 'libavcodec/pcxenc.c')
-rw-r--r-- | libavcodec/pcxenc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c index 3084568..a39e221 100644 --- a/libavcodec/pcxenc.c +++ b/libavcodec/pcxenc.c @@ -2,20 +2,20 @@ * PC Paintbrush PCX (.pcx) image encoder * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu> * - * 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 */ @@ -28,6 +28,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "libavutil/imgutils.h" typedef struct PCXContext { AVFrame picture; @@ -105,6 +106,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, int bpp, nplanes, i, y, line_bytes, written; const uint32_t *pal = NULL; + uint32_t palette256[256]; const uint8_t *src; *pict = *(AVFrame *)data; @@ -126,6 +128,11 @@ static int pcx_encode_frame(AVCodecContext *avctx, case PIX_FMT_RGB4_BYTE: case PIX_FMT_BGR4_BYTE: case PIX_FMT_GRAY8: + bpp = 8; + nplanes = 1; + ff_set_systematic_pal2(palette256, avctx->pix_fmt); + pal = palette256; + break; case PIX_FMT_PAL8: bpp = 8; nplanes = 1; |