summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorScott LaVarnway <slavarnway@google.com>2011-02-28 10:16:32 -0800
committerCode Review <code-review@webmproject.org>2011-02-28 10:16:33 -0800
commit3e6d476ac35bd607650ddae398153764f99a934e (patch)
tree7e1ad0f33fc345a9dfdaa39d6ddd6b5381453b41 /vp8
parent4decd27947477bbaebce5aa6f2d384cd50a37fc6 (diff)
parentd8fc974ac0b698e53173477ecdafcc9300ca5ea8 (diff)
downloadlibvpx-3e6d476ac35bd607650ddae398153764f99a934e.tar
libvpx-3e6d476ac35bd607650ddae398153764f99a934e.tar.gz
libvpx-3e6d476ac35bd607650ddae398153764f99a934e.tar.bz2
libvpx-3e6d476ac35bd607650ddae398153764f99a934e.zip
Merge "Avoid double copying of key frames into alt and golden buffer"
Diffstat (limited to 'vp8')
-rw-r--r--vp8/encoder/onyx_if.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 55a7f9c21..5dc579d10 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -3124,8 +3124,11 @@ static void update_golden_frame_and_stats(VP8_COMP *cpi)
// Update the Golden frame reconstruction buffer if signalled and the GF usage counts.
if (cm->refresh_golden_frame)
{
- // Update the golden frame buffer
- vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
+ if (cm->frame_type != KEY_FRAME)
+ {
+ // Update the golden frame buffer
+ vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
+ }
// Select an interval before next GF
if (!cpi->auto_gold)
@@ -4742,16 +4745,19 @@ static void encode_frame_to_data_rate
if (cpi->oxcf.error_resilient_mode)
{
- // Is this an alternate reference update
- if (cpi->common.refresh_alt_ref_frame)
- vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->alt_fb_idx]);
+ if (cm->frame_type != KEY_FRAME)
+ {
+ // Is this an alternate reference update
+ if (cm->refresh_alt_ref_frame)
+ vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->alt_fb_idx]);
- if (cpi->common.refresh_golden_frame)
- vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
+ if (cm->refresh_golden_frame)
+ vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
+ }
}
else
{
- if (cpi->oxcf.play_alternate && cpi->common.refresh_alt_ref_frame && (cpi->common.frame_type != KEY_FRAME))
+ if (cpi->oxcf.play_alternate && cm->refresh_alt_ref_frame && (cm->frame_type != KEY_FRAME))
// Update the alternate reference frame and stats as appropriate.
update_alt_ref_frame_and_stats(cpi);
else