190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber/* 2f71323e297a928af368937089d3ed71239786f86Andreas Huber * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber * 4f71323e297a928af368937089d3ed71239786f86Andreas Huber * Use of this source code is governed by a BSD-style license 5f71323e297a928af368937089d3ed71239786f86Andreas Huber * that can be found in the LICENSE file in the root of the source 6f71323e297a928af368937089d3ed71239786f86Andreas Huber * tree. An additional intellectual property rights grant can be found 7f71323e297a928af368937089d3ed71239786f86Andreas Huber * in the file PATENTS. All contributing project authors may 8f71323e297a928af368937089d3ed71239786f86Andreas Huber * be found in the AUTHORS file in the root of the source tree. 990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber */ 1090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 1190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 12b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian#ifndef VP8_ENCODER_TOKENIZE_H_ 13b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian#define VP8_ENCODER_TOKENIZE_H_ 1490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 1579f15823c34ae1e423108295e416213200bb280fAndreas Huber#include "vp8/common/entropy.h" 1690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#include "block.h" 1790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 18b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian#ifdef __cplusplus 19b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanianextern "C" { 20b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian#endif 21b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian 2290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid vp8_tokenize_initialize(); 2390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 2490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubertypedef struct 2590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber{ 26538f6170b788de7408b06efc6613dc98579aa6a6Andreas Huber short Token; 27538f6170b788de7408b06efc6613dc98579aa6a6Andreas Huber short Extra; 28538f6170b788de7408b06efc6613dc98579aa6a6Andreas Huber} TOKENVALUE; 29538f6170b788de7408b06efc6613dc98579aa6a6Andreas Huber 30538f6170b788de7408b06efc6613dc98579aa6a6Andreas Hubertypedef struct 31538f6170b788de7408b06efc6613dc98579aa6a6Andreas Huber{ 3290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber const vp8_prob *context_tree; 3379f15823c34ae1e423108295e416213200bb280fAndreas Huber short Extra; 3479f15823c34ae1e423108295e416213200bb280fAndreas Huber unsigned char Token; 3579f15823c34ae1e423108295e416213200bb280fAndreas Huber unsigned char skip_eob_node; 3690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber} TOKENEXTRA; 3790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 3890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberint rd_cost_mby(MACROBLOCKD *); 3990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 40ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#ifdef VP8_ENTROPY_STATS 4190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid init_context_counters(); 4290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid print_context_counters(); 4390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 441b362b15af34006e6a11974088a46d42b903418eJohannextern _int64 context_counters[BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; 4590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#endif 4690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 471b362b15af34006e6a11974088a46d42b903418eJohannextern const short *const vp8_dct_value_cost_ptr; 48f71323e297a928af368937089d3ed71239786f86Andreas Huber/* TODO: The Token field should be broken out into a separate char array to 49f71323e297a928af368937089d3ed71239786f86Andreas Huber * improve cache locality, since it's needed for costing when the rest of the 50f71323e297a928af368937089d3ed71239786f86Andreas Huber * fields are not. 51f71323e297a928af368937089d3ed71239786f86Andreas Huber */ 521b362b15af34006e6a11974088a46d42b903418eJohannextern const TOKENVALUE *const vp8_dct_value_tokens_ptr; 5390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber 54b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian#ifdef __cplusplus 55b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian} // extern "C" 56b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian#endif 57b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian 58b08e2e23eec181e9951df33cd704ac294c5407b6Vignesh Venkatasubramanian#endif // VP8_ENCODER_TOKENIZE_H_ 59