• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 2 Clause License and
5  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6  * was not distributed with this source code in the LICENSE file, you can
7  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8  * Media Patent License 1.0 was not distributed with this source code in the
9  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10  */
11 
12 #include "av1/common/onyxc_int.h"
13 #include "av1/common/entropymv.h"
14 
15 static const nmv_context default_nmv_context = {
16   { AOM_CDF4(4096, 11264, 19328) },  // joints_cdf
17   { {
18         // Vertical component
19         { AOM_CDF11(28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757,
20                     32762, 32767) },  // class_cdf // fp
21         { { AOM_CDF4(16384, 24576, 26624) },
22           { AOM_CDF4(12288, 21248, 24128) } },  // class0_fp_cdf
23         { AOM_CDF4(8192, 17408, 21248) },       // fp_cdf
24         { AOM_CDF2(128 * 128) },                // sign_cdf
25         { AOM_CDF2(160 * 128) },                // class0_hp_cdf
26         { AOM_CDF2(128 * 128) },                // hp_cdf
27         { AOM_CDF2(216 * 128) },                // class0_cdf
28         { { AOM_CDF2(128 * 136) },
29           { AOM_CDF2(128 * 140) },
30           { AOM_CDF2(128 * 148) },
31           { AOM_CDF2(128 * 160) },
32           { AOM_CDF2(128 * 176) },
33           { AOM_CDF2(128 * 192) },
34           { AOM_CDF2(128 * 224) },
35           { AOM_CDF2(128 * 234) },
36           { AOM_CDF2(128 * 234) },
37           { AOM_CDF2(128 * 240) } },  // bits_cdf
38     },
39     {
40         // Horizontal component
41         { AOM_CDF11(28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757,
42                     32762, 32767) },  // class_cdf // fp
43         { { AOM_CDF4(16384, 24576, 26624) },
44           { AOM_CDF4(12288, 21248, 24128) } },  // class0_fp_cdf
45         { AOM_CDF4(8192, 17408, 21248) },       // fp_cdf
46         { AOM_CDF2(128 * 128) },                // sign_cdf
47         { AOM_CDF2(160 * 128) },                // class0_hp_cdf
48         { AOM_CDF2(128 * 128) },                // hp_cdf
49         { AOM_CDF2(216 * 128) },                // class0_cdf
50         { { AOM_CDF2(128 * 136) },
51           { AOM_CDF2(128 * 140) },
52           { AOM_CDF2(128 * 148) },
53           { AOM_CDF2(128 * 160) },
54           { AOM_CDF2(128 * 176) },
55           { AOM_CDF2(128 * 192) },
56           { AOM_CDF2(128 * 224) },
57           { AOM_CDF2(128 * 234) },
58           { AOM_CDF2(128 * 234) },
59           { AOM_CDF2(128 * 240) } },  // bits_cdf
60     } },
61 };
62 
av1_init_mv_probs(AV1_COMMON * cm)63 void av1_init_mv_probs(AV1_COMMON *cm) {
64   // NB: this sets CDFs too
65   cm->fc->nmvc = default_nmv_context;
66   cm->fc->ndvc = default_nmv_context;
67 }
68