History

Overflow of frame error accumulators.

This fixes an overflow problem in the frame error accumulators. The overflow condition is extreme but did trigger when Frank B. coded some high motion interlaced HD content. The observed effect was a catastrophic breakdown of the rate control leading to massive undershoot and poor bit allocation. All the error values should really be unsigned but I will look at this separately.

Paul Wilkins committed 15 years ago

Commit b862c101 parent aee120a1 file · +4 −4Browse files

Unified · Split

vp8/encoder/firstpass.c+4−4
@@ -560,8 +560,8 @@ void vp8_first_pass(VP8_COMP *cpi) · 559 unmodified lines
560 YV12_BUFFER_CONFIG *gld_yv12 = &cm->yv12_fb[cm->gld_fb_idx];560 YV12_BUFFER_CONFIG *gld_yv12 = &cm->yv12_fb[cm->gld_fb_idx];
561 int recon_y_stride = lst_yv12->y_stride;561 int recon_y_stride = lst_yv12->y_stride;
562 int recon_uv_stride = lst_yv12->uv_stride;562 int recon_uv_stride = lst_yv12->uv_stride;
563 int intra_error = 0;563 long long intra_error = 0;
564 int coded_error = 0;564 long long coded_error = 0;
565 565
566 int sum_mvr = 0, sum_mvc = 0;566 int sum_mvr = 0, sum_mvc = 0;
567 int sum_mvr_abs = 0, sum_mvc_abs = 0;567 int sum_mvr_abs = 0, sum_mvc_abs = 0;
@@ -648,7 +648,7 @@ void vp8_first_pass(VP8_COMP *cpi) · 80 unmodified lines
648 this_error += intrapenalty;648 this_error += intrapenalty;
649 649
650 // Cumulative intra error total650 // Cumulative intra error total
651 intra_error += this_error;651 intra_error += (long long)this_error;
652 652
653 // Indicate default assumption of intra in the motion map653 // Indicate default assumption of intra in the motion map
654 *fp_motion_map_ptr = 0;654 *fp_motion_map_ptr = 0;
@@ -800,7 +800,7 @@ void vp8_first_pass(VP8_COMP *cpi) · 145 unmodified lines
800 }800 }
801 }801 }
802 802
803 coded_error += this_error;803 coded_error += (long long)this_error;
804 804
805 // adjust to the next column of macroblocks805 // adjust to the next column of macroblocks
806 x->src.y_buffer += 16;806 x->src.y_buffer += 16;

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