Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: source/libvpx/vp9/encoder/vp9_pickmode.c

Issue 996503002: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_mcomp.c ('k') | source/libvpx/vp9/encoder/vp9_quantize.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 if (rv) { 185 if (rv) {
186 cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv, 186 cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv,
187 cpi->common.allow_high_precision_mv, 187 cpi->common.allow_high_precision_mv,
188 x->errorperbit, 188 x->errorperbit,
189 &cpi->fn_ptr[bsize], 189 &cpi->fn_ptr[bsize],
190 cpi->sf.mv.subpel_force_stop, 190 cpi->sf.mv.subpel_force_stop,
191 cpi->sf.mv.subpel_iters_per_step, 191 cpi->sf.mv.subpel_iters_per_step,
192 cond_cost_list(cpi, cost_list), 192 cond_cost_list(cpi, cost_list),
193 x->nmvjointcost, x->mvcost, 193 x->nmvjointcost, x->mvcost,
194 &dis, &x->pred_sse[ref], NULL, 0, 0); 194 &dis, &x->pred_sse[ref], NULL, 0, 0);
195 x->pred_mv[ref] = tmp_mv->as_mv;
196 } 195 }
197 196
198 if (scaled_ref_frame) { 197 if (scaled_ref_frame) {
199 int i; 198 int i;
200 for (i = 0; i < MAX_MB_PLANE; i++) 199 for (i = 0; i < MAX_MB_PLANE; i++)
201 xd->plane[i].pre[0] = backup_yv12[i]; 200 xd->plane[i].pre[0] = backup_yv12[i];
202 } 201 }
203 return rv; 202 return rv;
204 } 203 }
205 204
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 mbmi->tx_size = MIN(max_txsize_lookup[bsize], 682 mbmi->tx_size = MIN(max_txsize_lookup[bsize],
684 tx_mode_to_biggest_tx_size[cm->tx_mode]); 683 tx_mode_to_biggest_tx_size[cm->tx_mode]);
685 mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? 684 mbmi->interp_filter = cm->interp_filter == SWITCHABLE ?
686 EIGHTTAP : cm->interp_filter; 685 EIGHTTAP : cm->interp_filter;
687 686
688 #if CONFIG_VP9_TEMPORAL_DENOISING 687 #if CONFIG_VP9_TEMPORAL_DENOISING
689 vp9_denoiser_reset_frame_stats(ctx); 688 vp9_denoiser_reset_frame_stats(ctx);
690 #endif 689 #endif
691 690
692 for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) { 691 for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) {
692 const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
693
693 x->pred_mv_sad[ref_frame] = INT_MAX; 694 x->pred_mv_sad[ref_frame] = INT_MAX;
694 frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; 695 frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
695 frame_mv[ZEROMV][ref_frame].as_int = 0; 696 frame_mv[ZEROMV][ref_frame].as_int = 0;
696 697
697 if (cpi->ref_frame_flags & flag_list[ref_frame]) { 698 if ((cpi->ref_frame_flags & flag_list[ref_frame]) && (yv12 != NULL)) {
698 const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
699 int_mv *const candidates = mbmi->ref_mvs[ref_frame]; 699 int_mv *const candidates = mbmi->ref_mvs[ref_frame];
700 const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf; 700 const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
701 701
702 vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, 702 vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col,
703 sf, sf); 703 sf, sf);
704 704
705 if (cm->use_prev_frame_mvs) 705 if (cm->use_prev_frame_mvs)
706 vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0].src_mi, ref_frame, 706 vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0].src_mi, ref_frame,
707 candidates, mi_row, mi_col, NULL, NULL); 707 candidates, mi_row, mi_col, NULL, NULL);
708 else 708 else
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 b_mode_info bsi[MAX_REF_FRAMES][4]; 1070 b_mode_info bsi[MAX_REF_FRAMES][4];
1071 int ref_frame_skip_mask = 0; 1071 int ref_frame_skip_mask = 0;
1072 const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize]; 1072 const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
1073 const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize]; 1073 const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
1074 int idx, idy; 1074 int idx, idy;
1075 1075
1076 x->skip_encode = sf->skip_encode_frame && x->q_index < QIDX_SKIP_THRESH; 1076 x->skip_encode = sf->skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
1077 ctx->pred_pixel_ready = 0; 1077 ctx->pred_pixel_ready = 0;
1078 1078
1079 for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) { 1079 for (ref_frame = LAST_FRAME; ref_frame <= GOLDEN_FRAME; ++ref_frame) {
1080 const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
1080 int_mv dummy_mv[2]; 1081 int_mv dummy_mv[2];
1081 x->pred_mv_sad[ref_frame] = INT_MAX; 1082 x->pred_mv_sad[ref_frame] = INT_MAX;
1082 1083
1083 if (cpi->ref_frame_flags & flag_list[ref_frame]) { 1084 if ((cpi->ref_frame_flags & flag_list[ref_frame]) && (yv12 != NULL)) {
1084 const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
1085 int_mv *const candidates = mbmi->ref_mvs[ref_frame]; 1085 int_mv *const candidates = mbmi->ref_mvs[ref_frame];
1086 const struct scale_factors *const sf = 1086 const struct scale_factors *const sf =
1087 &cm->frame_refs[ref_frame - 1].sf; 1087 &cm->frame_refs[ref_frame - 1].sf;
1088 vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, 1088 vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col,
1089 sf, sf); 1089 sf, sf);
1090 vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0].src_mi, ref_frame, 1090 vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0].src_mi, ref_frame,
1091 candidates, mi_row, mi_col, NULL, NULL); 1091 candidates, mi_row, mi_col, NULL, NULL);
1092 1092
1093 vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates, 1093 vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates,
1094 &dummy_mv[0], &dummy_mv[1]); 1094 &dummy_mv[0], &dummy_mv[1]);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 xd->mi[0].bmi[block + 2] = bsi[best_ref_frame][block]; 1306 xd->mi[0].bmi[block + 2] = bsi[best_ref_frame][block];
1307 } 1307 }
1308 } 1308 }
1309 mbmi->mode = xd->mi[0].bmi[3].as_mode; 1309 mbmi->mode = xd->mi[0].bmi[3].as_mode;
1310 ctx->mic = *(xd->mi[0].src_mi); 1310 ctx->mic = *(xd->mi[0].src_mi);
1311 ctx->skip_txfm[0] = 0; 1311 ctx->skip_txfm[0] = 0;
1312 ctx->skip = 0; 1312 ctx->skip = 0;
1313 // Dummy assignment for speed -5. No effect in speed -6. 1313 // Dummy assignment for speed -5. No effect in speed -6.
1314 rd_cost->rdcost = best_rd; 1314 rd_cost->rdcost = best_rd;
1315 } 1315 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_mcomp.c ('k') | source/libvpx/vp9/encoder/vp9_quantize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698