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 |
11 | 11 |
12 #include <limits.h> | 12 #include <limits.h> |
13 #include "vpx_config.h" | 13 #include "vpx_config.h" |
14 #include "./vpx_dsp_rtcd.h" | 14 #include "./vpx_dsp_rtcd.h" |
15 #include "onyx_int.h" | 15 #include "onyx_int.h" |
16 #include "modecosts.h" | 16 #include "modecosts.h" |
17 #include "encodeintra.h" | 17 #include "encodeintra.h" |
18 #include "vp8/common/common.h" | 18 #include "vp8/common/common.h" |
19 #include "vp8/common/entropymode.h" | 19 #include "vp8/common/entropymode.h" |
20 #include "pickinter.h" | 20 #include "pickinter.h" |
21 #include "vp8/common/findnearmv.h" | 21 #include "vp8/common/findnearmv.h" |
22 #include "encodemb.h" | 22 #include "encodemb.h" |
23 #include "vp8/common/reconinter.h" | 23 #include "vp8/common/reconinter.h" |
24 #include "vp8/common/reconintra4x4.h" | 24 #include "vp8/common/reconintra4x4.h" |
25 #include "vpx_dsp/variance.h" | 25 #include "vpx_dsp/variance.h" |
26 #include "mcomp.h" | 26 #include "mcomp.h" |
27 #include "rdopt.h" | 27 #include "rdopt.h" |
| 28 #include "vpx_dsp/vpx_dsp_common.h" |
28 #include "vpx_mem/vpx_mem.h" | 29 #include "vpx_mem/vpx_mem.h" |
29 #if CONFIG_TEMPORAL_DENOISING | 30 #if CONFIG_TEMPORAL_DENOISING |
30 #include "denoising.h" | 31 #include "denoising.h" |
31 #endif | 32 #endif |
32 | 33 |
33 #ifdef SPEEDSTATS | 34 #ifdef SPEEDSTATS |
34 extern unsigned int cnt_pm; | 35 extern unsigned int cnt_pm; |
35 #endif | 36 #endif |
36 | 37 |
37 extern const int vp8_ref_frame_order[MAX_MODES]; | 38 extern const int vp8_ref_frame_order[MAX_MODES]; |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 x->src.v_buffer[4 * x->src.uv_stride + 3] + | 827 x->src.v_buffer[4 * x->src.uv_stride + 3] + |
827 x->src.v_buffer[4 * x->src.uv_stride + 4]) >> 2; | 828 x->src.v_buffer[4 * x->src.uv_stride + 4]) >> 2; |
828 x->is_skin = 0; | 829 x->is_skin = 0; |
829 if (!cpi->oxcf.screen_content_mode) | 830 if (!cpi->oxcf.screen_content_mode) |
830 x->is_skin = is_skin_color(y, cb, cr); | 831 x->is_skin = is_skin_color(y, cb, cr); |
831 } | 832 } |
832 #if CONFIG_TEMPORAL_DENOISING | 833 #if CONFIG_TEMPORAL_DENOISING |
833 if (cpi->oxcf.noise_sensitivity) { | 834 if (cpi->oxcf.noise_sensitivity) { |
834 // Under aggressive denoising mode, should we use skin map to reduce denoi
ser | 835 // Under aggressive denoising mode, should we use skin map to reduce denoi
ser |
835 // and ZEROMV bias? Will need to revisit the accuracy of this detection fo
r | 836 // and ZEROMV bias? Will need to revisit the accuracy of this detection fo
r |
836 // very noisy input. For now keep this as is (i.e., don't turn it off). | 837 // very noisy input. For now keep this as is (i.e., don't turn it off). |
837 // if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) | 838 // if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) |
838 // x->is_skin = 0; | 839 // x->is_skin = 0; |
839 } | 840 } |
840 #endif | 841 #endif |
841 | 842 |
842 mode_mv = mode_mv_sb[sign_bias]; | 843 mode_mv = mode_mv_sb[sign_bias]; |
843 best_ref_mv.as_int = 0; | 844 best_ref_mv.as_int = 0; |
844 memset(mode_mv_sb, 0, sizeof(mode_mv_sb)); | 845 memset(mode_mv_sb, 0, sizeof(mode_mv_sb)); |
845 memset(&best_mbmode, 0, sizeof(best_mbmode)); | 846 memset(&best_mbmode, 0, sizeof(best_mbmode)); |
846 | 847 |
(...skipping 29 matching lines...) Expand all Loading... |
876 /* Count of the number of MBs tested so far this frame */ | 877 /* Count of the number of MBs tested so far this frame */ |
877 x->mbs_tested_so_far++; | 878 x->mbs_tested_so_far++; |
878 | 879 |
879 *returnintra = INT_MAX; | 880 *returnintra = INT_MAX; |
880 x->skip = 0; | 881 x->skip = 0; |
881 | 882 |
882 x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; | 883 x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME; |
883 | 884 |
884 /* If the frame has big static background and current MB is in low | 885 /* If the frame has big static background and current MB is in low |
885 * motion area, its mode decision is biased to ZEROMV mode. | 886 * motion area, its mode decision is biased to ZEROMV mode. |
886 * No adjustment if cpu_used is <= -12 (i.e., cpi->Speed >= 12). | 887 * No adjustment if cpu_used is <= -12 (i.e., cpi->Speed >= 12). |
887 * At such speed settings, ZEROMV is already heavily favored. | 888 * At such speed settings, ZEROMV is already heavily favored. |
888 */ | 889 */ |
889 if (cpi->Speed < 12) { | 890 if (cpi->Speed < 12) { |
890 calculate_zeromv_rd_adjustment(cpi, x, &rd_adjustment); | 891 calculate_zeromv_rd_adjustment(cpi, x, &rd_adjustment); |
891 } | 892 } |
892 | 893 |
893 #if CONFIG_TEMPORAL_DENOISING | 894 #if CONFIG_TEMPORAL_DENOISING |
894 if (cpi->oxcf.noise_sensitivity) { | 895 if (cpi->oxcf.noise_sensitivity) { |
895 rd_adjustment = (int)(rd_adjustment * | 896 rd_adjustment = (int)(rd_adjustment * |
896 cpi->denoiser.denoise_pars.pickmode_mv_bias / 100); | 897 cpi->denoiser.denoise_pars.pickmode_mv_bias / 100); |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 error4x4 = pick_intra4x4mby_modes(x, &rate, | 1552 error4x4 = pick_intra4x4mby_modes(x, &rate, |
1552 &best_sse); | 1553 &best_sse); |
1553 if (error4x4 < error16x16) | 1554 if (error4x4 < error16x16) |
1554 { | 1555 { |
1555 xd->mode_info_context->mbmi.mode = B_PRED; | 1556 xd->mode_info_context->mbmi.mode = B_PRED; |
1556 best_rate = rate; | 1557 best_rate = rate; |
1557 } | 1558 } |
1558 | 1559 |
1559 *rate_ = best_rate; | 1560 *rate_ = best_rate; |
1560 } | 1561 } |
OLD | NEW |