Browse Source

lavc: set defaults in internal codec frames

This is required specifically for setting frame->format to -1,
otherwise it will be set to 0 = PIX_FMT_YUV420P and code reading
the format from the output decoded frame will get misled.

In particular fix regressions occurring with the pending vsrc_buffer
patch.
tags/n0.8
Stefano Sabatini 14 years ago
parent
commit
01042d4123
67 changed files with 109 additions and 6 deletions
  1. +2
    -0
      libavcodec/4xm.c
  2. +1
    -0
      libavcodec/8bps.c
  3. +1
    -1
      libavcodec/aasc.c
  4. +1
    -0
      libavcodec/anm.c
  5. +1
    -0
      libavcodec/ansi.c
  6. +1
    -0
      libavcodec/aura.c
  7. +2
    -0
      libavcodec/avs.c
  8. +1
    -0
      libavcodec/bethsoftvideo.c
  9. +1
    -0
      libavcodec/bfi.c
  10. +4
    -0
      libavcodec/c93.c
  11. +1
    -0
      libavcodec/cinepak.c
  12. +1
    -0
      libavcodec/cljr.c
  13. +1
    -0
      libavcodec/cscd.c
  14. +1
    -0
      libavcodec/cyuv.c
  15. +1
    -0
      libavcodec/dnxhddec.c
  16. +1
    -0
      libavcodec/dsicinav.c
  17. +1
    -0
      libavcodec/dv.c
  18. +3
    -0
      libavcodec/dxa.c
  19. +4
    -0
      libavcodec/eacmv.c
  20. +2
    -0
      libavcodec/eatgv.c
  21. +3
    -1
      libavcodec/escape124.c
  22. +1
    -0
      libavcodec/flashsv.c
  23. +1
    -0
      libavcodec/flicvideo.c
  24. +1
    -0
      libavcodec/fraps.c
  25. +1
    -0
      libavcodec/huffyuv.c
  26. +1
    -0
      libavcodec/idcinvideo.c
  27. +1
    -0
      libavcodec/iff.c
  28. +1
    -0
      libavcodec/indeo2.c
  29. +1
    -0
      libavcodec/indeo3.c
  30. +2
    -0
      libavcodec/indeo5.c
  31. +3
    -0
      libavcodec/interplayvideo.c
  32. +1
    -0
      libavcodec/kgv1dec.c
  33. +1
    -0
      libavcodec/kmvc.c
  34. +1
    -0
      libavcodec/lcldec.c
  35. +2
    -0
      libavcodec/loco.c
  36. +1
    -0
      libavcodec/mdec.c
  37. +1
    -0
      libavcodec/mjpegdec.c
  38. +1
    -0
      libavcodec/mmvideo.c
  39. +1
    -0
      libavcodec/motionpixels.c
  40. +1
    -0
      libavcodec/msrle.c
  41. +1
    -0
      libavcodec/msvideo1.c
  42. +9
    -1
      libavcodec/pictordec.c
  43. +2
    -1
      libavcodec/qdrw.c
  44. +2
    -0
      libavcodec/qpeg.c
  45. +1
    -0
      libavcodec/qtrle.c
  46. +1
    -0
      libavcodec/rl2.c
  47. +2
    -0
      libavcodec/roqvideodec.c
  48. +1
    -0
      libavcodec/rpza.c
  49. +1
    -0
      libavcodec/smacker.c
  50. +1
    -0
      libavcodec/smc.c
  51. +1
    -0
      libavcodec/tiertexseqv.c
  52. +9
    -0
      libavcodec/tmv.c
  53. +1
    -0
      libavcodec/truemotion1.c
  54. +1
    -0
      libavcodec/truemotion2.c
  55. +1
    -0
      libavcodec/tscc.c
  56. +1
    -0
      libavcodec/ulti.c
  57. +1
    -0
      libavcodec/vb.c
  58. +1
    -0
      libavcodec/vcr1.c
  59. +3
    -0
      libavcodec/vmdav.c
  60. +1
    -0
      libavcodec/vmnc.c
  61. +3
    -1
      libavcodec/vp56.c
  62. +1
    -0
      libavcodec/vqavideo.c
  63. +1
    -0
      libavcodec/wnv1.c
  64. +2
    -0
      libavcodec/xan.c
  65. +2
    -1
      libavcodec/xl.c
  66. +1
    -0
      libavcodec/yop.c
  67. +1
    -0
      libavcodec/zmbv.c

+ 2
- 0
libavcodec/4xm.c View File

@@ -832,6 +832,8 @@ static av_cold int decode_init(AVCodecContext *avctx){
return 1;
}

avcodec_get_frame_defaults(&f->current_picture);
avcodec_get_frame_defaults(&f->last_picture);
f->version= AV_RL32(avctx->extradata)>>16;
common_init(avctx);
init_vlcs(f);


+ 1
- 0
libavcodec/8bps.c View File

@@ -162,6 +162,7 @@ static av_cold int decode_init(AVCodecContext *avctx)

c->avctx = avctx;

avcodec_get_frame_defaults(&c->pic);
c->pic.data[0] = NULL;

switch (avctx->bits_per_coded_sample) {


+ 1
- 1
libavcodec/aasc.c View File

@@ -50,8 +50,8 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx)
AascContext *s = avctx->priv_data;

s->avctx = avctx;

avctx->pix_fmt = PIX_FMT_BGR24;
avcodec_get_frame_defaults(&s->frame);

return 0;
}


+ 1
- 0
libavcodec/anm.c View File

@@ -44,6 +44,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (avctx->extradata_size != 16*8 + 4*256)
return -1;

avcodec_get_frame_defaults(&s->frame);
s->frame.reference = 1;

buf = avctx->extradata + 16*8;


+ 1
- 0
libavcodec/ansi.c View File

@@ -81,6 +81,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->fg = DEFAULT_FG_COLOR;
s->bg = DEFAULT_BG_COLOR;

avcodec_get_frame_defaults(&s->frame);
if (!avctx->width || !avctx->height)
avcodec_set_dimensions(avctx, 80<<3, 25<<4);



+ 1
- 0
libavcodec/aura.c View File

@@ -39,6 +39,7 @@ static av_cold int aura_decode_init(AVCodecContext *avctx)
if (avctx->width & 0x3)
return -1;
avctx->pix_fmt = PIX_FMT_YUV422P;
avcodec_get_frame_defaults(&s->frame);

return 0;
}


+ 2
- 0
libavcodec/avs.c View File

@@ -146,7 +146,9 @@ avs_decode_frame(AVCodecContext * avctx,

static av_cold int avs_decode_init(AVCodecContext * avctx)
{
AvsContext *const avs = avctx->priv_data;
avctx->pix_fmt = PIX_FMT_PAL8;
avcodec_get_frame_defaults(&avs->picture);
return 0;
}



+ 1
- 0
libavcodec/bethsoftvideo.c View File

@@ -39,6 +39,7 @@ typedef struct BethsoftvidContext {
static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
{
BethsoftvidContext *vid = avctx->priv_data;
avcodec_get_frame_defaults(&vid->frame);
vid->frame.reference = 1;
vid->frame.buffer_hints = FF_BUFFER_HINTS_VALID |
FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;


+ 1
- 0
libavcodec/bfi.c View File

@@ -41,6 +41,7 @@ static av_cold int bfi_decode_init(AVCodecContext * avctx)
{
BFIContext *bfi = avctx->priv_data;
avctx->pix_fmt = PIX_FMT_PAL8;
avcodec_get_frame_defaults(&bfi->frame);
bfi->dst = av_mallocz(avctx->width * avctx->height);
return 0;
}


+ 4
- 0
libavcodec/c93.c View File

@@ -47,6 +47,10 @@ typedef enum {

static av_cold int decode_init(AVCodecContext *avctx)
{
C93DecoderContext * const c93 = avctx->priv_data;

avcodec_get_frame_defaults(&c93->pictures[0]);
avcodec_get_frame_defaults(&c93->pictures[1]);
avctx->pix_fmt = PIX_FMT_PAL8;
return 0;
}


+ 1
- 0
libavcodec/cinepak.c View File

@@ -404,6 +404,7 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = PIX_FMT_PAL8;
}

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/cljr.c View File

@@ -118,6 +118,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
static av_cold void common_init(AVCodecContext *avctx){
CLJRContext * const a = avctx->priv_data;

avcodec_get_frame_defaults(&a->picture);
avctx->coded_frame= (AVFrame*)&a->picture;
a->avctx= avctx;
}


+ 1
- 0
libavcodec/cscd.c View File

@@ -231,6 +231,7 @@ static av_cold int decode_init(AVCodecContext *avctx) {
return 1;
}
c->bpp = avctx->bits_per_coded_sample;
avcodec_get_frame_defaults(&c->pic);
c->pic.data[0] = NULL;
c->linelen = avctx->width * avctx->bits_per_coded_sample / 8;
c->height = avctx->height;


+ 1
- 0
libavcodec/cyuv.c View File

@@ -53,6 +53,7 @@ static av_cold int cyuv_decode_init(AVCodecContext *avctx)
return -1;
s->height = avctx->height;
avctx->pix_fmt = PIX_FMT_YUV411P;
avcodec_get_frame_defaults(&s->frame);

return 0;
}


+ 1
- 0
libavcodec/dnxhddec.c View File

@@ -55,6 +55,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
ctx->avctx = avctx;
dsputil_init(&ctx->dsp, avctx);
avctx->coded_frame = &ctx->picture;
avcodec_get_frame_defaults(&ctx->picture);
ctx->picture.type = AV_PICTURE_TYPE_I;
ctx->picture.key_frame = 1;
return 0;


+ 1
- 0
libavcodec/dsicinav.c View File

@@ -94,6 +94,7 @@ static av_cold int cinvideo_decode_init(AVCodecContext *avctx)
cin->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;

avcodec_get_frame_defaults(&cin->frame);
cin->frame.data[0] = NULL;

cin->bitmap_size = avctx->width * avctx->height;


+ 1
- 0
libavcodec/dv.c View File

@@ -1093,6 +1093,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
if (s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);

avcodec_get_frame_defaults(&s->picture);
s->picture.reference = 0;
s->picture.key_frame = 1;
s->picture.pict_type = AV_PICTURE_TYPE_I;


+ 3
- 0
libavcodec/dxa.c View File

@@ -295,6 +295,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;

avcodec_get_frame_defaults(&c->pic);
avcodec_get_frame_defaults(&c->prev);

c->dsize = avctx->width * avctx->height * 2;
if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");


+ 4
- 0
libavcodec/eacmv.c View File

@@ -43,6 +43,10 @@ typedef struct CmvContext {

static av_cold int cmv_decode_init(AVCodecContext *avctx){
CmvContext *s = avctx->priv_data;
avcodec_get_frame_defaults(&s->frame);
avcodec_get_frame_defaults(&s->last_frame);
avcodec_get_frame_defaults(&s->last2_frame);

s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
return 0;


+ 2
- 0
libavcodec/eatgv.c View File

@@ -55,6 +55,8 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx){
s->avctx = avctx;
avctx->time_base = (AVRational){1, 15};
avctx->pix_fmt = PIX_FMT_PAL8;
avcodec_get_frame_defaults(&s->frame);
avcodec_get_frame_defaults(&s->last_frame);
return 0;
}



+ 3
- 1
libavcodec/escape124.c View File

@@ -61,6 +61,7 @@ static av_cold int escape124_decode_init(AVCodecContext *avctx)
{
Escape124Context *s = avctx->priv_data;

avcodec_get_frame_defaults(&s->frame);
avctx->pix_fmt = PIX_FMT_RGB555;

s->num_superblocks = ((unsigned)avctx->width / 8) *
@@ -214,7 +215,8 @@ static int escape124_decode_frame(AVCodecContext *avctx,
uint16_t* old_frame_data, *new_frame_data;
unsigned old_stride, new_stride;

AVFrame new_frame = { { 0 } };
AVFrame new_frame;
avcodec_get_frame_defaults(&new_frame);

init_get_bits(&gb, buf, buf_size * 8);



+ 1
- 0
libavcodec/flashsv.c View File

@@ -92,6 +92,7 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
return 1;
}
avctx->pix_fmt = PIX_FMT_BGR24;
avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/flicvideo.c View File

@@ -118,6 +118,7 @@ static av_cold int flic_decode_init(AVCodecContext *avctx)
return -1;
}

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;
s->new_palette = 0;



+ 1
- 0
libavcodec/fraps.c View File

@@ -60,6 +60,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
FrapsContext * const s = avctx->priv_data;

avcodec_get_frame_defaults(&s->frame);
avctx->coded_frame = (AVFrame*)&s->frame;

s->avctx = avctx;


+ 1
- 0
libavcodec/huffyuv.c View File

@@ -433,6 +433,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
memset(s->vlc, 0, 3*sizeof(VLC));

avctx->coded_frame= &s->picture;
avcodec_get_frame_defaults(&s->picture);
s->interlaced= s->height > 288;

s->bgr32=1;


+ 1
- 0
libavcodec/idcinvideo.c View File

@@ -166,6 +166,7 @@ static av_cold int idcin_decode_init(AVCodecContext *avctx)
huff_build_tree(s, i);
}

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/iff.c View File

@@ -339,6 +339,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM);

s->bpp = avctx->bits_per_coded_sample;
avcodec_get_frame_defaults(&s->frame);

if ((err = extract_header(avctx, NULL)) < 0)
return err;


+ 1
- 0
libavcodec/indeo2.c View File

@@ -192,6 +192,7 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx){
Ir2Context * const ic = avctx->priv_data;
static VLC_TYPE vlc_tables[1 << CODE_VLC_BITS][2];

avcodec_get_frame_defaults(&ic->picture);
ic->avctx = avctx;

avctx->pix_fmt= PIX_FMT_YUV410P;


+ 1
- 0
libavcodec/indeo3.c View File

@@ -967,6 +967,7 @@ static av_cold int indeo3_decode_init(AVCodecContext *avctx)
s->width = avctx->width;
s->height = avctx->height;
avctx->pix_fmt = PIX_FMT_YUV410P;
avcodec_get_frame_defaults(&s->frame);

if (!(ret = build_modpred(s)))
ret = iv_alloc_frames(s);


+ 2
- 0
libavcodec/indeo5.c View File

@@ -713,6 +713,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx->pic_conf.tile_height = avctx->height;
ctx->pic_conf.luma_bands = ctx->pic_conf.chroma_bands = 1;

avcodec_get_frame_defaults(&ctx->frame);

result = ff_ivi_init_planes(ctx->planes, &ctx->pic_conf);
if (result) {
av_log(avctx, AV_LOG_ERROR, "Couldn't allocate color planes!\n");


+ 3
- 0
libavcodec/interplayvideo.c View File

@@ -1030,6 +1030,9 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
/* decoding map contains 4 bits of information per 8x8 block */
s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);

avcodec_get_frame_defaults(&s->second_last_frame);
avcodec_get_frame_defaults(&s->last_frame);
avcodec_get_frame_defaults(&s->current_frame);
s->current_frame.data[0] = s->last_frame.data[0] =
s->second_last_frame.data[0] = NULL;



+ 1
- 0
libavcodec/kgv1dec.c View File

@@ -150,6 +150,7 @@ static av_cold int decode_init(AVCodecContext *avctx)

c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_RGB555;
avcodec_get_frame_defaults(&c->pic);

return 0;
}


+ 1
- 0
libavcodec/kmvc.c View File

@@ -375,6 +375,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
c->setpal = 1;
}

avcodec_get_frame_defaults(&c->pic);
avctx->pix_fmt = PIX_FMT_PAL8;

return 0;


+ 1
- 0
libavcodec/lcldec.c View File

@@ -453,6 +453,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
unsigned int max_basesize = FFALIGN(avctx->width, 4) * FFALIGN(avctx->height, 4) + AV_LZO_OUTPUT_PADDING;
unsigned int max_decomp_size;

avcodec_get_frame_defaults(&c->pic);
if (avctx->extradata_size < 8) {
av_log(avctx, AV_LOG_ERROR, "Extradata size too small.\n");
return 1;


+ 2
- 0
libavcodec/loco.c View File

@@ -272,6 +272,8 @@ static av_cold int decode_init(AVCodecContext *avctx){
if(avctx->debug & FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_INFO, "lossy:%i, version:%i, mode: %i\n", l->lossy, version, l->mode);

avcodec_get_frame_defaults(&l->pic);

return 0;
}



+ 1
- 0
libavcodec/mdec.c View File

@@ -218,6 +218,7 @@ static av_cold void mdec_common_init(AVCodecContext *avctx){
a->mb_width = (avctx->coded_width + 15) / 16;
a->mb_height = (avctx->coded_height + 15) / 16;

avcodec_get_frame_defaults(&a->picture);
avctx->coded_frame= &a->picture;
a->avctx= avctx;
}


+ 1
- 0
libavcodec/mjpegdec.c View File

@@ -84,6 +84,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)

if (!s->picture_ptr)
s->picture_ptr = &s->picture;
avcodec_get_frame_defaults(&s->picture);

s->avctx = avctx;
dsputil_init(&s->dsp, avctx);


+ 1
- 0
libavcodec/mmvideo.c View File

@@ -58,6 +58,7 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)

avctx->pix_fmt = PIX_FMT_PAL8;

avcodec_get_frame_defaults(&s->frame);
s->frame.reference = 1;

return 0;


+ 1
- 0
libavcodec/motionpixels.c View File

@@ -61,6 +61,7 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
mp->hpt = av_mallocz(avctx->height * avctx->width / 16 * sizeof(YuvPixel));
avctx->pix_fmt = PIX_FMT_RGB555;
avcodec_get_frame_defaults(&mp->frame);
return 0;
}



+ 1
- 0
libavcodec/msrle.c View File

@@ -65,6 +65,7 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx)
return -1;
}

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/msvideo1.c View File

@@ -70,6 +70,7 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = PIX_FMT_RGB555;
}

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 9
- 1
libavcodec/pictordec.c View File

@@ -94,6 +94,14 @@ static const uint8_t cga_mode45_index[6][4] = {
[5] = { 0, 11, 12, 15 }, // mode5, high intensity
};

static av_cold int decode_init(AVCodecContext *avctx)
{
PicContext *s = avctx->priv_data;

avcodec_get_frame_defaults(&s->frame);
return 0;
}

static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
@@ -242,7 +250,7 @@ AVCodec ff_pictor_decoder = {
AVMEDIA_TYPE_VIDEO,
CODEC_ID_PICTOR,
sizeof(PicContext),
NULL,
decode_init,
NULL,
decode_end,
decode_frame,


+ 2
- 1
libavcodec/qdrw.c View File

@@ -133,8 +133,9 @@ static int decode_frame(AVCodecContext *avctx,
}

static av_cold int decode_init(AVCodecContext *avctx){
// QdrawContext * const a = avctx->priv_data;
QdrawContext * const a = avctx->priv_data;

avcodec_get_frame_defaults(&a->pic);
avctx->pix_fmt= PIX_FMT_PAL8;

return 0;


+ 2
- 0
libavcodec/qpeg.c View File

@@ -295,6 +295,8 @@ static int decode_frame(AVCodecContext *avctx,
static av_cold int decode_init(AVCodecContext *avctx){
QpegContext * const a = avctx->priv_data;

avcodec_get_frame_defaults(&a->pic);
avcodec_get_frame_defaults(&a->ref);
a->avctx = avctx;
avctx->pix_fmt= PIX_FMT_PAL8;



+ 1
- 0
libavcodec/qtrle.c View File

@@ -417,6 +417,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx)
break;
}

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/rl2.c View File

@@ -134,6 +134,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx)
int i;
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
avcodec_get_frame_defaults(&s->frame);

/** parse extra data */
if(!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE){


+ 2
- 0
libavcodec/roqvideodec.c View File

@@ -159,6 +159,8 @@ static av_cold int roq_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
s->width = avctx->width;
s->height = avctx->height;
avcodec_get_frame_defaults(&s->frames[0]);
avcodec_get_frame_defaults(&s->frames[1]);
s->last_frame = &s->frames[0];
s->current_frame = &s->frames[1];
avctx->pix_fmt = PIX_FMT_YUV444P;


+ 1
- 0
libavcodec/rpza.c View File

@@ -233,6 +233,7 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_RGB555;

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/smacker.c View File

@@ -515,6 +515,7 @@ static av_cold int decode_init(AVCodecContext *avctx)

avctx->pix_fmt = PIX_FMT_PAL8;

avcodec_get_frame_defaults(&c->pic);

/* decode huffman trees from extradata */
if(avctx->extradata_size < 16){


+ 1
- 0
libavcodec/smc.c View File

@@ -425,6 +425,7 @@ static av_cold int smc_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/tiertexseqv.c View File

@@ -180,6 +180,7 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx)
seq->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;

avcodec_get_frame_defaults(&seq->frame);
seq->frame.data[0] = NULL;

return 0;


+ 9
- 0
libavcodec/tmv.c View File

@@ -34,6 +34,14 @@ typedef struct TMVContext {
AVFrame pic;
} TMVContext;

static av_cold int tmv_decode_init(AVCodecContext *avctx)
{
TMVContext *tmv = avctx->priv_data;

avcodec_get_frame_defaults(&tmv->pic);
return 0;
}

static int tmv_decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
@@ -97,6 +105,7 @@ AVCodec ff_tmv_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_TMV,
.priv_data_size = sizeof(TMVContext),
.init = tmv_decode_init,
.close = tmv_decode_close,
.decode = tmv_decode_frame,
.capabilities = CODEC_CAP_DR1,


+ 1
- 0
libavcodec/truemotion1.c View File

@@ -474,6 +474,7 @@ static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
// else
// avctx->pix_fmt = PIX_FMT_RGB555;

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

/* there is a vertical predictor for each pixel in a line; each vertical


+ 1
- 0
libavcodec/truemotion2.c View File

@@ -831,6 +831,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
l->avctx = avctx;
l->pic.data[0]=NULL;
avctx->pix_fmt = PIX_FMT_BGR24;
avcodec_get_frame_defaults(&l->pic);

dsputil_init(&l->dsp, avctx);



+ 1
- 0
libavcodec/tscc.c View File

@@ -145,6 +145,7 @@ static av_cold int decode_init(AVCodecContext *avctx)

c->height = avctx->height;

avcodec_get_frame_defaults(&c->pic);
// Needed if zlib unused or init aborted before inflateInit
memset(&(c->zstream), 0, sizeof(z_stream));
switch(avctx->bits_per_coded_sample){


+ 1
- 0
libavcodec/ulti.c View File

@@ -49,6 +49,7 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx)
s->height = avctx->height;
s->blocks = (s->width / 8) * (s->height / 8);
avctx->pix_fmt = PIX_FMT_YUV410P;
avcodec_get_frame_defaults(&s->frame);
avctx->coded_frame = (AVFrame*) &s->frame;
s->ulti_codebook = ulti_codebook;



+ 1
- 0
libavcodec/vb.c View File

@@ -268,6 +268,7 @@ static av_cold int decode_init(AVCodecContext *avctx)

c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
avcodec_get_frame_defaults(&c->pic);

c->frame = av_mallocz(avctx->width * avctx->height);
c->prev_frame = av_mallocz(avctx->width * avctx->height);


+ 1
- 0
libavcodec/vcr1.c View File

@@ -146,6 +146,7 @@ static av_cold void common_init(AVCodecContext *avctx){
VCR1Context * const a = avctx->priv_data;

avctx->coded_frame= (AVFrame*)&a->picture;
avcodec_get_frame_defaults(&a->picture);
a->avctx= avctx;
}



+ 3
- 0
libavcodec/vmdav.c View File

@@ -358,6 +358,9 @@ static av_cold int vmdvideo_decode_init(AVCodecContext *avctx)
palette32[i] = (r << 16) | (g << 8) | (b);
}

avcodec_get_frame_defaults(&s->frame);
avcodec_get_frame_defaults(&s->prev_frame);

return 0;
}



+ 1
- 0
libavcodec/vmnc.c View File

@@ -470,6 +470,7 @@ static av_cold int decode_init(AVCodecContext *avctx)

c->bpp = avctx->bits_per_coded_sample;
c->bpp2 = c->bpp/8;
avcodec_get_frame_defaults(&c->pic);

switch(c->bpp){
case 8:


+ 3
- 1
libavcodec/vp56.c View File

@@ -653,8 +653,10 @@ av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha)
ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct);

for (i=0; i<4; i++)
for (i=0; i<4; i++) {
s->framep[i] = &s->frames[i];
avcodec_get_frame_defaults(&s->frames[i]);
}
s->framep[VP56_FRAME_UNUSED] = s->framep[VP56_FRAME_GOLDEN];
s->framep[VP56_FRAME_UNUSED2] = s->framep[VP56_FRAME_GOLDEN2];
s->edge_emu_buffer_alloc = NULL;


+ 1
- 0
libavcodec/vqavideo.c View File

@@ -187,6 +187,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
(s->height / s->vector_height) * 2;
s->decode_buffer = av_malloc(s->decode_buffer_size);

avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;

return 0;


+ 1
- 0
libavcodec/wnv1.c View File

@@ -136,6 +136,7 @@ static av_cold int decode_init(AVCodecContext *avctx){

l->avctx = avctx;
avctx->pix_fmt = PIX_FMT_YUV422P;
avcodec_get_frame_defaults(&l->pic);

code_vlc.table = code_table;
code_vlc.table_allocated = 1 << CODE_VLC_BITS;


+ 2
- 0
libavcodec/xan.c View File

@@ -91,6 +91,8 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
av_freep(&s->buffer1);
return AVERROR(ENOMEM);
}
avcodec_get_frame_defaults(&s->last_frame);
avcodec_get_frame_defaults(&s->current_frame);

return 0;
}


+ 2
- 1
libavcodec/xl.c View File

@@ -121,8 +121,9 @@ static int decode_frame(AVCodecContext *avctx,
}

static av_cold int decode_init(AVCodecContext *avctx){
// VideoXLContext * const a = avctx->priv_data;
VideoXLContext * const a = avctx->priv_data;

avcodec_get_frame_defaults(&a->pic);
avctx->pix_fmt= PIX_FMT_YUV411P;

return 0;


+ 1
- 0
libavcodec/yop.c View File

@@ -92,6 +92,7 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)

avctx->pix_fmt = PIX_FMT_PAL8;

avcodec_get_frame_defaults(&s->frame);
s->num_pal_colors = avctx->extradata[0];
s->first_color[0] = avctx->extradata[1];
s->first_color[1] = avctx->extradata[2];


+ 1
- 0
libavcodec/zmbv.c View File

@@ -599,6 +599,7 @@ static av_cold int decode_init(AVCodecContext *avctx)

c->width = avctx->width;
c->height = avctx->height;
avcodec_get_frame_defaults(&c->pic);

c->bpp = avctx->bits_per_coded_sample;



Loading…
Cancel
Save