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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 if (!mbd->mode_ref_lf_delta_enabled) | 150 if (!mbd->mode_ref_lf_delta_enabled) |
151 { | 151 { |
152 /* we could get rid of this if we assume that deltas are set to | 152 /* we could get rid of this if we assume that deltas are set to |
153 * zero when not in use; encoder always uses deltas | 153 * zero when not in use; encoder always uses deltas |
154 */ | 154 */ |
155 vpx_memset(lfi->lvl[seg][0], lvl_seg, 4 * 4 ); | 155 vpx_memset(lfi->lvl[seg][0], lvl_seg, 4 * 4 ); |
156 continue; | 156 continue; |
157 } | 157 } |
158 | 158 |
159 lvl_ref = lvl_seg; | |
160 | |
161 /* INTRA_FRAME */ | 159 /* INTRA_FRAME */ |
162 ref = INTRA_FRAME; | 160 ref = INTRA_FRAME; |
163 | 161 |
164 /* Apply delta for reference frame */ | 162 /* Apply delta for reference frame */ |
165 lvl_ref += mbd->ref_lf_deltas[ref]; | 163 lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; |
166 | 164 |
167 /* Apply delta for Intra modes */ | 165 /* Apply delta for Intra modes */ |
168 mode = 0; /* B_PRED */ | 166 mode = 0; /* B_PRED */ |
169 /* Only the split mode BPRED has a further special case */ | 167 /* Only the split mode BPRED has a further special case */ |
170 lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; | 168 lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; |
171 lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clam
p */ | 169 /* clamp */ |
| 170 lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; |
172 | 171 |
173 lfi->lvl[seg][ref][mode] = lvl_mode; | 172 lfi->lvl[seg][ref][mode] = lvl_mode; |
174 | 173 |
175 mode = 1; /* all the rest of Intra modes */ | 174 mode = 1; /* all the rest of Intra modes */ |
176 lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; /* clamp
*/ | 175 /* clamp */ |
| 176 lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; |
177 lfi->lvl[seg][ref][mode] = lvl_mode; | 177 lfi->lvl[seg][ref][mode] = lvl_mode; |
178 | 178 |
179 /* LAST, GOLDEN, ALT */ | 179 /* LAST, GOLDEN, ALT */ |
180 for(ref = 1; ref < MAX_REF_FRAMES; ref++) | 180 for(ref = 1; ref < MAX_REF_FRAMES; ref++) |
181 { | 181 { |
182 int lvl_ref = lvl_seg; | |
183 | |
184 /* Apply delta for reference frame */ | 182 /* Apply delta for reference frame */ |
185 lvl_ref += mbd->ref_lf_deltas[ref]; | 183 lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; |
186 | 184 |
187 /* Apply delta for Inter modes */ | 185 /* Apply delta for Inter modes */ |
188 for (mode = 1; mode < 4; mode++) | 186 for (mode = 1; mode < 4; mode++) |
189 { | 187 { |
190 lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; | 188 lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode]; |
191 lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0;
/* clamp */ | 189 /* clamp */ |
| 190 lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; |
192 | 191 |
193 lfi->lvl[seg][ref][mode] = lvl_mode; | 192 lfi->lvl[seg][ref][mode] = lvl_mode; |
194 } | 193 } |
195 } | 194 } |
196 } | 195 } |
197 } | 196 } |
198 | 197 |
199 | 198 |
200 void vp8_loop_filter_row_normal(VP8_COMMON *cm, MODE_INFO *mode_info_context, | 199 void vp8_loop_filter_row_normal(VP8_COMMON *cm, MODE_INFO *mode_info_context, |
201 int mb_row, int post_ystride, int post_uvstride, | 200 int mb_row, int post_ystride, int post_uvstride, |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 } | 653 } |
655 | 654 |
656 y_ptr += 16; | 655 y_ptr += 16; |
657 mode_info_context += 1; /* step to next MB */ | 656 mode_info_context += 1; /* step to next MB */ |
658 } | 657 } |
659 | 658 |
660 y_ptr += post->y_stride * 16 - post->y_width; | 659 y_ptr += post->y_stride * 16 - post->y_width; |
661 mode_info_context += 1; /* Skip border mb */ | 660 mode_info_context += 1; /* Skip border mb */ |
662 } | 661 } |
663 } | 662 } |
OLD | NEW |