Home | History | Annotate | Download | only in common
      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 
     11 
     12 #ifndef VP8_COMMON_ENTROPYMODE_H_
     13 #define VP8_COMMON_ENTROPYMODE_H_
     14 
     15 #include "onyxc_int.h"
     16 #include "treecoder.h"
     17 
     18 #ifdef __cplusplus
     19 extern "C" {
     20 #endif
     21 
     22 typedef enum
     23 {
     24     SUBMVREF_NORMAL,
     25     SUBMVREF_LEFT_ZED,
     26     SUBMVREF_ABOVE_ZED,
     27     SUBMVREF_LEFT_ABOVE_SAME,
     28     SUBMVREF_LEFT_ABOVE_ZED
     29 } sumvfref_t;
     30 
     31 typedef int vp8_mbsplit[16];
     32 
     33 #define VP8_NUMMBSPLITS 4
     34 
     35 extern const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS];
     36 
     37 extern const int vp8_mbsplit_count [VP8_NUMMBSPLITS];    /* # of subsets */
     38 
     39 extern const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS-1];
     40 
     41 extern int vp8_mv_cont(const int_mv *l, const int_mv *a);
     42 #define SUBMVREF_COUNT 5
     43 extern const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1];
     44 
     45 
     46 extern const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES];
     47 
     48 
     49 extern const vp8_tree_index vp8_bmode_tree[];
     50 
     51 extern const vp8_tree_index  vp8_ymode_tree[];
     52 extern const vp8_tree_index  vp8_kf_ymode_tree[];
     53 extern const vp8_tree_index  vp8_uv_mode_tree[];
     54 
     55 extern const vp8_tree_index  vp8_mbsplit_tree[];
     56 extern const vp8_tree_index  vp8_mv_ref_tree[];
     57 extern const vp8_tree_index  vp8_sub_mv_ref_tree[];
     58 
     59 extern const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES];
     60 extern const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES];
     61 extern const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES];
     62 extern const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES];
     63 extern const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS];
     64 
     65 /* Inter mode values do not start at zero */
     66 
     67 extern const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS];
     68 extern const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS];
     69 
     70 extern const vp8_tree_index vp8_small_mvtree[];
     71 
     72 extern const struct vp8_token_struct vp8_small_mvencodings[8];
     73 
     74 /* Key frame default mode probs */
     75 extern const vp8_prob vp8_kf_bmode_prob[VP8_BINTRAMODES][VP8_BINTRAMODES]
     76 [VP8_BINTRAMODES-1];
     77 extern const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES-1];
     78 extern const vp8_prob vp8_kf_ymode_prob[VP8_YMODES-1];
     79 
     80 void vp8_init_mbmode_probs(VP8_COMMON *x);
     81 void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]);
     82 void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]);
     83 
     84 #ifdef __cplusplus
     85 }  // extern "C"
     86 #endif
     87 
     88 #endif  // VP8_COMMON_ENTROPYMODE_H_
     89