OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Make SURE use of floating point in this function is safe. | 48 // Make SURE use of floating point in this function is safe. |
49 vp9_clear_system_state(); | 49 vp9_clear_system_state(); |
50 | 50 |
51 if (cm->frame_type == KEY_FRAME || | 51 if (cm->frame_type == KEY_FRAME || |
52 cpi->refresh_alt_ref_frame || | 52 cpi->refresh_alt_ref_frame || |
53 (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) { | 53 (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) { |
54 int segment; | 54 int segment; |
55 const int aq_strength = get_aq_c_strength(cm->base_qindex, cm->bit_depth); | 55 const int aq_strength = get_aq_c_strength(cm->base_qindex, cm->bit_depth); |
56 | 56 |
57 // Clear down the segment map. | 57 // Clear down the segment map. |
58 vpx_memset(cpi->segmentation_map, DEFAULT_AQ2_SEG, | 58 memset(cpi->segmentation_map, DEFAULT_AQ2_SEG, cm->mi_rows * cm->mi_cols); |
59 cm->mi_rows * cm->mi_cols); | |
60 | 59 |
61 vp9_clearall_segfeatures(seg); | 60 vp9_clearall_segfeatures(seg); |
62 | 61 |
63 // Segmentation only makes sense if the target bits per SB is above a | 62 // Segmentation only makes sense if the target bits per SB is above a |
64 // threshold. Below this the overheads will usually outweigh any benefit. | 63 // threshold. Below this the overheads will usually outweigh any benefit. |
65 if (cpi->rc.sb64_target_rate < 256) { | 64 if (cpi->rc.sb64_target_rate < 256) { |
66 vp9_disable_segmentation(seg); | 65 vp9_disable_segmentation(seg); |
67 return; | 66 return; |
68 } | 67 } |
69 | 68 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 153 } |
155 } | 154 } |
156 | 155 |
157 // Fill in the entires in the segment map corresponding to this SB64. | 156 // Fill in the entires in the segment map corresponding to this SB64. |
158 for (y = 0; y < ymis; y++) { | 157 for (y = 0; y < ymis; y++) { |
159 for (x = 0; x < xmis; x++) { | 158 for (x = 0; x < xmis; x++) { |
160 cpi->segmentation_map[mi_offset + y * cm->mi_cols + x] = segment; | 159 cpi->segmentation_map[mi_offset + y * cm->mi_cols + x] = segment; |
161 } | 160 } |
162 } | 161 } |
163 } | 162 } |
OLD | NEW |