diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2017-04-05 23:19:55 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2017-04-06 17:03:28 +0300 |
commit | fed92adbb3fc6cbf735e3df9a2f7d0a2917fcfbd (patch) | |
tree | aabf6817f2f7d08a4a4b71d461488a4db50108df /libavcodec/vp8.h | |
parent | 9a54c6f243412f62bae498ddcac337cb18ae6290 (diff) |
vp8: make mv_min/max thread-local if using partition threading.
Fixes tsan warnings like this in fate-vp8-test-vector-007:
WARNING: ThreadSanitizer: data race (pid=65909)
Write of size 4 at 0x7d8c0000e088 by thread T1:
#0 vp8_decode_mb_row_sliced vp8.c:2519 (ffmpeg:x86_64+0x100995ede)
[..]
Previous write of size 4 at 0x7d8c0000e088 by thread T2:
#0 vp8_decode_mb_row_sliced vp8.c:2519 (ffmpeg:x86_64+0x100995ede)
Diffstat (limited to 'libavcodec/vp8.h')
-rw-r--r-- | libavcodec/vp8.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h index d7e7680276..8263997e3f 100644 --- a/libavcodec/vp8.h +++ b/libavcodec/vp8.h @@ -93,6 +93,16 @@ typedef struct VP8Macroblock { VP56mv bmv[16]; } VP8Macroblock; +typedef struct VP8intmv { + int x; + int y; +} VP8intmv; + +typedef struct VP8mvbounds { + VP8intmv mv_min; + VP8intmv mv_max; +} VP8mvbounds; + typedef struct VP8ThreadData { DECLARE_ALIGNED(16, int16_t, block)[6][4][16]; DECLARE_ALIGNED(16, int16_t, block_dc)[16]; @@ -122,6 +132,7 @@ typedef struct VP8ThreadData { #define EDGE_EMU_LINESIZE 32 DECLARE_ALIGNED(16, uint8_t, edge_emu_buffer)[21 * EDGE_EMU_LINESIZE]; VP8FilterStrength *filter_strength; + VP8mvbounds mv_bounds; } VP8ThreadData; typedef struct VP8Frame { @@ -129,11 +140,6 @@ typedef struct VP8Frame { AVBufferRef *seg_map; } VP8Frame; -typedef struct VP8intmv { - int x; - int y; -} VP8intmv; - #define MAX_THREADS 8 typedef struct VP8Context { VP8ThreadData *thread_data; @@ -152,8 +158,7 @@ typedef struct VP8Context { uint8_t deblock_filter; uint8_t mbskip_enabled; uint8_t profile; - VP8intmv mv_min; - VP8intmv mv_max; + VP8mvbounds mv_bounds; int8_t sign_bias[4]; ///< one state [0, 1] per ref frame type int ref_count[3]; |