aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorBen Jackson <ben@ben.com>2012-09-15 10:32:41 -0700
committerMichael Niedermayer <michaelni@gmx.at>2012-09-15 20:26:35 +0200
commiteebc11ebc8000aefc8562d17749ac2f9160fdfec (patch)
treee34abb45093093d688dd9e054ac6f72cd0602d54 /libavcodec
parent6e86d6af6bd914fb076d1263cbb240c888a1284e (diff)
downloadffmpeg-eebc11ebc8000aefc8562d17749ac2f9160fdfec.tar.gz
lavc/vp56: Move golden_frame into VP56Context
Makes golden_frame more like other frame data, paves way for threading alpha channel decode. Signed-off-by: Ben Jackson <ben@ben.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp5.c3
-rw-r--r--libavcodec/vp56.c6
-rw-r--r--libavcodec/vp56.h3
-rw-r--r--libavcodec/vp6.c6
4 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index 9f74784492..3ae7c25f51 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -35,8 +35,7 @@
#include "vp5data.h"
-static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
- int *golden_frame)
+static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
int rows, cols;
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index b8e183cf05..47f92f1a1c 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -507,12 +507,11 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
for (is_alpha=0; is_alpha < 1+s->has_alpha; is_alpha++) {
int mb_row, mb_col, mb_row_flip, mb_offset = 0;
int block, y, uv, stride_y, stride_uv;
- int golden_frame = 0;
int res;
s->modelp = &s->models[is_alpha];
- res = s->parse_header(s, buf, remaining_buf_size, &golden_frame);
+ res = s->parse_header(s, buf, remaining_buf_size);
if (!res)
return -1;
@@ -620,7 +619,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
next:
- if (p->key_frame || golden_frame) {
+ if (p->key_frame || s->golden_frame) {
if (s->framep[VP56_FRAME_GOLDEN]->data[0] && s->framep[VP56_FRAME_GOLDEN] != p &&
s->framep[VP56_FRAME_GOLDEN] != s->framep[VP56_FRAME_GOLDEN2])
avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN]);
@@ -690,6 +689,7 @@ av_cold void ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s,
s->macroblocks = NULL;
s->quantizer = -1;
s->deblock_filtering = 1;
+ s->golden_frame = 0;
s->filter = NULL;
diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h
index 8256bee603..7a32342aee 100644
--- a/libavcodec/vp56.h
+++ b/libavcodec/vp56.h
@@ -50,7 +50,7 @@ typedef void (*VP56DefaultModelsInit)(VP56Context *s);
typedef void (*VP56ParseVectorModels)(VP56Context *s);
typedef int (*VP56ParseCoeffModels)(VP56Context *s);
typedef int (*VP56ParseHeader)(VP56Context *s, const uint8_t *buf,
- int buf_size, int *golden_frame);
+ int buf_size);
typedef struct {
int high;
@@ -105,6 +105,7 @@ struct vp56_context {
int sub_version;
/* frame info */
+ int golden_frame;
int plane_width[4];
int plane_height[4];
int mb_width; /* number of horizontal MB */
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index a895386085..c8a191799e 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -43,8 +43,7 @@
static void vp6_parse_coeff(VP56Context *s);
static void vp6_parse_coeff_huffman(VP56Context *s);
-static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
- int *golden_frame)
+static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
int parse_filter_info = 0;
@@ -100,6 +99,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
if (sub_version < 8)
vrt_shift = 5;
s->sub_version = sub_version;
+ s->golden_frame = 0;
} else {
if (!s->sub_version || !s->avctx->coded_width || !s->avctx->coded_height)
return 0;
@@ -111,7 +111,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
}
ff_vp56_init_range_decoder(c, buf+1, buf_size-1);
- *golden_frame = vp56_rac_get(c);
+ s->golden_frame = vp56_rac_get(c);
if (s->filter_header) {
s->deblock_filtering = vp56_rac_get(c);
if (s->deblock_filtering)