Skip to content

Commit

Permalink
rtc-vp9: Allow scene detection for all speeds
Browse files Browse the repository at this point in the history
Current code was disallowing scene detection for
speeds >= 8, to avoid any encode_time increase
(see comment in the code).

But we can expect the cost to be small even at speed 8,9,
and that concern on encode_time was from some time ago
before 8 and 9 were further optimized. And this is
needed for content with scene changes (see issue attached).
So allow scene detection now for all RTC speed settings (speed >= 5).

Bug: b/346846607
Change-Id: I678dbb88ff1399ed89b2bf9770ae9427e3044fc4
  • Loading branch information
marco99zz committed Jun 18, 2024
1 parent f07ca82 commit 253d636
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions vp9/encoder/vp9_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -4098,16 +4098,14 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
#endif

// Scene detection is always used for VBR mode or screen-content case.
// For other cases (e.g., CBR mode) use it for 5 <= speed < 8 for now
// (need to check encoding time cost for doing this for speed 8).
// For other cases (e.g., CBR mode) use it for 5 <= speed.
cpi->rc.high_source_sad = 0;
cpi->rc.hybrid_intra_scene_change = 0;
cpi->rc.re_encode_maxq_scene_change = 0;
if (cm->show_frame && cpi->oxcf.mode == REALTIME &&
!cpi->disable_scene_detection_rtc_ratectrl &&
(cpi->oxcf.rc_mode == VPX_VBR ||
cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
(cpi->oxcf.speed >= 5 && cpi->oxcf.speed < 8)))
cpi->oxcf.content == VP9E_CONTENT_SCREEN || cpi->oxcf.speed >= 5))
vp9_scene_detection_onepass(cpi);

if (svc->spatial_layer_id == svc->first_spatial_layer_to_encode) {
Expand Down

0 comments on commit 253d636

Please sign in to comment.