Revision 800274f8

View differences:

libavcodec/avcodec.h
913 913
#define FF_QSCALE_TYPE_MPEG1 0
914 914
#define FF_QSCALE_TYPE_MPEG2 1
915 915
#define FF_QSCALE_TYPE_H264  2
916
#define FF_QSCALE_TYPE_VP56  3
916 917

  
917 918
#define FF_BUFFER_TYPE_INTERNAL 1
918 919
#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
libavcodec/vp56.c
33 33
    s->quantizer = quantizer;
34 34
    s->dequant_dc = vp56_dc_dequant[quantizer] << 2;
35 35
    s->dequant_ac = vp56_ac_dequant[quantizer] << 2;
36
    memset(s->qscale_table, quantizer, s->mb_width);
36 37
}
37 38

  
38 39
static int vp56_get_vectors_predictors(VP56Context *s, int row, int col,
......
481 482
        return -1;
482 483
    }
483 484

  
485
    s->qscale_table = av_realloc(s->qscale_table, s->mb_width);
484 486
    s->above_blocks = av_realloc(s->above_blocks,
485 487
                                 (4*s->mb_width+6) * sizeof(*s->above_blocks));
486 488
    s->macroblocks = av_realloc(s->macroblocks,
......
643 645
    FFSWAP(AVFrame *, s->framep[VP56_FRAME_CURRENT],
644 646
                      s->framep[VP56_FRAME_PREVIOUS]);
645 647

  
648
    p->qstride = 0;
649
    p->qscale_table = s->qscale_table;
650
    p->qscale_type = FF_QSCALE_TYPE_VP56;
646 651
    *(AVFrame*)data = *p;
647 652
    *data_size = sizeof(AVFrame);
648 653

  
......
691 696
{
692 697
    VP56Context *s = avctx->priv_data;
693 698

  
699
    av_freep(&s->qscale_table);
694 700
    av_freep(&s->above_blocks);
695 701
    av_freep(&s->macroblocks);
696 702
    av_freep(&s->edge_emu_buffer_alloc);
libavcodec/vp56.h
110 110
    int quantizer;
111 111
    uint16_t dequant_dc;
112 112
    uint16_t dequant_ac;
113
    int8_t *qscale_table;
113 114

  
114 115
    /* DC predictors management */
115 116
    VP56RefDc *above_blocks;

Also available in: Unified diff