History

Avoid double copying of key frames into alt and golden buffer

Attila Nagy committed 15 years ago

Commit d8fc9741 parent 861175e1 file · +14 −8Browse files

Unified · Split

vp8/encoder/onyx_if.c+14−8
@@ -3130,8 +3130,11 @@ static void update_golden_frame_and_stats(VP8_COMP *cpi) · 3129 unmodified lines
31303130 // Update the Golden frame reconstruction buffer if signalled and the GF usage counts.
31313131 if (cm->refresh_golden_frame)
31323132 {
3133− // Update the golden frame buffer
3134− vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
3133+ if (cm->frame_type != KEY_FRAME)
3134+ {
3135+ // Update the golden frame buffer
3136+ vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
3137+ }
31353138
31363139 // Select an interval before next GF
31373140 if (!cpi->auto_gold)
@@ -4748,16 +4751,19 @@ static void encode_frame_to_data_rate · 1610 unmodified lines
47484751
47494752 if (cpi->oxcf.error_resilient_mode)
47504753 {
4751− // Is this an alternate reference update
4752− if (cpi->common.refresh_alt_ref_frame)
4753− vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->alt_fb_idx]);
4754+ if (cm->frame_type != KEY_FRAME)
4755+ {
4756+ // Is this an alternate reference update
4757+ if (cm->refresh_alt_ref_frame)
4758+ vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->alt_fb_idx]);
47544759
4755− if (cpi->common.refresh_golden_frame)
4756− vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
4760+ if (cm->refresh_golden_frame)
4761+ vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]);
4762+ }
47574763 }
47584764 else
47594765 {
4760− if (cpi->oxcf.play_alternate && cpi->common.refresh_alt_ref_frame && (cpi->common.frame_type != KEY_FRAME))
4766+ if (cpi->oxcf.play_alternate && cm->refresh_alt_ref_frame && (cm->frame_type != KEY_FRAME))
47614767 // Update the alternate reference frame and stats as appropriate.
47624768 update_alt_ref_frame_and_stats(cpi);
47634769 else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t