Rockchip: Do not reset rate control if no parameters changed

Current code always resets rate control algorithm whenever
rk_vp8_encoder_setconfig() is called. However the function can be also
used to request a keyframe. In addition, it might be possible to call
this function with the same parameters as already set, which would cause
rate control to be reset unnecessarily.

To fix the problem, this patch modifies the code to perform the reset only
if bit rate or frame rate actually changed. To achieve this the internal
API is slightly modified to avoid accessing private parameters
(outRateDenom, outRateNum and encStatus of internal vp8Instance_s struct)
from external code (e.g. rk_vpu8_encoder_setconfig()) and explicitly convey
the dependence of VP8EncSetRateCtrl() on these private parameters,
which are now explicitly given to this function.

BUG=chrome-os-partner:37204
TEST=video_encode_accelerator_unittest (after 4fc28962e2da8b3f278b952c55fefe10487db952);apprtc

Change-Id: Iff4787f6ac55a0324e63b80d272dfd04aadd084c
Reviewed-on: https://chromium-review.googlesource.com/253252
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
3 files changed
tree: 4c0b32ecaf018318d5dfb2e74e2aa22c3d16209a
  1. libv4l-rockchip/
  2. OWNERS