• Yunqing Wang's avatar
    Amend and improve VP8 multithreading implementation · ff0107f6
    Yunqing Wang authored
    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
    ff0107f6