Merge remote-tracking branch 'qatar/master'
* qatar/master: wnv1: cosmetics, reformat xan: remove a trivially true if(). ansi: do not depend on get_buffer() initializing the frame. zerocodec: remove an unused variable. zmbv: remove some pointless comments and empty lines Conflicts: libavcodec/xan.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
7681b8e9a9
@ -353,6 +353,12 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (!avctx->frame_number) {
|
||||||
|
for (i=0; i<avctx->height; i++)
|
||||||
|
memset(s->frame.data[0]+ i*s->frame.linesize[0], 0, avctx->width);
|
||||||
|
memset(s->frame.data[1], 0, AVPALETTE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
s->frame.pict_type = AV_PICTURE_TYPE_I;
|
s->frame.pict_type = AV_PICTURE_TYPE_I;
|
||||||
s->frame.palette_has_changed = 1;
|
s->frame.palette_has_changed = 1;
|
||||||
set_palette((uint32_t *)s->frame.data[1]);
|
set_palette((uint32_t *)s->frame.data[1]);
|
||||||
|
|||||||
@ -62,9 +62,9 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
void *data, int *got_frame,
|
void *data, int *got_frame,
|
||||||
AVPacket *avpkt)
|
AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
|
WNV1Context * const l = avctx->priv_data;
|
||||||
const uint8_t *buf = avpkt->data;
|
const uint8_t *buf = avpkt->data;
|
||||||
int buf_size = avpkt->size;
|
int buf_size = avpkt->size;
|
||||||
WNV1Context * const l = avctx->priv_data;
|
|
||||||
AVFrame * const p = &l->pic;
|
AVFrame * const p = &l->pic;
|
||||||
unsigned char *Y,*U,*V;
|
unsigned char *Y,*U,*V;
|
||||||
int i, j, ret;
|
int i, j, ret;
|
||||||
@ -136,7 +136,8 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int decode_init(AVCodecContext *avctx){
|
static av_cold int decode_init(AVCodecContext *avctx)
|
||||||
|
{
|
||||||
WNV1Context * const l = avctx->priv_data;
|
WNV1Context * const l = avctx->priv_data;
|
||||||
static VLC_TYPE code_table[1 << CODE_VLC_BITS][2];
|
static VLC_TYPE code_table[1 << CODE_VLC_BITS][2];
|
||||||
|
|
||||||
@ -153,7 +154,8 @@ static av_cold int decode_init(AVCodecContext *avctx){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int decode_end(AVCodecContext *avctx){
|
static av_cold int decode_end(AVCodecContext *avctx)
|
||||||
|
{
|
||||||
WNV1Context * const l = avctx->priv_data;
|
WNV1Context * const l = avctx->priv_data;
|
||||||
AVFrame *pic = &l->pic;
|
AVFrame *pic = &l->pic;
|
||||||
|
|
||||||
|
|||||||
@ -518,10 +518,9 @@ static int xan_decode_frame(AVCodecContext *avctx,
|
|||||||
const uint8_t *buf = avpkt->data;
|
const uint8_t *buf = avpkt->data;
|
||||||
int ret, buf_size = avpkt->size;
|
int ret, buf_size = avpkt->size;
|
||||||
XanContext *s = avctx->priv_data;
|
XanContext *s = avctx->priv_data;
|
||||||
|
|
||||||
if (avctx->codec->id == AV_CODEC_ID_XAN_WC3) {
|
|
||||||
const uint8_t *buf_end = buf + buf_size;
|
const uint8_t *buf_end = buf + buf_size;
|
||||||
int tag = 0;
|
int tag = 0;
|
||||||
|
|
||||||
while (buf_end - buf > 8 && tag != VGA__TAG) {
|
while (buf_end - buf > 8 && tag != VGA__TAG) {
|
||||||
unsigned *tmpptr;
|
unsigned *tmpptr;
|
||||||
uint32_t new_pal;
|
uint32_t new_pal;
|
||||||
@ -577,7 +576,7 @@ static int xan_decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
buf_size = buf_end - buf;
|
buf_size = buf_end - buf;
|
||||||
}
|
|
||||||
if (s->palettes_count <= 0) {
|
if (s->palettes_count <= 0) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "No palette found\n");
|
av_log(s->avctx, AV_LOG_ERROR, "No palette found\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
AVFrame previous_frame;
|
AVFrame previous_frame;
|
||||||
z_stream zstream;
|
z_stream zstream;
|
||||||
int size;
|
|
||||||
} ZeroCodecContext;
|
} ZeroCodecContext;
|
||||||
|
|
||||||
static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
|
static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
@ -136,9 +135,6 @@ static av_cold int zerocodec_decode_init(AVCodecContext *avctx)
|
|||||||
avctx->pix_fmt = AV_PIX_FMT_UYVY422;
|
avctx->pix_fmt = AV_PIX_FMT_UYVY422;
|
||||||
avctx->bits_per_raw_sample = 8;
|
avctx->bits_per_raw_sample = 8;
|
||||||
|
|
||||||
zc->size = avpicture_get_size(avctx->pix_fmt,
|
|
||||||
avctx->width, avctx->height);
|
|
||||||
|
|
||||||
zstream->zalloc = Z_NULL;
|
zstream->zalloc = Z_NULL;
|
||||||
zstream->zfree = Z_NULL;
|
zstream->zfree = Z_NULL;
|
||||||
zstream->opaque = Z_NULL;
|
zstream->opaque = Z_NULL;
|
||||||
|
|||||||
@ -608,13 +608,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
|||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Init zmbv decoder
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static av_cold int decode_init(AVCodecContext *avctx)
|
static av_cold int decode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
ZmbvContext * const c = avctx->priv_data;
|
ZmbvContext * const c = avctx->priv_data;
|
||||||
@ -655,13 +648,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Uninit zmbv decoder
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static av_cold int decode_end(AVCodecContext *avctx)
|
static av_cold int decode_end(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
ZmbvContext * const c = avctx->priv_data;
|
ZmbvContext * const c = avctx->priv_data;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user