| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 bestnewp = newp; | 143 bestnewp = newp; |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 *bestp = bestnewp; | 146 *bestp = bestnewp; |
| 147 return bestsavings; | 147 return bestsavings; |
| 148 } | 148 } |
| 149 | 149 |
| 150 int vp9_prob_diff_update_savings_search_model(const unsigned int *ct, | 150 int vp9_prob_diff_update_savings_search_model(const unsigned int *ct, |
| 151 const vp9_prob *oldp, | 151 const vp9_prob *oldp, |
| 152 vp9_prob *bestp, | 152 vp9_prob *bestp, |
| 153 vp9_prob upd, | 153 vp9_prob upd) { |
| 154 int b, int r) { | |
| 155 int i, old_b, new_b, update_b, savings, bestsavings, step; | 154 int i, old_b, new_b, update_b, savings, bestsavings, step; |
| 156 int newp; | 155 int newp; |
| 157 vp9_prob bestnewp, newplist[ENTROPY_NODES], oldplist[ENTROPY_NODES]; | 156 vp9_prob bestnewp, newplist[ENTROPY_NODES], oldplist[ENTROPY_NODES]; |
| 158 vp9_model_to_full_probs(oldp, oldplist); | 157 vp9_model_to_full_probs(oldp, oldplist); |
| 159 vpx_memcpy(newplist, oldp, sizeof(vp9_prob) * UNCONSTRAINED_NODES); | 158 vpx_memcpy(newplist, oldp, sizeof(vp9_prob) * UNCONSTRAINED_NODES); |
| 160 for (i = UNCONSTRAINED_NODES, old_b = 0; i < ENTROPY_NODES; ++i) | 159 for (i = UNCONSTRAINED_NODES, old_b = 0; i < ENTROPY_NODES; ++i) |
| 161 old_b += cost_branch256(ct + 2 * i, oldplist[i]); | 160 old_b += cost_branch256(ct + 2 * i, oldplist[i]); |
| 162 old_b += cost_branch256(ct + 2 * PIVOT_NODE, oldplist[PIVOT_NODE]); | 161 old_b += cost_branch256(ct + 2 * PIVOT_NODE, oldplist[PIVOT_NODE]); |
| 163 | 162 |
| 164 bestsavings = 0; | 163 bestsavings = 0; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 194 upd); | 193 upd); |
| 195 assert(newp >= 1); | 194 assert(newp >= 1); |
| 196 if (savings > 0) { | 195 if (savings > 0) { |
| 197 vp9_write(w, 1, upd); | 196 vp9_write(w, 1, upd); |
| 198 vp9_write_prob_diff_update(w, newp, *oldp); | 197 vp9_write_prob_diff_update(w, newp, *oldp); |
| 199 *oldp = newp; | 198 *oldp = newp; |
| 200 } else { | 199 } else { |
| 201 vp9_write(w, 0, upd); | 200 vp9_write(w, 0, upd); |
| 202 } | 201 } |
| 203 } | 202 } |
| OLD | NEW |