aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2015-09-02 17:56:08 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2015-09-04 09:33:45 -0400
commit8b45e87f64d5986220286e8276c3782157189294 (patch)
treed4c91f1975635a7e1922db724852bc74573ec96e
parent7cc7d13fe32fc3fb8c53d1063b777a3b8b864d7c (diff)
downloadffmpeg-8b45e87f64d5986220286e8276c3782157189294.tar.gz
vp9: fix segmentation map retention across keyframe boundaries.
-rw-r--r--libavcodec/vp9.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 760f045fb8..f0f54da153 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -289,6 +289,7 @@ static void vp9_unref_frame(AVCodecContext *ctx, VP9Frame *f)
{
ff_thread_release_buffer(ctx, &f->tf);
av_buffer_unref(&f->extradata);
+ f->segmentation_map = NULL;
}
static int vp9_ref_frame(AVCodecContext *ctx, VP9Frame *dst, VP9Frame *src)
@@ -4002,8 +4003,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
VP9Context *s = ctx->priv_data;
int res, tile_row, tile_col, i, ref, row, col;
int retain_segmap_ref = s->frames[REF_FRAME_SEGMAP].segmentation_map &&
- !(s->segmentation.enabled &&
- (s->segmentation.update_map || s->keyframe || s->intraonly));
+ (!s->segmentation.enabled || !s->segmentation.update_map);
ptrdiff_t yoff, uvoff, ls_y, ls_uv;
AVFrame *f;
int bytesperpixel;
@@ -4032,7 +4032,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
data += res;
size -= res;
- if (!retain_segmap_ref) {
+ if (!retain_segmap_ref || s->keyframe || s->intraonly) {
if (s->frames[REF_FRAME_SEGMAP].tf.f->data[0])
vp9_unref_frame(ctx, &s->frames[REF_FRAME_SEGMAP]);
if (!s->keyframe && !s->intraonly && !s->errorres && s->frames[CUR_FRAME].tf.f->data[0] &&