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>
pull/8/head
Michael Niedermayer 12 years ago
commit 7681b8e9a9
  1. 6
      libavcodec/ansi.c
  2. 8
      libavcodec/wnv1.c
  3. 5
      libavcodec/xan.c
  4. 4
      libavcodec/zerocodec.c
  5. 14
      libavcodec/zmbv.c

@ -353,6 +353,12 @@ static int decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
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.palette_has_changed = 1;
set_palette((uint32_t *)s->frame.data[1]);

@ -62,9 +62,9 @@ static int decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
WNV1Context * const l = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
WNV1Context * const l = avctx->priv_data;
AVFrame * const p = &l->pic;
unsigned char *Y,*U,*V;
int i, j, ret;
@ -136,7 +136,8 @@ static int decode_frame(AVCodecContext *avctx,
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;
static VLC_TYPE code_table[1 << CODE_VLC_BITS][2];
@ -153,7 +154,8 @@ static av_cold int decode_init(AVCodecContext *avctx){
return 0;
}
static av_cold int decode_end(AVCodecContext *avctx){
static av_cold int decode_end(AVCodecContext *avctx)
{
WNV1Context * const l = avctx->priv_data;
AVFrame *pic = &l->pic;

@ -518,10 +518,9 @@ static int xan_decode_frame(AVCodecContext *avctx,
const uint8_t *buf = avpkt->data;
int ret, buf_size = avpkt->size;
XanContext *s = avctx->priv_data;
if (avctx->codec->id == AV_CODEC_ID_XAN_WC3) {
const uint8_t *buf_end = buf + buf_size;
int tag = 0;
while (buf_end - buf > 8 && tag != VGA__TAG) {
unsigned *tmpptr;
uint32_t new_pal;
@ -577,7 +576,7 @@ static int xan_decode_frame(AVCodecContext *avctx,
}
}
buf_size = buf_end - buf;
}
if (s->palettes_count <= 0) {
av_log(s->avctx, AV_LOG_ERROR, "No palette found\n");
return AVERROR_INVALIDDATA;

@ -25,7 +25,6 @@
typedef struct {
AVFrame previous_frame;
z_stream zstream;
int size;
} ZeroCodecContext;
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->bits_per_raw_sample = 8;
zc->size = avpicture_get_size(avctx->pix_fmt,
avctx->width, avctx->height);
zstream->zalloc = Z_NULL;
zstream->zfree = 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;
}
/*
*
* Init zmbv decoder
*
*/
static av_cold int decode_init(AVCodecContext *avctx)
{
ZmbvContext * const c = avctx->priv_data;
@ -655,13 +648,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
/*
*
* Uninit zmbv decoder
*
*/
static av_cold int decode_end(AVCodecContext *avctx)
{
ZmbvContext * const c = avctx->priv_data;

Loading…
Cancel
Save