diff options
author | Jim Bankoski <jimbankoski@google.com> | 2014-01-15 15:30:13 -0800 |
---|---|---|
committer | Jim Bankoski <jimbankoski@google.com> | 2014-01-15 15:30:13 -0800 |
commit | 3977e64fc78e4d30bbbceaa0432a86c49a343e2b (patch) | |
tree | 79463a402efcafaf8f4bc263ae55efe79a0f1f0e /vp9 | |
parent | ae5b96d3554636acb4e5d7c7ce58905f2b625ac1 (diff) | |
download | libvpx-3977e64fc78e4d30bbbceaa0432a86c49a343e2b.tar libvpx-3977e64fc78e4d30bbbceaa0432a86c49a343e2b.tar.gz libvpx-3977e64fc78e4d30bbbceaa0432a86c49a343e2b.tar.bz2 libvpx-3977e64fc78e4d30bbbceaa0432a86c49a343e2b.zip |
don't dummy pack if we won't recode
Avoid packing the bitstream 2 times unless we need to. For me this
at speed -5 was a 2% speed up.
Change-Id: I32205c98f55eedd4ff031ed5fb498c84bdaa855d
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 3af950548..ac33e6619 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -2681,14 +2681,16 @@ static void encode_with_recode_loop(VP9_COMP *cpi, // Dummy pack of the bitstream using up to date stats to get an // accurate estimate of output frame size to determine if we need // to recode. - vp9_save_coding_context(cpi); - cpi->dummy_packing = 1; - vp9_pack_bitstream(cpi, dest, size); - cpi->rc.projected_frame_size = (*size) << 3; - vp9_restore_coding_context(cpi); - - if (frame_over_shoot_limit == 0) - frame_over_shoot_limit = 1; + if (cpi->sf.recode_loop != 0) { + vp9_save_coding_context(cpi); + cpi->dummy_packing = 1; + vp9_pack_bitstream(cpi, dest, size); + cpi->rc.projected_frame_size = (*size) << 3; + vp9_restore_coding_context(cpi); + + if (frame_over_shoot_limit == 0) + frame_over_shoot_limit = 1; + } if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) { loop = 0; |