av1/encoder/encode_strategy.c
// Determine whether there is a forced keyframe pending in the lookahead buffer
Determine whether there is a forced keyframe pending in the lookahead buffer
Determine whether there is a forced keyframe pending in the lookahead buffer
int is_forced_keyframe_pending(struct lookahead_ctx *lookahead,
                               const int up_to_index,
                               const COMPRESSOR_STAGE compressor_stage) {
  for (int i = 0; i <= up_to_index; i++) {
    const struct lookahead_entry *e =
        av1_lookahead_peek(lookahead, i, compressor_stage);
    if (e == NULL) {
      return -1;
    } else if (e->flags == AOM_EFLAG_FORCE_KF) {
      return (i + 1);
    } else {
      continue;
    }
  }
  return -1;  
}
int is_forced_keyframe_pending ( struct lookahead_ctx * lookahead , const int up_to_index , const COMPRESSOR_STAGE compressor_stage ) { for ( int i = 0 ; i <= up_to_index ; i ++ ) { const struct lookahead_entry * e = av1_lookahead_peek ( lookahead , i , compressor_stage ) ; if ( e == NULL ) { return -1 ; } else if ( e -> flags == AOM_EFLAG_FORCE_KF ) { return ( i + 1 ) ; } else { continue ; } } return -1 ; }
Determine whether there is a forced keyframe pending in the lookahead buffer
Determine whether there is a forced keyframe pending in the lookahead buffer
// We have reached the end of the lookahead buffer and not early-returned // so there isn't a forced key-frame pending. // Never reached