aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp56.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-29 19:11:47 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-29 19:11:47 +0000
commit800274f8716ed4254d889e7c739b45ba1940147e (patch)
tree7ad5b95d93ebb59c6fe3e4816630abfc5a06bf9e /libavcodec/vp56.c
parent5e4e9042c4e11bcf4fd1734f17e0379eab422e41 (diff)
downloadffmpeg-800274f8716ed4254d889e7c739b45ba1940147e.tar.gz
Make VP5 and VP6 decoders output a qscale table to allow for more automatic
post-processing, and add a new FF_QSCALE_TYPE_VP56 for this. Originally committed as revision 21529 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp56.c')
-rw-r--r--libavcodec/vp56.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 36027b43f1..63055f5059 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -33,6 +33,7 @@ void vp56_init_dequant(VP56Context *s, int quantizer)
s->quantizer = quantizer;
s->dequant_dc = vp56_dc_dequant[quantizer] << 2;
s->dequant_ac = vp56_ac_dequant[quantizer] << 2;
+ memset(s->qscale_table, quantizer, s->mb_width);
}
static int vp56_get_vectors_predictors(VP56Context *s, int row, int col,
@@ -481,6 +482,7 @@ static int vp56_size_changed(AVCodecContext *avctx)
return -1;
}
+ s->qscale_table = av_realloc(s->qscale_table, s->mb_width);
s->above_blocks = av_realloc(s->above_blocks,
(4*s->mb_width+6) * sizeof(*s->above_blocks));
s->macroblocks = av_realloc(s->macroblocks,
@@ -643,6 +645,9 @@ int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
FFSWAP(AVFrame *, s->framep[VP56_FRAME_CURRENT],
s->framep[VP56_FRAME_PREVIOUS]);
+ p->qstride = 0;
+ p->qscale_table = s->qscale_table;
+ p->qscale_type = FF_QSCALE_TYPE_VP56;
*(AVFrame*)data = *p;
*data_size = sizeof(AVFrame);
@@ -691,6 +696,7 @@ av_cold int vp56_free(AVCodecContext *avctx)
{
VP56Context *s = avctx->priv_data;
+ av_freep(&s->qscale_table);
av_freep(&s->above_blocks);
av_freep(&s->macroblocks);
av_freep(&s->edge_emu_buffer_alloc);