| OLD | NEW |
| 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 int mdcounts[4]; | 583 int mdcounts[4]; |
| 584 int best_rd = INT_MAX; | 584 int best_rd = INT_MAX; |
| 585 int rd_adjustment = 100; | 585 int rd_adjustment = 100; |
| 586 int best_intra_rd = INT_MAX; | 586 int best_intra_rd = INT_MAX; |
| 587 int mode_index; | 587 int mode_index; |
| 588 int rate; | 588 int rate; |
| 589 int rate2; | 589 int rate2; |
| 590 int distortion2; | 590 int distortion2; |
| 591 int bestsme = INT_MAX; | 591 int bestsme = INT_MAX; |
| 592 int best_mode_index = 0; | 592 int best_mode_index = 0; |
| 593 unsigned int sse = INT_MAX, best_rd_sse = INT_MAX; | 593 unsigned int sse = UINT_MAX, best_rd_sse = UINT_MAX; |
| 594 #if CONFIG_TEMPORAL_DENOISING | 594 #if CONFIG_TEMPORAL_DENOISING |
| 595 unsigned int zero_mv_sse = INT_MAX, best_sse = INT_MAX; | 595 unsigned int zero_mv_sse = UINT_MAX, best_sse = UINT_MAX; |
| 596 #endif | 596 #endif |
| 597 | 597 |
| 598 int sf_improved_mv_pred = cpi->sf.improved_mv_pred; | 598 int sf_improved_mv_pred = cpi->sf.improved_mv_pred; |
| 599 int_mv mvp; | 599 int_mv mvp; |
| 600 | 600 |
| 601 int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7}; | 601 int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7}; |
| 602 int saddone=0; | 602 int saddone=0; |
| 603 /* search range got from mv_pred(). It uses step_param levels. (0-7) */ | 603 /* search range got from mv_pred(). It uses step_param levels. (0-7) */ |
| 604 int sr=0; | 604 int sr=0; |
| 605 | 605 |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 { | 1161 { |
| 1162 this_rdbin = 1023; | 1162 this_rdbin = 1023; |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 x->error_bins[this_rdbin] ++; | 1165 x->error_bins[this_rdbin] ++; |
| 1166 } | 1166 } |
| 1167 | 1167 |
| 1168 #if CONFIG_TEMPORAL_DENOISING | 1168 #if CONFIG_TEMPORAL_DENOISING |
| 1169 if (cpi->oxcf.noise_sensitivity) | 1169 if (cpi->oxcf.noise_sensitivity) |
| 1170 { | 1170 { |
| 1171 int block_index = mb_row * cpi->common.mb_cols + mb_col; |
| 1171 if (x->best_sse_inter_mode == DC_PRED) | 1172 if (x->best_sse_inter_mode == DC_PRED) |
| 1172 { | 1173 { |
| 1173 /* No best MV found. */ | 1174 /* No best MV found. */ |
| 1174 x->best_sse_inter_mode = best_mbmode.mode; | 1175 x->best_sse_inter_mode = best_mbmode.mode; |
| 1175 x->best_sse_mv = best_mbmode.mv; | 1176 x->best_sse_mv = best_mbmode.mv; |
| 1176 x->need_to_clamp_best_mvs = best_mbmode.need_to_clamp_mvs; | 1177 x->need_to_clamp_best_mvs = best_mbmode.need_to_clamp_mvs; |
| 1177 x->best_reference_frame = best_mbmode.ref_frame; | 1178 x->best_reference_frame = best_mbmode.ref_frame; |
| 1178 best_sse = best_rd_sse; | 1179 best_sse = best_rd_sse; |
| 1179 } | 1180 } |
| 1180 x->increase_denoising = 0; | 1181 x->increase_denoising = 0; |
| 1181 vp8_denoiser_denoise_mb(&cpi->denoiser, x, best_sse, zero_mv_sse, | 1182 vp8_denoiser_denoise_mb(&cpi->denoiser, x, best_sse, zero_mv_sse, |
| 1182 recon_yoffset, recon_uvoffset); | 1183 recon_yoffset, recon_uvoffset, |
| 1184 &cpi->common.lf_info, mb_row, mb_col, |
| 1185 block_index); |
| 1183 | 1186 |
| 1184 | 1187 |
| 1185 /* Reevaluate ZEROMV after denoising. */ | 1188 /* Reevaluate ZEROMV after denoising. */ |
| 1186 if (best_mbmode.ref_frame == INTRA_FRAME && | 1189 if (best_mbmode.ref_frame == INTRA_FRAME && |
| 1187 x->best_zeromv_reference_frame != INTRA_FRAME) | 1190 x->best_zeromv_reference_frame != INTRA_FRAME) |
| 1188 { | 1191 { |
| 1189 int this_rd = 0; | 1192 int this_rd = 0; |
| 1190 int this_ref_frame = x->best_zeromv_reference_frame; | 1193 int this_ref_frame = x->best_zeromv_reference_frame; |
| 1191 rate2 = x->ref_frame_cost[this_ref_frame] + | 1194 rate2 = x->ref_frame_cost[this_ref_frame] + |
| 1192 vp8_cost_mv_ref(ZEROMV, mdcounts); | 1195 vp8_cost_mv_ref(ZEROMV, mdcounts); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 error4x4 = pick_intra4x4mby_modes(x, &rate, | 1292 error4x4 = pick_intra4x4mby_modes(x, &rate, |
| 1290 &best_sse); | 1293 &best_sse); |
| 1291 if (error4x4 < error16x16) | 1294 if (error4x4 < error16x16) |
| 1292 { | 1295 { |
| 1293 xd->mode_info_context->mbmi.mode = B_PRED; | 1296 xd->mode_info_context->mbmi.mode = B_PRED; |
| 1294 best_rate = rate; | 1297 best_rate = rate; |
| 1295 } | 1298 } |
| 1296 | 1299 |
| 1297 *rate_ = best_rate; | 1300 *rate_ = best_rate; |
| 1298 } | 1301 } |
| OLD | NEW |