Fix loopfilter race condition in multithreaded encoder
authorAttila Nagy <attilanagy@google.com>
Wed, 25 Apr 2012 11:04:55 +0000 (14:04 +0300)
committerAttila Nagy <attilanagy@google.com>
Wed, 25 Apr 2012 11:26:02 +0000 (14:26 +0300)
commit3939e85b26523a1b1ff2ff8dffe86387e7133c37
tree6811fdcb4de1f61dd7f584b43df83490d2b534c1
parentdba053898a662923e8750021314e1e90d0b92f80
Fix loopfilter race condition in multithreaded encoder

Race was introduced by https://gerrit.chromium.org/gerrit/15563.

If loopfilter related config params were changed between frames, or
after a KEY frame, there could be a mismatch between encoder's and
decoder's recontructed image. In worst case, when frame buffers are
reallocated because of a size change, the loopfilter could
do an invalid data access (segmentation fault).

Fixes:
Sync with the loopfilter before applying any encoder changes in
vp8_change_config().
Moved the loopfilter synching to the top of
encode_frame_to_data_rate() so that it's done before any alteration of
the encoder.

Change-Id: Ide5245d2a2aeed78752de750c0110bc4b46f5b7b
vp8/encoder/onyx_if.c