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 |
11 #include "vp9/common/vp9_common.h" | 11 #include "vp9/common/vp9_common.h" |
12 #include "vp9/common/vp9_entropy.h" | 12 #include "vp9/common/vp9_entropy.h" |
13 | 13 |
14 #include "vp9/encoder/vp9_cost.h" | 14 #include "vp9/encoder/vp9_cost.h" |
| 15 #include "vp9/encoder/vp9_subexp.h" |
15 #include "vp9/encoder/vp9_writer.h" | 16 #include "vp9/encoder/vp9_writer.h" |
16 | 17 |
17 #define vp9_cost_upd256 ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd))) | 18 #define vp9_cost_upd256 ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd))) |
18 | 19 |
19 static const int update_bits[255] = { | 20 static const int update_bits[255] = { |
20 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | 21 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
21 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, | 22 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
22 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, | 23 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
23 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, | 24 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, |
24 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, | 25 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 upd); | 205 upd); |
205 assert(newp >= 1); | 206 assert(newp >= 1); |
206 if (savings > 0) { | 207 if (savings > 0) { |
207 vp9_write(w, 1, upd); | 208 vp9_write(w, 1, upd); |
208 vp9_write_prob_diff_update(w, newp, *oldp); | 209 vp9_write_prob_diff_update(w, newp, *oldp); |
209 *oldp = newp; | 210 *oldp = newp; |
210 } else { | 211 } else { |
211 vp9_write(w, 0, upd); | 212 vp9_write(w, 0, upd); |
212 } | 213 } |
213 } | 214 } |
OLD | NEW |