OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 if (savings > bestsavings) { | 214 if (savings > bestsavings) { |
215 bestsavings = savings; | 215 bestsavings = savings; |
216 bestnewp = newp; | 216 bestnewp = newp; |
217 } | 217 } |
218 } | 218 } |
219 *bestp = bestnewp; | 219 *bestp = bestnewp; |
220 return bestsavings; | 220 return bestsavings; |
221 } | 221 } |
222 | 222 |
223 void vp9_cond_prob_diff_update(vp9_writer *w, vp9_prob *oldp, | 223 void vp9_cond_prob_diff_update(vp9_writer *w, vp9_prob *oldp, |
224 vp9_prob upd, unsigned int *ct) { | 224 unsigned int *ct) { |
| 225 const vp9_prob upd = DIFF_UPDATE_PROB; |
225 vp9_prob newp = get_binary_prob(ct[0], ct[1]); | 226 vp9_prob newp = get_binary_prob(ct[0], ct[1]); |
226 const int savings = vp9_prob_diff_update_savings_search(ct, *oldp, &newp, | 227 const int savings = vp9_prob_diff_update_savings_search(ct, *oldp, &newp, |
227 upd); | 228 upd); |
228 assert(newp >= 1); | 229 assert(newp >= 1); |
229 if (savings > 0) { | 230 if (savings > 0) { |
230 vp9_write(w, 1, upd); | 231 vp9_write(w, 1, upd); |
231 vp9_write_prob_diff_update(w, newp, *oldp); | 232 vp9_write_prob_diff_update(w, newp, *oldp); |
232 *oldp = newp; | 233 *oldp = newp; |
233 } else { | 234 } else { |
234 vp9_write(w, 0, upd); | 235 vp9_write(w, 0, upd); |
235 } | 236 } |
236 } | 237 } |
OLD | NEW |