diff options
author | Jingning Han <jingning@google.com> | 2018-09-10 11:55:10 -0700 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2018-09-10 12:00:08 -0700 |
commit | 9868499e4b6a2f986017c62a5adc6f1933fe992f (patch) | |
tree | 21c9d3379476b7381ba873170c81eefb3ab49daf /vp9/encoder/vp9_encoder.c | |
parent | 740083a97bb3ef0a11e45977611402a047099cfb (diff) | |
download | libvpx-9868499e4b6a2f986017c62a5adc6f1933fe992f.tar libvpx-9868499e4b6a2f986017c62a5adc6f1933fe992f.tar.gz libvpx-9868499e4b6a2f986017c62a5adc6f1933fe992f.tar.bz2 libvpx-9868499e4b6a2f986017c62a5adc6f1933fe992f.zip |
Rework two_pass_first_group_inter()
This function is used to in part decide if to trigger recode loop
for the first normal P frame in a GOP. Rework its design logic to
support the GOP with multi-layer ARF. Allow recode when there is
a transition from ARF/OVERLAY/USE_BUF to normal P frame.
The overall coding performance for multi-ARF gets slightly better
(less than 0.1% for show_existing_frame case). Tested on a few
clips, the encoding speed remains similar too. This change primarily
serves to help integration of multi-layer ARF and dual-ARF systems.
Change-Id: Ia44e44526b05029b1546985b3eb649e767d5444f
Diffstat (limited to 'vp9/encoder/vp9_encoder.c')
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 69ab0445c..dae718b99 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -2921,9 +2921,12 @@ static int big_rate_miss(VP9_COMP *cpi) { static int two_pass_first_group_inter(VP9_COMP *cpi) { TWO_PASS *const twopass = &cpi->twopass; GF_GROUP *const gf_group = &twopass->gf_group; - if ((cpi->oxcf.pass == 2) && - (gf_group->index == gf_group->first_inter_index)) { - return 1; + const int gfg_index = gf_group->index; + + if (cpi->oxcf.pass == 2) { + if (gfg_index == 0) return gf_group->update_type[gfg_index] == LF_UPDATE; + return gf_group->update_type[gfg_index - 1] != LF_UPDATE && + gf_group->update_type[gfg_index] == LF_UPDATE; } else { return 0; } |