summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2012-08-21 09:28:10 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-08-21 09:28:10 -0700
commit272974af361993de7a38896155f9600cbe1c07ba (patch)
tree47a62bed40b332053ce402e7ccdf5531334b7de4
parent6cb50ce5274d9a992351971b8eba1f5c41ee1adb (diff)
parent8ee88da060140df61d937e633f718637a298f1fc (diff)
downloadlibvpx-272974af361993de7a38896155f9600cbe1c07ba.tar
libvpx-272974af361993de7a38896155f9600cbe1c07ba.tar.gz
libvpx-272974af361993de7a38896155f9600cbe1c07ba.tar.bz2
libvpx-272974af361993de7a38896155f9600cbe1c07ba.zip
Merge "Fix inter_zz_count calculation bug"
-rw-r--r--vp8/encoder/encodeframe.c7
-rw-r--r--vp8/encoder/ethreading.c4
-rw-r--r--vp8/encoder/onyx_if.c24
3 files changed, 24 insertions, 11 deletions
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c
index 4d73d470f..600e815dd 100644
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -523,10 +523,6 @@ void encode_mb_row(VP8_COMP *cpi,
#endif
- /* Count of last ref frame 0,0 usage */
- if ((xd->mode_info_context->mbmi.mode == ZEROMV) && (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME))
- cpi->inter_zz_count ++;
-
/* Special case code for cyclic refresh
* If cyclic update enabled then copy xd->mbmi.segment_id; (which
* may have been updated based on mode during
@@ -721,9 +717,6 @@ void vp8_encode_frame(VP8_COMP *cpi)
xd->subpixel_predict16x16 = vp8_bilinear_predict16x16;
}
- /* Reset frame count of inter 0,0 motion vector usage. */
- cpi->inter_zz_count = 0;
-
cpi->prediction_error = 0;
cpi->intra_error = 0;
cpi->skip_true_count = 0;
diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c
index e0bb1b09f..d92462b85 100644
--- a/vp8/encoder/ethreading.c
+++ b/vp8/encoder/ethreading.c
@@ -213,10 +213,6 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
#endif
- /* Count of last ref frame 0,0 usage */
- if ((xd->mode_info_context->mbmi.mode == ZEROMV) && (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME))
- cpi->inter_zz_count++;
-
/* Special case code for cyclic refresh
* If cyclic update enabled then copy
* xd->mbmi.segment_id; (which may have been updated
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