diff options
author | John Koleszar <jkoleszar@google.com> | 2011-05-27 12:35:06 -0700 |
---|---|---|
committer | Code Review <code-review@webmproject.org> | 2011-05-27 12:35:06 -0700 |
commit | 4a4ade6dc8d6b4af4848c830a359b4a0fc81d1a5 (patch) | |
tree | 79f0958408416d8bd8546c61eb0d1e5b53b3f1cb /vp8 | |
parent | 4fb5ce6a920f2a0cdce231d81e98daacf84b8b15 (diff) | |
parent | 8795b52512b69193d91d27776513439fa96a9604 (diff) | |
download | libvpx-4a4ade6dc8d6b4af4848c830a359b4a0fc81d1a5.tar libvpx-4a4ade6dc8d6b4af4848c830a359b4a0fc81d1a5.tar.gz libvpx-4a4ade6dc8d6b4af4848c830a359b4a0fc81d1a5.tar.bz2 libvpx-4a4ade6dc8d6b4af4848c830a359b4a0fc81d1a5.zip |
Merge "bug fix check frame buffer index before copy"
Diffstat (limited to 'vp8')
-rw-r--r-- | vp8/encoder/onyx_if.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 35ba28b7f..9892f8078 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -3103,15 +3103,21 @@ void update_reference_frames(VP8_COMMON *cm) if (cm->copy_buffer_to_arf == 1) { - yv12_fb[cm->lst_fb_idx].flags |= VP8_ALT_FLAG; - yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALT_FLAG; - cm->alt_fb_idx = cm->lst_fb_idx; + if(cm->alt_fb_idx != cm->lst_fb_idx) + { + yv12_fb[cm->lst_fb_idx].flags |= VP8_ALT_FLAG; + yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALT_FLAG; + cm->alt_fb_idx = cm->lst_fb_idx; + } } else /* if (cm->copy_buffer_to_arf == 2) */ { - yv12_fb[cm->gld_fb_idx].flags |= VP8_ALT_FLAG; - yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALT_FLAG; - cm->alt_fb_idx = cm->gld_fb_idx; + if(cm->alt_fb_idx != cm->gld_fb_idx) + { + yv12_fb[cm->gld_fb_idx].flags |= VP8_ALT_FLAG; + yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALT_FLAG; + cm->alt_fb_idx = cm->gld_fb_idx; + } } } @@ -3129,15 +3135,21 @@ void update_reference_frames(VP8_COMMON *cm) if (cm->copy_buffer_to_gf == 1) { - yv12_fb[cm->lst_fb_idx].flags |= VP8_GOLD_FLAG; - yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FLAG; - cm->gld_fb_idx = cm->lst_fb_idx; + if(cm->gld_fb_idx != cm->lst_fb_idx) + { + yv12_fb[cm->lst_fb_idx].flags |= VP8_GOLD_FLAG; + yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FLAG; + cm->gld_fb_idx = cm->lst_fb_idx; + } } else /* if (cm->copy_buffer_to_gf == 2) */ { - yv12_fb[cm->alt_fb_idx].flags |= VP8_GOLD_FLAG; - yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FLAG; - cm->gld_fb_idx = cm->alt_fb_idx; + if(cm->alt_fb_idx != cm->gld_fb_idx) + { + yv12_fb[cm->alt_fb_idx].flags |= VP8_GOLD_FLAG; + yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FLAG; + cm->gld_fb_idx = cm->alt_fb_idx; + } } } } |