summaryrefslogtreecommitdiff
path: root/libavcodec/vp8.h
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2011-10-17 17:10:16 -0700
committerRonald S. Bultje <rsbultje@gmail.com>2011-10-21 00:17:58 -0700
commitce42a04884cd6585c596f1ecfe737dacc3e6f396 (patch)
tree35ce60bbdbdc3b34d4beecfafde69f512e7c7be6 /libavcodec/vp8.h
parent8305041e137f4f2a49669dd588bf6ccfbbac2b58 (diff)
vp8: fix up handling of segmentation_maps in reference frames.
Associate segmentation_map[] with reference frame, rather than decoding instance. This fixes cases where the map would be free()'ed on e.g. a size change in one thread, whereas the other thread was still accessing it. Also, it fixes cases where threads overwrite data that is still being referenced by the previous thread, who thinks that it's part of the frame previously decoded by the next thread.
Diffstat (limited to 'libavcodec/vp8.h')
-rw-r--r--libavcodec/vp8.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index 5a96cd436c..6cbdca2d88 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -130,7 +130,6 @@ typedef struct {
uint8_t *intra4x4_pred_mode_top;
uint8_t intra4x4_pred_mode_left[4];
- uint8_t *segmentation_map;
/**
* Macroblocks can have one of 4 different quants in a frame when
@@ -237,6 +236,16 @@ typedef struct {
H264PredContext hpc;
vp8_mc_func put_pixels_tab[3][3][3];
AVFrame frames[5];
+
+ /**
+ * A list of segmentation_map buffers that are to be free()'ed in
+ * the next decoding iteration. We can't free() them right away
+ * because the map may still be used by subsequent decoding threads.
+ * Unused if frame threading is off.
+ */
+ uint8_t *segmentation_maps[5];
+ int num_maps_to_be_freed;
+ int maps_are_invalid;
} VP8Context;
#endif /* AVCODEC_VP8_H */