mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
6e86d6af6b
commit
eebc11ebc8
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue