// The recovery after a flash is indicated by a high pcnt_second_ref
// useage or a second ref coded error notabley lower than the last
// frame coded error.
- if (frame_stats == 0) {
+ if (frame_stats == NULL) {
return 0;
}
return (frame_stats->sr_coded_error < frame_stats->coded_error) ||
// Search forward from the proposed arf/next gf position.
for (i = 0; i < f_frames; ++i) {
const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i);
+ const FIRSTPASS_STATS *next_frame = read_frame_stats(twopass, i + 1);
if (this_frame == NULL) break;
// Update the motion related elements to the boost calculation.
// We want to discount the flash frame itself and the recovery
// frame that follows as both will have poor scores.
- flash_detected = detect_flash(twopass, i) || detect_flash(twopass, i + 1);
+ flash_detected = detect_flash_from_frame_stats(this_frame) ||
+ detect_flash_from_frame_stats(next_frame);
// Accumulate the effect of prediction quality decay.
if (!flash_detected) {
// Search backward towards last gf position.
for (i = -1; i >= -b_frames; --i) {
const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i);
+ const FIRSTPASS_STATS *next_frame = read_frame_stats(twopass, i + 1);
if (this_frame == NULL) break;
// Update the motion related elements to the boost calculation.
// We want to discount the the flash frame itself and the recovery
// frame that follows as both will have poor scores.
- flash_detected = detect_flash(twopass, i) || detect_flash(twopass, i + 1);
+ flash_detected = detect_flash_from_frame_stats(this_frame) ||
+ detect_flash_from_frame_stats(next_frame);
// Cumulative effect of prediction quality decay.
if (!flash_detected) {