Get rid of #ifdef CONFIG_ZLIB in the code. Code cleanup.
Originally committed as revision 7597 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -65,7 +65,9 @@ void avcodec_register_all(void)
|
|||||||
REGISTER_DECODER(EIGHTBPS, eightbps);
|
REGISTER_DECODER(EIGHTBPS, eightbps);
|
||||||
REGISTER_ENCDEC (FFV1, ffv1);
|
REGISTER_ENCDEC (FFV1, ffv1);
|
||||||
REGISTER_ENCDEC (FFVHUFF, ffvhuff);
|
REGISTER_ENCDEC (FFVHUFF, ffvhuff);
|
||||||
|
#ifdef CONFIG_ZLIB
|
||||||
REGISTER_DECODER(FLASHSV, flashsv);
|
REGISTER_DECODER(FLASHSV, flashsv);
|
||||||
|
#endif
|
||||||
REGISTER_DECODER(FLIC, flic);
|
REGISTER_DECODER(FLIC, flic);
|
||||||
REGISTER_ENCDEC (FLV, flv);
|
REGISTER_ENCDEC (FLV, flv);
|
||||||
REGISTER_DECODER(FOURXM, fourxm);
|
REGISTER_DECODER(FOURXM, fourxm);
|
||||||
|
|||||||
@@ -49,15 +49,12 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <zlib.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "bitstream.h"
|
#include "bitstream.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ZLIB
|
|
||||||
#include <zlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct FlashSVContext {
|
typedef struct FlashSVContext {
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
AVFrame frame;
|
AVFrame frame;
|
||||||
@@ -65,9 +62,7 @@ typedef struct FlashSVContext {
|
|||||||
int block_width, block_height;
|
int block_width, block_height;
|
||||||
uint8_t* tmpblock;
|
uint8_t* tmpblock;
|
||||||
int block_size;
|
int block_size;
|
||||||
#ifdef CONFIG_ZLIB
|
|
||||||
z_stream zstream;
|
z_stream zstream;
|
||||||
#endif
|
|
||||||
} FlashSVContext;
|
} FlashSVContext;
|
||||||
|
|
||||||
|
|
||||||
@@ -90,7 +85,6 @@ static int flashsv_decode_init(AVCodecContext *avctx)
|
|||||||
int zret; // Zlib return code
|
int zret; // Zlib return code
|
||||||
|
|
||||||
s->avctx = avctx;
|
s->avctx = avctx;
|
||||||
#ifdef CONFIG_ZLIB
|
|
||||||
s->zstream.zalloc = Z_NULL;
|
s->zstream.zalloc = Z_NULL;
|
||||||
s->zstream.zfree = Z_NULL;
|
s->zstream.zfree = Z_NULL;
|
||||||
s->zstream.opaque = Z_NULL;
|
s->zstream.opaque = Z_NULL;
|
||||||
@@ -99,10 +93,6 @@ static int flashsv_decode_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
|
av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled. Needed for the decoder.\n");
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
avctx->pix_fmt = PIX_FMT_BGR24;
|
avctx->pix_fmt = PIX_FMT_BGR24;
|
||||||
avctx->has_b_frames = 0;
|
avctx->has_b_frames = 0;
|
||||||
s->frame.data[0] = NULL;
|
s->frame.data[0] = NULL;
|
||||||
@@ -198,7 +188,6 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
|
|||||||
/* no change, don't do anything */
|
/* no change, don't do anything */
|
||||||
} else {
|
} else {
|
||||||
/* decompress block */
|
/* decompress block */
|
||||||
#ifdef CONFIG_ZLIB
|
|
||||||
int ret = inflateReset(&(s->zstream));
|
int ret = inflateReset(&(s->zstream));
|
||||||
if (ret != Z_OK)
|
if (ret != Z_OK)
|
||||||
{
|
{
|
||||||
@@ -222,10 +211,6 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
|
|||||||
av_log(avctx, AV_LOG_ERROR, "error in decompression of block %dx%d: %d\n", i, j, ret);
|
av_log(avctx, AV_LOG_ERROR, "error in decompression of block %dx%d: %d\n", i, j, ret);
|
||||||
/* return -1; */
|
/* return -1; */
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled in.\n");
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
copy_region(s->tmpblock, s->frame.data[0], s->image_height-(hp+hs+1), wp, hs, ws, s->frame.linesize[0]);
|
copy_region(s->tmpblock, s->frame.data[0], s->image_height-(hp+hs+1), wp, hs, ws, s->frame.linesize[0]);
|
||||||
skip_bits(&gb, 8*size); /* skip the consumed bits */
|
skip_bits(&gb, 8*size); /* skip the consumed bits */
|
||||||
}
|
}
|
||||||
@@ -247,9 +232,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
|
|||||||
static int flashsv_decode_end(AVCodecContext *avctx)
|
static int flashsv_decode_end(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
FlashSVContext *s = (FlashSVContext *)avctx->priv_data;
|
FlashSVContext *s = (FlashSVContext *)avctx->priv_data;
|
||||||
#ifdef CONFIG_ZLIB
|
|
||||||
inflateEnd(&(s->zstream));
|
inflateEnd(&(s->zstream));
|
||||||
#endif
|
|
||||||
/* release the frame if needed */
|
/* release the frame if needed */
|
||||||
if (s->frame.data[0])
|
if (s->frame.data[0])
|
||||||
avctx->release_buffer(avctx, &s->frame);
|
avctx->release_buffer(avctx, &s->frame);
|
||||||
|
|||||||
Reference in New Issue
Block a user