From a62c87fb046997848a0b4cf834366b453aef4a83 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 17 Nov 2014 11:21:42 -0800 Subject: [PATCH] Add empty pointer check to pred buffering in rtc coding mode This commit adds a check condition to the prediction buffering operation used in the rtc coding mode. This resolves a unit test warning in example/vpx_tsvc_encoder_vp9_mode_7. Change-Id: I9fd50d5956948b73b53bd8fc5a16ee66aff61995 --- vp9/encoder/vp9_pickmode.c | 39 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 358bedd33..23575b0ee 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -802,13 +802,14 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, MIN(max_txsize_lookup[bsize], tx_mode_to_biggest_tx_size[cpi->common.tx_mode]); - if (best_pred != NULL && reuse_inter_pred && - best_pred->data == orig_dst.buf) { - this_mode_pred = &tmp[get_pred_buffer(tmp, 3)]; - vp9_convolve_copy(best_pred->data, best_pred->stride, - this_mode_pred->data, this_mode_pred->stride, - NULL, 0, NULL, 0, bw, bh); - best_pred = this_mode_pred; + if (reuse_inter_pred && best_pred != NULL) { + if (best_pred->data == orig_dst.buf) { + this_mode_pred = &tmp[get_pred_buffer(tmp, 3)]; + vp9_convolve_copy(best_pred->data, best_pred->stride, + this_mode_pred->data, this_mode_pred->stride, + NULL, 0, NULL, 0, bw, bh); + best_pred = this_mode_pred; + } } pd->dst = orig_dst; @@ -844,22 +845,24 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, } pd->dst = orig_dst; - if (reuse_inter_pred && best_pred->data != orig_dst.buf && - is_inter_mode(mbmi->mode)) { + + if (reuse_inter_pred && best_pred != NULL) { + if (best_pred->data != orig_dst.buf && is_inter_mode(mbmi->mode)) { #if CONFIG_VP9_HIGHBITDEPTH - if (cm->use_highbitdepth) - vp9_highbd_convolve_copy(best_pred->data, best_pred->stride, - pd->dst.buf, pd->dst.stride, NULL, 0, - NULL, 0, bw, bh, xd->bd); - else + if (cm->use_highbitdepth) + vp9_highbd_convolve_copy(best_pred->data, best_pred->stride, + pd->dst.buf, pd->dst.stride, NULL, 0, + NULL, 0, bw, bh, xd->bd); + else + vp9_convolve_copy(best_pred->data, best_pred->stride, + pd->dst.buf, pd->dst.stride, NULL, 0, + NULL, 0, bw, bh); +#else vp9_convolve_copy(best_pred->data, best_pred->stride, pd->dst.buf, pd->dst.stride, NULL, 0, NULL, 0, bw, bh); -#else - vp9_convolve_copy(best_pred->data, best_pred->stride, - pd->dst.buf, pd->dst.stride, NULL, 0, - NULL, 0, bw, bh); #endif + } } if (is_inter_block(mbmi)) -- 2.40.0