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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 806 |
807 // Don't do mv reuse since we want to allow for another mode besides | 807 // Don't do mv reuse since we want to allow for another mode besides |
808 // ZEROMV_LAST to remove dot artifact. | 808 // ZEROMV_LAST to remove dot artifact. |
809 if (dot_artifact_candidate) | 809 if (dot_artifact_candidate) |
810 parent_ref_valid = 0; | 810 parent_ref_valid = 0; |
811 } | 811 } |
812 #endif | 812 #endif |
813 | 813 |
814 // Check if current macroblock is in skin area. | 814 // Check if current macroblock is in skin area. |
815 { | 815 { |
816 const int y = x->src.y_buffer[7 * x->src.y_stride + 7]; | 816 const int y = (x->src.y_buffer[7 * x->src.y_stride + 7] + |
817 const int cb = x->src.u_buffer[3 * x->src.uv_stride + 3]; | 817 x->src.y_buffer[7 * x->src.y_stride + 8] + |
818 const int cr = x->src.v_buffer[3 * x->src.uv_stride + 3]; | 818 x->src.y_buffer[8 * x->src.y_stride + 7] + |
| 819 x->src.y_buffer[8 * x->src.y_stride + 8]) >> 2; |
| 820 const int cb = (x->src.u_buffer[3 * x->src.uv_stride + 3] + |
| 821 x->src.u_buffer[3 * x->src.uv_stride + 4] + |
| 822 x->src.u_buffer[4 * x->src.uv_stride + 3] + |
| 823 x->src.u_buffer[4 * x->src.uv_stride + 4]) >> 2; |
| 824 const int cr = (x->src.v_buffer[3 * x->src.uv_stride + 3] + |
| 825 x->src.v_buffer[3 * x->src.uv_stride + 4] + |
| 826 x->src.v_buffer[4 * x->src.uv_stride + 3] + |
| 827 x->src.v_buffer[4 * x->src.uv_stride + 4]) >> 2; |
819 x->is_skin = 0; | 828 x->is_skin = 0; |
820 if (!cpi->oxcf.screen_content_mode) | 829 if (!cpi->oxcf.screen_content_mode) |
821 x->is_skin = is_skin_color(y, cb, cr); | 830 x->is_skin = is_skin_color(y, cb, cr); |
822 } | 831 } |
823 #if CONFIG_TEMPORAL_DENOISING | 832 #if CONFIG_TEMPORAL_DENOISING |
824 if (cpi->oxcf.noise_sensitivity) { | 833 if (cpi->oxcf.noise_sensitivity) { |
825 // Under aggressive denoising mode, should we use skin map to reduce denoi
ser | 834 // Under aggressive denoising mode, should we use skin map to reduce denoi
ser |
826 // and ZEROMV bias? Will need to revisit the accuracy of this detection fo
r | 835 // and ZEROMV bias? Will need to revisit the accuracy of this detection fo
r |
827 // very noisy input. For now keep this as is (i.e., don't turn it off). | 836 // very noisy input. For now keep this as is (i.e., don't turn it off). |
828 // if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) | 837 // if (cpi->denoiser.denoiser_mode == kDenoiserOnYUVAggressive) |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 error4x4 = pick_intra4x4mby_modes(x, &rate, | 1551 error4x4 = pick_intra4x4mby_modes(x, &rate, |
1543 &best_sse); | 1552 &best_sse); |
1544 if (error4x4 < error16x16) | 1553 if (error4x4 < error16x16) |
1545 { | 1554 { |
1546 xd->mode_info_context->mbmi.mode = B_PRED; | 1555 xd->mode_info_context->mbmi.mode = B_PRED; |
1547 best_rate = rate; | 1556 best_rate = rate; |
1548 } | 1557 } |
1549 | 1558 |
1550 *rate_ = best_rate; | 1559 *rate_ = best_rate; |
1551 } | 1560 } |
OLD | NEW |