diff options
author | Yunqing Wang <yunqingwang@google.com> | 2012-08-20 17:31:44 -0700 |
---|---|---|
committer | Yunqing Wang <yunqingwang@google.com> | 2012-08-20 17:43:06 -0700 |
commit | 8ee88da060140df61d937e633f718637a298f1fc (patch) | |
tree | 2770f75a21d82067cb82ddd8f3c2a32ad92681f1 /vp8/encoder/onyx_if.c | |
parent | b0cfcb2ca875eeab1188e405a6980726ffa9b8b9 (diff) | |
download | libvpx-8ee88da060140df61d937e633f718637a298f1fc.tar libvpx-8ee88da060140df61d937e633f718637a298f1fc.tar.gz libvpx-8ee88da060140df61d937e633f718637a298f1fc.tar.bz2 libvpx-8ee88da060140df61d937e633f718637a298f1fc.zip |
Fix inter_zz_count calculation bug
The current way of counting inter_zz_count doesn't work correctly
in multi-threaded encoding. Calculating it after the frame is
encoded fixed the problem.
Change-Id: Ifcb1972cde950b8cc194f75c6d7b6af09e8b0e65
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r-- | vp8/encoder/onyx_if.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 22da51a7c..dc6080340 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -4298,6 +4298,30 @@ static void encode_frame_to_data_rate } } + /* Count last ref frame 0,0 usage on current encoded frame. */ + { + int mb_row; + int mb_col; + /* Point to beginning of MODE_INFO arrays. */ + MODE_INFO *tmp = cm->mi; + + cpi->inter_zz_count = 0; + + if(cm->frame_type != KEY_FRAME) + { + for (mb_row = 0; mb_row < cm->mb_rows; mb_row ++) + { + for (mb_col = 0; mb_col < cm->mb_cols; mb_col ++) + { + if(tmp->mbmi.mode == ZEROMV && tmp->mbmi.ref_frame == LAST_FRAME) + cpi->inter_zz_count++; + tmp++; + } + tmp++; + } + } + } + #if CONFIG_MULTI_RES_ENCODING vp8_cal_dissimilarity(cpi); #endif |