]> granicus.if.org Git - libvpx/commit
Amend and improve VP8 multithreading implementation
authorYunqing Wang <yunqingwang@google.com>
Thu, 7 Jan 2016 02:27:37 +0000 (18:27 -0800)
committerYunqing Wang <yunqingwang@google.com>
Fri, 8 Jan 2016 19:59:49 +0000 (11:59 -0800)
commitff0107f60dbddec82d7d7feacd1c9a3ff9ab4a51
tree0590f67ac2b1e9266a6b0cf4fbc144d3f9f69b00
parentb8c2a4eb0c47b633096f5c428b70607e7bf8d570
Amend and improve VP8 multithreading implementation

There are flaws in current implementation of VP8 multithreading encoder
and decoder as reported in the following issue:
https://code.google.com/p/chromium/issues/detail?id=158922

Although the data race warnings are harmless, and wouldn't cause real
problems while encoding and decoding videos, it is better to fix the
warnings so that VP8 code could pass the TSan test.

To synchronize the thread-shared data access and maintain the speed
(i.e. decoding speed), use multiple mutexes based on mb_rows to reduce
the number of synchronizations needed, make the reads and writes of
the shared data protected, and reduce the number of mb_col writes by
nsync times.

The decoder speed tests showed < 3% speed loss while using 2 ~ 4
threads.

Change-Id: Ie296defffcd86a693188b668270d811964227882
vp8/common/threading.h
vp8/decoder/onyxd_int.h
vp8/decoder/threading.c
vp8/encoder/encodeframe.c
vp8/encoder/ethreading.c
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h