[FFmpeg-devel] [PATCH 2/2] vp9: fix segmentation bug exposed in mbgraph sample.

Ronald S. Bultje rsbultje at gmail.com
Sat Nov 30 00:52:15 CET 2013


---
 libavcodec/vp9.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 23a1685..c2b4126 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -276,6 +276,11 @@ static int vp9_alloc_frame(AVCodecContext *ctx, VP9Frame *f)
     f->segmentation_map = f->extradata->data;
     f->mv = (struct VP9mvrefPair *) (f->extradata->data + sz);
 
+    // retain segmentation map if it doesn't update
+    if (s->segmentation.enabled && !s->segmentation.update_map) {
+        memcpy(f->segmentation_map, s->frames[LAST_FRAME].segmentation_map, sz);
+    }
+
     return 0;
 }
 
-- 
1.8.4



More information about the ffmpeg-devel mailing list