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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 cal_nmvsadcosts(cpi->mb.nmvsadcost); | 855 cal_nmvsadcosts(cpi->mb.nmvsadcost); |
856 | 856 |
857 cpi->mb.nmvcost_hp[0] = &cpi->mb.nmvcosts_hp[0][MV_MAX]; | 857 cpi->mb.nmvcost_hp[0] = &cpi->mb.nmvcosts_hp[0][MV_MAX]; |
858 cpi->mb.nmvcost_hp[1] = &cpi->mb.nmvcosts_hp[1][MV_MAX]; | 858 cpi->mb.nmvcost_hp[1] = &cpi->mb.nmvcosts_hp[1][MV_MAX]; |
859 cpi->mb.nmvsadcost_hp[0] = &cpi->mb.nmvsadcosts_hp[0][MV_MAX]; | 859 cpi->mb.nmvsadcost_hp[0] = &cpi->mb.nmvsadcosts_hp[0][MV_MAX]; |
860 cpi->mb.nmvsadcost_hp[1] = &cpi->mb.nmvsadcosts_hp[1][MV_MAX]; | 860 cpi->mb.nmvsadcost_hp[1] = &cpi->mb.nmvsadcosts_hp[1][MV_MAX]; |
861 cal_nmvsadcosts_hp(cpi->mb.nmvsadcost_hp); | 861 cal_nmvsadcosts_hp(cpi->mb.nmvsadcost_hp); |
862 | 862 |
863 #if CONFIG_DENOISING | 863 #if CONFIG_DENOISING |
864 #ifdef OUTPUT_YUV_DENOISED | 864 #ifdef OUTPUT_YUV_DENOISED |
865 if (cpi->oxcf.noise_sensitivity > 0) { | 865 yuv_denoised_file = fopen("denoised.yuv", "ab"); |
866 yuv_denoised_file = fopen("denoised.yuv", "ab"); | |
867 } | |
868 #endif | 866 #endif |
869 #endif | 867 #endif |
870 #ifdef OUTPUT_YUV_SRC | 868 #ifdef OUTPUT_YUV_SRC |
871 yuv_file = fopen("bd.yuv", "ab"); | 869 yuv_file = fopen("bd.yuv", "ab"); |
872 #endif | 870 #endif |
873 #ifdef OUTPUT_YUV_REC | 871 #ifdef OUTPUT_YUV_REC |
874 yuv_rec_file = fopen("rec.yuv", "wb"); | 872 yuv_rec_file = fopen("rec.yuv", "wb"); |
875 #endif | 873 #endif |
876 | 874 |
877 #if 0 | 875 #if 0 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 for (i = 0; i < sizeof(cpi->mbgraph_stats) / | 1113 for (i = 0; i < sizeof(cpi->mbgraph_stats) / |
1116 sizeof(cpi->mbgraph_stats[0]); ++i) { | 1114 sizeof(cpi->mbgraph_stats[0]); ++i) { |
1117 vpx_free(cpi->mbgraph_stats[i].mb_stats); | 1115 vpx_free(cpi->mbgraph_stats[i].mb_stats); |
1118 } | 1116 } |
1119 | 1117 |
1120 vp9_remove_common(&cpi->common); | 1118 vp9_remove_common(&cpi->common); |
1121 vpx_free(cpi); | 1119 vpx_free(cpi); |
1122 | 1120 |
1123 #if CONFIG_DENOISING | 1121 #if CONFIG_DENOISING |
1124 #ifdef OUTPUT_YUV_DENOISED | 1122 #ifdef OUTPUT_YUV_DENOISED |
1125 if (cpi->oxcf.noise_sensitivity > 0) { | 1123 fclose(yuv_denoised_file); |
1126 fclose(yuv_denoised_file); | |
1127 } | |
1128 #endif | 1124 #endif |
1129 #endif | 1125 #endif |
1130 #ifdef OUTPUT_YUV_SRC | 1126 #ifdef OUTPUT_YUV_SRC |
1131 fclose(yuv_file); | 1127 fclose(yuv_file); |
1132 #endif | 1128 #endif |
1133 #ifdef OUTPUT_YUV_REC | 1129 #ifdef OUTPUT_YUV_REC |
1134 fclose(yuv_rec_file); | 1130 fclose(yuv_rec_file); |
1135 #endif | 1131 #endif |
1136 | 1132 |
1137 #if 0 | 1133 #if 0 |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 cpi->zbin_mode_boost = 0; | 2089 cpi->zbin_mode_boost = 0; |
2094 cpi->zbin_mode_boost_enabled = 0; | 2090 cpi->zbin_mode_boost_enabled = 0; |
2095 | 2091 |
2096 // Current default encoder behavior for the altref sign bias. | 2092 // Current default encoder behavior for the altref sign bias. |
2097 cm->ref_frame_sign_bias[ALTREF_FRAME] = cpi->rc.source_alt_ref_active; | 2093 cm->ref_frame_sign_bias[ALTREF_FRAME] = cpi->rc.source_alt_ref_active; |
2098 | 2094 |
2099 // Set default state for segment based loop filter update flags. | 2095 // Set default state for segment based loop filter update flags. |
2100 cm->lf.mode_ref_delta_update = 0; | 2096 cm->lf.mode_ref_delta_update = 0; |
2101 | 2097 |
2102 // Initialize cpi->mv_step_param to default based on max resolution. | 2098 // Initialize cpi->mv_step_param to default based on max resolution. |
2103 cpi->mv_step_param = vp9_init_search_range(sf, max_mv_def); | 2099 cpi->mv_step_param = vp9_init_search_range(max_mv_def); |
2104 // Initialize cpi->max_mv_magnitude and cpi->mv_step_param if appropriate. | 2100 // Initialize cpi->max_mv_magnitude and cpi->mv_step_param if appropriate. |
2105 if (sf->mv.auto_mv_step_size) { | 2101 if (sf->mv.auto_mv_step_size) { |
2106 if (frame_is_intra_only(cm)) { | 2102 if (frame_is_intra_only(cm)) { |
2107 // Initialize max_mv_magnitude for use in the first INTER frame | 2103 // Initialize max_mv_magnitude for use in the first INTER frame |
2108 // after a key/intra-only frame. | 2104 // after a key/intra-only frame. |
2109 cpi->max_mv_magnitude = max_mv_def; | 2105 cpi->max_mv_magnitude = max_mv_def; |
2110 } else { | 2106 } else { |
2111 if (cm->show_frame) | 2107 if (cm->show_frame) |
2112 // Allow mv_steps to correspond to twice the max mv magnitude found | 2108 // Allow mv_steps to correspond to twice the max mv magnitude found |
2113 // in the previous frame, capped by the default max_mv_magnitude based | 2109 // in the previous frame, capped by the default max_mv_magnitude based |
2114 // on resolution. | 2110 // on resolution. |
2115 cpi->mv_step_param = vp9_init_search_range(sf, MIN(max_mv_def, 2 * | 2111 cpi->mv_step_param = vp9_init_search_range(MIN(max_mv_def, 2 * |
2116 cpi->max_mv_magnitude)); | 2112 cpi->max_mv_magnitude)); |
2117 cpi->max_mv_magnitude = 0; | 2113 cpi->max_mv_magnitude = 0; |
2118 } | 2114 } |
2119 } | 2115 } |
2120 | 2116 |
2121 // Set various flags etc to special state if it is a key frame. | 2117 // Set various flags etc to special state if it is a key frame. |
2122 if (frame_is_intra_only(cm)) { | 2118 if (frame_is_intra_only(cm)) { |
2123 // Reset the loop filter deltas and segmentation map. | 2119 // Reset the loop filter deltas and segmentation map. |
2124 vp9_reset_segment_features(&cm->seg); | 2120 vp9_reset_segment_features(&cm->seg); |
2125 | 2121 |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2571 cpi->source = vp9_svc_lookahead_peek(cpi, cpi->lookahead, | 2567 cpi->source = vp9_svc_lookahead_peek(cpi, cpi->lookahead, |
2572 arf_src_index, 1); | 2568 arf_src_index, 1); |
2573 else | 2569 else |
2574 #endif | 2570 #endif |
2575 cpi->source = vp9_lookahead_peek(cpi->lookahead, arf_src_index); | 2571 cpi->source = vp9_lookahead_peek(cpi->lookahead, arf_src_index); |
2576 if (cpi->source != NULL) { | 2572 if (cpi->source != NULL) { |
2577 cpi->alt_ref_source = cpi->source; | 2573 cpi->alt_ref_source = cpi->source; |
2578 | 2574 |
2579 if (cpi->oxcf.arnr_max_frames > 0) { | 2575 if (cpi->oxcf.arnr_max_frames > 0) { |
2580 // Produce the filtered ARF frame. | 2576 // Produce the filtered ARF frame. |
2581 // TODO(agrange) merge these two functions. | 2577 vp9_temporal_filter(cpi, arf_src_index); |
2582 vp9_configure_arnr_filter(cpi, arf_src_index, rc->gfu_boost); | |
2583 vp9_temporal_filter_prepare(cpi, arf_src_index); | |
2584 vp9_extend_frame_borders(&cpi->alt_ref_buffer); | 2578 vp9_extend_frame_borders(&cpi->alt_ref_buffer); |
2585 force_src_buffer = &cpi->alt_ref_buffer; | 2579 force_src_buffer = &cpi->alt_ref_buffer; |
2586 } | 2580 } |
2587 | 2581 |
2588 cm->show_frame = 0; | 2582 cm->show_frame = 0; |
2589 cpi->refresh_alt_ref_frame = 1; | 2583 cpi->refresh_alt_ref_frame = 1; |
2590 cpi->refresh_golden_frame = 0; | 2584 cpi->refresh_golden_frame = 0; |
2591 cpi->refresh_last_frame = 0; | 2585 cpi->refresh_last_frame = 0; |
2592 rc->is_src_frame_alt_ref = 0; | 2586 rc->is_src_frame_alt_ref = 0; |
2593 rc->source_alt_ref_pending = 0; | 2587 rc->source_alt_ref_pending = 0; |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3002 if (flags & VP8_EFLAG_NO_UPD_ARF) | 2996 if (flags & VP8_EFLAG_NO_UPD_ARF) |
3003 upd ^= VP9_ALT_FLAG; | 2997 upd ^= VP9_ALT_FLAG; |
3004 | 2998 |
3005 vp9_update_reference(cpi, upd); | 2999 vp9_update_reference(cpi, upd); |
3006 } | 3000 } |
3007 | 3001 |
3008 if (flags & VP8_EFLAG_NO_UPD_ENTROPY) { | 3002 if (flags & VP8_EFLAG_NO_UPD_ENTROPY) { |
3009 vp9_update_entropy(cpi, 0); | 3003 vp9_update_entropy(cpi, 0); |
3010 } | 3004 } |
3011 } | 3005 } |
OLD | NEW |