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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 static void adapt_probs(const vp9_tree_index *tree, const vp9_prob *pre_probs, | 190 static void adapt_probs(const vp9_tree_index *tree, const vp9_prob *pre_probs, |
191 const unsigned int *counts, vp9_prob *probs) { | 191 const unsigned int *counts, vp9_prob *probs) { |
192 vp9_tree_merge_probs(tree, pre_probs, counts, MV_COUNT_SAT, | 192 vp9_tree_merge_probs(tree, pre_probs, counts, MV_COUNT_SAT, |
193 MV_MAX_UPDATE_FACTOR, probs); | 193 MV_MAX_UPDATE_FACTOR, probs); |
194 } | 194 } |
195 | 195 |
196 void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) { | 196 void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) { |
197 int i, j; | 197 int i, j; |
198 | 198 |
199 nmv_context *fc = &cm->fc.nmvc; | 199 nmv_context *fc = &cm->fc->nmvc; |
200 const nmv_context *pre_fc = &cm->frame_contexts[cm->frame_context_idx].nmvc; | 200 const nmv_context *pre_fc = &cm->frame_contexts[cm->frame_context_idx].nmvc; |
201 const nmv_context_counts *counts = &cm->counts.mv; | 201 const nmv_context_counts *counts = &cm->counts.mv; |
202 | 202 |
203 adapt_probs(vp9_mv_joint_tree, pre_fc->joints, counts->joints, fc->joints); | 203 adapt_probs(vp9_mv_joint_tree, pre_fc->joints, counts->joints, fc->joints); |
204 | 204 |
205 for (i = 0; i < 2; ++i) { | 205 for (i = 0; i < 2; ++i) { |
206 nmv_component *comp = &fc->comps[i]; | 206 nmv_component *comp = &fc->comps[i]; |
207 const nmv_component *pre_comp = &pre_fc->comps[i]; | 207 const nmv_component *pre_comp = &pre_fc->comps[i]; |
208 const nmv_component_counts *c = &counts->comps[i]; | 208 const nmv_component_counts *c = &counts->comps[i]; |
209 | 209 |
(...skipping 12 matching lines...) Expand all Loading... |
222 adapt_probs(vp9_mv_fp_tree, pre_comp->fp, c->fp, comp->fp); | 222 adapt_probs(vp9_mv_fp_tree, pre_comp->fp, c->fp, comp->fp); |
223 | 223 |
224 if (allow_hp) { | 224 if (allow_hp) { |
225 comp->class0_hp = adapt_prob(pre_comp->class0_hp, c->class0_hp); | 225 comp->class0_hp = adapt_prob(pre_comp->class0_hp, c->class0_hp); |
226 comp->hp = adapt_prob(pre_comp->hp, c->hp); | 226 comp->hp = adapt_prob(pre_comp->hp, c->hp); |
227 } | 227 } |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 void vp9_init_mv_probs(VP9_COMMON *cm) { | 231 void vp9_init_mv_probs(VP9_COMMON *cm) { |
232 cm->fc.nmvc = default_nmv_context; | 232 cm->fc->nmvc = default_nmv_context; |
233 } | 233 } |
OLD | NEW |