John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | /* |
John Koleszar | c2140b8 | 2010-09-09 08:16:39 -0400 | [diff] [blame] | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | * |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 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 |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 7 | * in the file PATENTS. All contributing project authors may |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 8 | * be found in the AUTHORS file in the root of the source tree. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 9 | */ |
| 10 | |
Jim Bankoski | 2b8dc06 | 2012-11-29 16:36:10 -0800 | [diff] [blame] | 11 | #ifndef VP9_COMMON_VP9_ENTROPYMODE_H_ |
| 12 | #define VP9_COMMON_VP9_ENTROPYMODE_H_ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 13 | |
Jim Bankoski | c678739 | 2012-11-28 10:41:40 -0800 | [diff] [blame] | 14 | #include "vp9/common/vp9_blockd.h" |
| 15 | #include "vp9/common/vp9_treecoder.h" |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 16 | |
Deb Mukherjee | 17da2ca | 2013-06-08 00:09:44 -0700 | [diff] [blame] | 17 | #define TX_SIZE_CONTEXTS 2 |
James Zern | c8ba8c5 | 2013-08-22 18:40:34 -0700 | [diff] [blame] | 18 | #define SWITCHABLE_FILTERS 3 // number of switchable filters |
Dmitry Kovalev | 6761872 | 2013-10-30 14:40:34 -0700 | [diff] [blame^] | 19 | #define SWITCHABLE_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1) |
Deb Mukherjee | a43ff15 | 2013-06-10 12:00:43 -0700 | [diff] [blame] | 20 | |
Deb Mukherjee | 2140194 | 2013-06-06 11:14:04 -0700 | [diff] [blame] | 21 | // #define MODE_STATS |
| 22 | |
Dmitry Kovalev | f9f453e | 2013-07-17 16:50:52 -0700 | [diff] [blame] | 23 | struct VP9Common; |
| 24 | |
Dmitry Kovalev | cc662dd | 2013-07-10 17:36:06 -0700 | [diff] [blame] | 25 | struct tx_probs { |
Dmitry Kovalev | 23391ea | 2013-07-26 17:15:37 -0700 | [diff] [blame] | 26 | vp9_prob p32x32[TX_SIZE_CONTEXTS][TX_SIZES - 1]; |
| 27 | vp9_prob p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 2]; |
| 28 | vp9_prob p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 3]; |
Dmitry Kovalev | cc662dd | 2013-07-10 17:36:06 -0700 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | struct tx_counts { |
Dmitry Kovalev | 23391ea | 2013-07-26 17:15:37 -0700 | [diff] [blame] | 32 | unsigned int p32x32[TX_SIZE_CONTEXTS][TX_SIZES]; |
| 33 | unsigned int p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 1]; |
| 34 | unsigned int p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 2]; |
Dmitry Kovalev | cc662dd | 2013-07-10 17:36:06 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
James Zern | c8ba8c5 | 2013-08-22 18:40:34 -0700 | [diff] [blame] | 37 | extern const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1]; |
| 38 | extern const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES] |
| 39 | [INTRA_MODES - 1]; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 40 | |
Dmitry Kovalev | 860e467 | 2013-10-11 16:25:50 -0700 | [diff] [blame] | 41 | extern const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)]; |
James Zern | c8ba8c5 | 2013-08-22 18:40:34 -0700 | [diff] [blame] | 42 | extern struct vp9_token vp9_intra_mode_encodings[INTRA_MODES]; |
Dmitry Kovalev | 860e467 | 2013-10-11 16:25:50 -0700 | [diff] [blame] | 43 | |
| 44 | extern const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)]; |
James Zern | c8ba8c5 | 2013-08-22 18:40:34 -0700 | [diff] [blame] | 45 | extern struct vp9_token vp9_inter_mode_encodings[INTER_MODES]; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 46 | |
Dmitry Kovalev | 860e467 | 2013-10-11 16:25:50 -0700 | [diff] [blame] | 47 | extern const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)]; |
Jingning Han | 90a91cc | 2013-04-16 00:18:02 -0700 | [diff] [blame] | 48 | extern struct vp9_token vp9_partition_encodings[PARTITION_TYPES]; |
| 49 | |
Dmitry Kovalev | f9f453e | 2013-07-17 16:50:52 -0700 | [diff] [blame] | 50 | extern const vp9_tree_index vp9_switchable_interp_tree |
Dmitry Kovalev | 860e467 | 2013-10-11 16:25:50 -0700 | [diff] [blame] | 51 | [TREE_SIZE(SWITCHABLE_FILTERS)]; |
James Zern | c8ba8c5 | 2013-08-22 18:40:34 -0700 | [diff] [blame] | 52 | extern struct vp9_token vp9_switchable_interp_encodings[SWITCHABLE_FILTERS]; |
Dmitry Kovalev | f9f453e | 2013-07-17 16:50:52 -0700 | [diff] [blame] | 53 | |
| 54 | void vp9_entropy_mode_init(); |
| 55 | |
Dmitry Kovalev | b7616e3 | 2013-08-14 11:20:33 -0700 | [diff] [blame] | 56 | void vp9_setup_past_independence(struct VP9Common *cm); |
Deb Mukherjee | 01cafaa | 2013-01-15 06:43:35 -0800 | [diff] [blame] | 57 | |
James Zern | d765df2 | 2013-08-23 19:30:33 -0700 | [diff] [blame] | 58 | void vp9_init_mbmode_probs(struct VP9Common *cm); |
Ronald S. Bultje | 6c280c2 | 2012-10-31 16:09:17 -0700 | [diff] [blame] | 59 | |
James Zern | d765df2 | 2013-08-23 19:30:33 -0700 | [diff] [blame] | 60 | void vp9_adapt_mode_probs(struct VP9Common *cm); |
Deb Mukherjee | 5259744 | 2012-07-18 13:43:01 -0700 | [diff] [blame] | 61 | |
Dmitry Kovalev | c64e238 | 2013-09-30 14:50:15 -0700 | [diff] [blame] | 62 | void tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p, |
Dmitry Kovalev | f9f453e | 2013-07-17 16:50:52 -0700 | [diff] [blame] | 63 | unsigned int (*ct_32x32p)[2]); |
Dmitry Kovalev | c64e238 | 2013-09-30 14:50:15 -0700 | [diff] [blame] | 64 | void tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p, |
Dmitry Kovalev | f9f453e | 2013-07-17 16:50:52 -0700 | [diff] [blame] | 65 | unsigned int (*ct_16x16p)[2]); |
Dmitry Kovalev | c64e238 | 2013-09-30 14:50:15 -0700 | [diff] [blame] | 66 | void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p, |
Dmitry Kovalev | f9f453e | 2013-07-17 16:50:52 -0700 | [diff] [blame] | 67 | unsigned int (*ct_8x8p)[2]); |
Ronald S. Bultje | 6c280c2 | 2012-10-31 16:09:17 -0700 | [diff] [blame] | 68 | |
Ronald S. Bultje | 4cca47b | 2012-12-18 15:31:19 -0800 | [diff] [blame] | 69 | #endif // VP9_COMMON_VP9_ENTROPYMODE_H_ |