* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
*/
/**
* http://www.pcisys.net/~melanson/codecs/
*
* Supports: PAL8 (RGB 8bpp, paletted)
- * : BGR24 (RGB 24bpp) (can also output it as RGBA32)
- * : RGBA32 (RGB 32bpp, 4th plane is probably alpha and it's ignored)
+ * : BGR24 (RGB 24bpp) (can also output it as RGB32)
+ * : RGB32 (RGB 32bpp, 4th plane is probably alpha and it's ignored)
*
*/
#include <stdio.h>
#include <stdlib.h>
-#include "common.h"
#include "avcodec.h"
-static const enum PixelFormat pixfmt_rgb24[] = {PIX_FMT_BGR24, PIX_FMT_RGBA32, -1};
+static const enum PixelFormat pixfmt_rgb24[] = {PIX_FMT_BGR24, PIX_FMT_RGB32, -1};
/*
* Decoder context
*/
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
{
- EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
+ EightBpsContext * const c = avctx->priv_data;
unsigned char *encoded = (unsigned char *)buf;
unsigned char *pixptr, *pixptr_end;
unsigned int height = avctx->height; // Real image height
if (planes == 4)
planes--;
- px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGBA32);
+ px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32);
for (p = 0; p < planes; p++) {
/* Lines length pointer for this plane */
*/
static int decode_init(AVCodecContext *avctx)
{
- EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
+ EightBpsContext * const c = avctx->priv_data;
c->avctx = avctx;
- avctx->has_b_frames = 0;
c->pic.data[0] = NULL;
c->planemap[2] = 0; // 3rd plane is blue
break;
case 32:
- avctx->pix_fmt = PIX_FMT_RGBA32;
+ avctx->pix_fmt = PIX_FMT_RGB32;
c->planes = 4;
#ifdef WORDS_BIGENDIAN
c->planemap[0] = 1; // 1st plane is red
*/
static int decode_end(AVCodecContext *avctx)
{
- EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
+ EightBpsContext * const c = avctx->priv_data;
if (c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);