/**
- * @file vp5.c
+ * @file libavcodec/vp5.c
* VP5 compatible video decoder
*
* Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
#include "avcodec.h"
#include "dsputil.h"
-#include "bitstream.h"
+#include "get_bits.h"
#include "vp56.h"
#include "vp56data.h"
vp56_rac_gets(c, 8); /* number of displayed macroblock rows */
vp56_rac_gets(c, 8); /* number of displayed macroblock cols */
vp56_rac_gets(c, 2);
- if (16*cols != s->avctx->coded_width ||
+ if (!s->macroblocks || /* first frame */
+ 16*cols != s->avctx->coded_width ||
16*rows != s->avctx->coded_height) {
avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
return 2;
}
- }
+ } else if (!s->macroblocks)
+ return 0;
return 1;
}
static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
{
VP56RangeCoder *c = &s->c;
- Vp56Model *model = s->modelp;
+ VP56Model *model = s->modelp;
int comp, di;
for (comp=0; comp<2; comp++) {
static void vp5_parse_vector_models(VP56Context *s)
{
VP56RangeCoder *c = &s->c;
- Vp56Model *model = s->modelp;
+ VP56Model *model = s->modelp;
int comp, node;
for (comp=0; comp<2; comp++) {
static void vp5_parse_coeff_models(VP56Context *s)
{
VP56RangeCoder *c = &s->c;
- Vp56Model *model = s->modelp;
+ VP56Model *model = s->modelp;
uint8_t def_prob[11];
int node, cg, ctx;
int ct; /* code type */
static void vp5_parse_coeff(VP56Context *s)
{
VP56RangeCoder *c = &s->c;
- Vp56Model *model = s->modelp;
+ VP56Model *model = s->modelp;
uint8_t *permute = s->scantable.permutated;
uint8_t *model1, *model2;
int coeff, sign, coeff_idx;
static void vp5_default_models_init(VP56Context *s)
{
- Vp56Model *model = s->modelp;
+ VP56Model *model = s->modelp;
int i;
for (i=0; i<2; i++) {