entropymode.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. *
  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
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VP8_COMMON_ENTROPYMODE_H_
  11. #define VP8_COMMON_ENTROPYMODE_H_
  12. #include "onyxc_int.h"
  13. #include "treecoder.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef enum {
  18. SUBMVREF_NORMAL,
  19. SUBMVREF_LEFT_ZED,
  20. SUBMVREF_ABOVE_ZED,
  21. SUBMVREF_LEFT_ABOVE_SAME,
  22. SUBMVREF_LEFT_ABOVE_ZED
  23. } sumvfref_t;
  24. typedef int vp8_mbsplit[16];
  25. #define VP8_NUMMBSPLITS 4
  26. extern const vp8_mbsplit vp8_mbsplits[VP8_NUMMBSPLITS];
  27. extern const int vp8_mbsplit_count[VP8_NUMMBSPLITS]; /* # of subsets */
  28. extern const vp8_prob vp8_mbsplit_probs[VP8_NUMMBSPLITS - 1];
  29. extern int vp8_mv_cont(const int_mv *l, const int_mv *a);
  30. #define SUBMVREF_COUNT 5
  31. extern const vp8_prob vp8_sub_mv_ref_prob2[SUBMVREF_COUNT][VP8_SUBMVREFS - 1];
  32. extern const unsigned int vp8_kf_default_bmode_counts[VP8_BINTRAMODES]
  33. [VP8_BINTRAMODES]
  34. [VP8_BINTRAMODES];
  35. extern const vp8_tree_index vp8_bmode_tree[];
  36. extern const vp8_tree_index vp8_ymode_tree[];
  37. extern const vp8_tree_index vp8_kf_ymode_tree[];
  38. extern const vp8_tree_index vp8_uv_mode_tree[];
  39. extern const vp8_tree_index vp8_mbsplit_tree[];
  40. extern const vp8_tree_index vp8_mv_ref_tree[];
  41. extern const vp8_tree_index vp8_sub_mv_ref_tree[];
  42. extern const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES];
  43. extern const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES];
  44. extern const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES];
  45. extern const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES];
  46. extern const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS];
  47. /* Inter mode values do not start at zero */
  48. extern const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS];
  49. extern const struct vp8_token_struct
  50. vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS];
  51. extern const vp8_tree_index vp8_small_mvtree[];
  52. extern const struct vp8_token_struct vp8_small_mvencodings[8];
  53. /* Key frame default mode probs */
  54. extern const vp8_prob vp8_kf_bmode_prob[VP8_BINTRAMODES][VP8_BINTRAMODES]
  55. [VP8_BINTRAMODES - 1];
  56. extern const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES - 1];
  57. extern const vp8_prob vp8_kf_ymode_prob[VP8_YMODES - 1];
  58. void vp8_init_mbmode_probs(VP8_COMMON *x);
  59. void vp8_default_bmode_probs(vp8_prob dest[VP8_BINTRAMODES - 1]);
  60. void vp8_kf_default_bmode_probs(vp8_prob dest[VP8_BINTRAMODES][VP8_BINTRAMODES]
  61. [VP8_BINTRAMODES - 1]);
  62. #ifdef __cplusplus
  63. } // extern "C"
  64. #endif
  65. #endif // VP8_COMMON_ENTROPYMODE_H_