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

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

Issue 898943004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 10 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_rd.c ('k') | source/libvpx/vp9/encoder/vp9_speed_features.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) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 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 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 MACROBLOCKD *const xd = &x->e_mbd; 2019 MACROBLOCKD *const xd = &x->e_mbd;
2020 MODE_INFO *const mi = xd->mi[0].src_mi; 2020 MODE_INFO *const mi = xd->mi[0].src_mi;
2021 int_mv *const candidates = mi->mbmi.ref_mvs[ref_frame]; 2021 int_mv *const candidates = mi->mbmi.ref_mvs[ref_frame];
2022 const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf; 2022 const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
2023 2023
2024 // TODO(jkoleszar): Is the UV buffer ever used here? If so, need to make this 2024 // TODO(jkoleszar): Is the UV buffer ever used here? If so, need to make this
2025 // use the UV scaling factors. 2025 // use the UV scaling factors.
2026 vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf, sf); 2026 vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf, sf);
2027 2027
2028 // Gets an initial list of candidate vectors from neighbours and orders them 2028 // Gets an initial list of candidate vectors from neighbours and orders them
2029 vp9_find_mv_refs(cm, xd, tile, mi, ref_frame, candidates, mi_row, mi_col); 2029 vp9_find_mv_refs(cm, xd, tile, mi, ref_frame, candidates, mi_row, mi_col,
2030 NULL, NULL);
2030 2031
2031 // Candidate refinement carried out at encoder and decoder 2032 // Candidate refinement carried out at encoder and decoder
2032 vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates, 2033 vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates,
2033 &frame_nearest_mv[ref_frame], 2034 &frame_nearest_mv[ref_frame],
2034 &frame_near_mv[ref_frame]); 2035 &frame_near_mv[ref_frame]);
2035 2036
2036 // Further refinement that is encode side only to test the top few candidates 2037 // Further refinement that is encode side only to test the top few candidates
2037 // in full and choose the best as the centre point for subsequent searches. 2038 // in full and choose the best as the centre point for subsequent searches.
2038 // The current implementation doesn't support scaling. 2039 // The current implementation doesn't support scaling.
2039 if (!vp9_is_scaled(sf) && block_size >= BLOCK_8X8) 2040 if (!vp9_is_scaled(sf) && block_size >= BLOCK_8X8)
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
3040 case ALTREF_FRAME: 3041 case ALTREF_FRAME:
3041 ref_frame_skip_mask[0] |= ALT_REF_MODE_MASK; 3042 ref_frame_skip_mask[0] |= ALT_REF_MODE_MASK;
3042 break; 3043 break;
3043 case NONE: 3044 case NONE:
3044 case MAX_REF_FRAMES: 3045 case MAX_REF_FRAMES:
3045 assert(0 && "Invalid Reference frame"); 3046 assert(0 && "Invalid Reference frame");
3046 break; 3047 break;
3047 } 3048 }
3048 } 3049 }
3049 3050
3050 if (ref_frame_skip_mask[0] & (1 << ref_frame) && 3051 if ((ref_frame_skip_mask[0] & (1 << ref_frame)) &&
3051 ref_frame_skip_mask[1] & (1 << MAX(0, second_ref_frame))) 3052 (ref_frame_skip_mask[1] & (1 << MAX(0, second_ref_frame))))
3052 continue; 3053 continue;
3053 3054
3054 if (mode_skip_mask[ref_frame] & (1 << this_mode)) 3055 if (mode_skip_mask[ref_frame] & (1 << this_mode))
3055 continue; 3056 continue;
3056 3057
3057 // Test best rd so far against threshold for trying this mode. 3058 // Test best rd so far against threshold for trying this mode.
3058 if (best_mode_skippable && sf->schedule_mode_search) 3059 if (best_mode_skippable && sf->schedule_mode_search)
3059 mode_threshold[mode_index] <<= 1; 3060 mode_threshold[mode_index] <<= 1;
3060 3061
3061 if (best_rd < mode_threshold[mode_index]) 3062 if (best_rd < mode_threshold[mode_index])
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
3743 ref_frame_skip_mask[0] |= (1 << GOLDEN_FRAME) | (1 << LAST_FRAME); 3744 ref_frame_skip_mask[0] |= (1 << GOLDEN_FRAME) | (1 << LAST_FRAME);
3744 break; 3745 break;
3745 case NONE: 3746 case NONE:
3746 case MAX_REF_FRAMES: 3747 case MAX_REF_FRAMES:
3747 assert(0 && "Invalid Reference frame"); 3748 assert(0 && "Invalid Reference frame");
3748 break; 3749 break;
3749 } 3750 }
3750 } 3751 }
3751 } 3752 }
3752 3753
3753 if (ref_frame_skip_mask[0] & (1 << ref_frame) && 3754 if ((ref_frame_skip_mask[0] & (1 << ref_frame)) &&
3754 ref_frame_skip_mask[1] & (1 << MAX(0, second_ref_frame))) 3755 (ref_frame_skip_mask[1] & (1 << MAX(0, second_ref_frame))))
3755 continue; 3756 continue;
3756 3757
3757 // Test best rd so far against threshold for trying this mode. 3758 // Test best rd so far against threshold for trying this mode.
3758 if (rd_less_than_thresh(best_rd, 3759 if (rd_less_than_thresh(best_rd,
3759 rd_opt->threshes[segment_id][bsize][ref_index], 3760 rd_opt->threshes[segment_id][bsize][ref_index],
3760 tile_data->thresh_freq_fact[bsize][ref_index])) 3761 tile_data->thresh_freq_fact[bsize][ref_index]))
3761 continue; 3762 continue;
3762 3763
3763 comp_pred = second_ref_frame > INTRA_FRAME; 3764 comp_pred = second_ref_frame > INTRA_FRAME;
3764 if (comp_pred) { 3765 if (comp_pred) {
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
4225 if (cm->interp_filter == SWITCHABLE) 4226 if (cm->interp_filter == SWITCHABLE)
4226 assert(best_filter_diff[SWITCHABLE_FILTERS] == 0); 4227 assert(best_filter_diff[SWITCHABLE_FILTERS] == 0);
4227 } else { 4228 } else {
4228 vp9_zero(best_filter_diff); 4229 vp9_zero(best_filter_diff);
4229 } 4230 }
4230 4231
4231 store_coding_context(x, ctx, best_ref_index, 4232 store_coding_context(x, ctx, best_ref_index,
4232 best_pred_diff, best_tx_diff, best_filter_diff, 0); 4233 best_pred_diff, best_tx_diff, best_filter_diff, 0);
4233 } 4234 }
4234 4235
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_rd.c ('k') | source/libvpx/vp9/encoder/vp9_speed_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698