Update frame size in actual encoding
Issue explanation:
The unit test calls set_config function twice after encoding the
first frame.
The first call of set_config reduces frame width, but is still within
half of the first frame.
The second call reduces frame width even more, making is less than
half of the first frame, which according to the encoder logic,
there is no valid ref frames, and this frame should be set as a
forced keyframe. This leads to null pointer access in scale_factors
later.
Solution:
To make sure the correct detection of a forced key frame,
we need to update the frame width and height only when the actual
encoding is performed.
Bug: b/
311985118
Change-Id: Ie2cd3b760d4a4b399845693d7421c4eb11a12775
(cherry picked from commit
1ed56a46b3f6b18e1fb89a091e60d80ae20eec01)