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 14 matching lines...) Expand all Loading... |
25 unsigned int value; | 25 unsigned int value; |
26 int count; | 26 int count; |
27 unsigned int pos; | 27 unsigned int pos; |
28 uint8_t *buffer; | 28 uint8_t *buffer; |
29 | 29 |
30 // Variables used to track bit costs without outputing to the bitstream | 30 // Variables used to track bit costs without outputing to the bitstream |
31 unsigned int measure_cost; | 31 unsigned int measure_cost; |
32 uint64_t bit_counter; | 32 uint64_t bit_counter; |
33 } vp9_writer; | 33 } vp9_writer; |
34 | 34 |
35 extern const unsigned int vp9_prob_cost[256]; | |
36 | |
37 void vp9_start_encode(vp9_writer *bc, uint8_t *buffer); | 35 void vp9_start_encode(vp9_writer *bc, uint8_t *buffer); |
38 void vp9_stop_encode(vp9_writer *bc); | 36 void vp9_stop_encode(vp9_writer *bc); |
39 | 37 |
40 static void vp9_write(vp9_writer *br, int bit, int probability) { | 38 static void vp9_write(vp9_writer *br, int bit, int probability) { |
41 unsigned int split; | 39 unsigned int split; |
42 int count = br->count; | 40 int count = br->count; |
43 unsigned int range = br->range; | 41 unsigned int range = br->range; |
44 unsigned int lowvalue = br->lowvalue; | 42 unsigned int lowvalue = br->lowvalue; |
45 register unsigned int shift; | 43 register unsigned int shift; |
46 | 44 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 vp9_write_bit(w, 1 & (data >> bit)); | 94 vp9_write_bit(w, 1 & (data >> bit)); |
97 } | 95 } |
98 | 96 |
99 #define vp9_write_prob(w, v) vp9_write_literal((w), (v), 8) | 97 #define vp9_write_prob(w, v) vp9_write_literal((w), (v), 8) |
100 | 98 |
101 #ifdef __cplusplus | 99 #ifdef __cplusplus |
102 } // extern "C" | 100 } // extern "C" |
103 #endif | 101 #endif |
104 | 102 |
105 #endif // VP9_ENCODER_VP9_WRITER_H_ | 103 #endif // VP9_ENCODER_VP9_WRITER_H_ |
OLD | NEW |