rtc: Set nonrd keyframe under dynamic change of deadline
authorMarco Paniconi <marpan@google.com>
Tue, 21 Nov 2023 22:00:16 +0000 (14:00 -0800)
committerMarco Paniconi <marpan@google.com>
Tue, 28 Nov 2023 04:08:57 +0000 (20:08 -0800)
commitadebf364cb7ea098a366108acae8cf01595388fa
tree104ae167642e0c7f422158698e57850deadf41ca
parentd7358ed53a6b344f6f374b3a5e8fe3d207bcc720
rtc: Set nonrd keyframe under dynamic change of deadline

For realtime mode: if the deadline mode (good/best/realtime)
is changed on the fly (via codec_encode() call), force a
key frame and set the speed feature nonrd_keyframe = 1 to
avoid entering the rd pickmode.

nonrd_pickmode=0/off is the only feature in realtime mode that
involves rd pickmode, so by forcing it on/1 we can cleanly
separate nonrd (realtime) from rd (good/best), so we can
avoid possible issues on this dynamic mode switch, such as in
bug listed below.

Dynamic change of deadline, in particular for realtime mode,
involves a lot of coding/speed feature changes, so best to
also force reset with keyframe.

Added unitest that triggers the issue in the bug.
Bug: b/310663186

Change-Id: Idf8fd7c9ee54b301968184be5481ee9faa06468d
test/encode_api_test.cc
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/encoder/vp9_ratectrl.c
vp9/encoder/vp9_speed_features.c