| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "vp9/common/vp9_entropy.h" | 11 #include "vp9/common/vp9_entropy.h" |
| 12 #include "vp9/common/vp9_blockd.h" | 12 #include "vp9/common/vp9_blockd.h" |
| 13 #include "vp9/common/vp9_onyxc_int.h" | 13 #include "vp9/common/vp9_onyxc_int.h" |
| 14 #include "vp9/common/vp9_entropymode.h" | 14 #include "vp9/common/vp9_entropymode.h" |
| 15 #include "vpx_mem/vpx_mem.h" | 15 #include "vpx_mem/vpx_mem.h" |
| 16 #include "vpx/vpx_integer.h" | 16 #include "vpx/vpx_integer.h" |
| 17 | 17 |
| 18 | 18 |
| 19 DECLARE_ALIGNED(16, const uint8_t, vp9_coefband_trans_8x8plus[1024]) = { | 19 const uint8_t vp9_coefband_trans_8x8plus[1024] = { |
| 20 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, | 20 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, |
| 21 4, 4, 4, 4, 4, 5, | 21 4, 4, 4, 4, 4, 5, |
| 22 // beyond MAXBAND_INDEX+1 all values are filled as 5 | 22 // beyond MAXBAND_INDEX+1 all values are filled as 5 |
| 23 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | 23 5, 5, 5, 5, 5,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 5, 5, 5, 5, 5, 5, 5, | 81 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 82 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | 82 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 83 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | 83 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 84 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | 84 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 85 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | 85 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 DECLARE_ALIGNED(16, const uint8_t, vp9_coefband_trans_4x4[16]) = { | 88 const uint8_t vp9_coefband_trans_4x4[16] = { |
| 89 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, | 89 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 DECLARE_ALIGNED(16, const uint8_t, vp9_pt_energy_class[ENTROPY_TOKENS]) = { | 92 const uint8_t vp9_pt_energy_class[ENTROPY_TOKENS] = { |
| 93 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5 | 93 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5 |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 const vp9_tree_index vp9_coefmodel_tree[TREE_SIZE(UNCONSTRAINED_NODES + 1)] = { | 96 const vp9_tree_index vp9_coefmodel_tree[TREE_SIZE(UNCONSTRAINED_NODES + 1)] = { |
| 97 -EOB_MODEL_TOKEN, 2, | 97 -EOB_MODEL_TOKEN, 2, |
| 98 -ZERO_TOKEN, 4, | 98 -ZERO_TOKEN, 4, |
| 99 -ONE_TOKEN, -TWO_TOKEN, | 99 -ONE_TOKEN, -TWO_TOKEN, |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 // Model obtained from a 2-sided zero-centerd distribuition derived | 102 // Model obtained from a 2-sided zero-centerd distribuition derived |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } else if (cm->last_frame_type == KEY_FRAME) { | 774 } else if (cm->last_frame_type == KEY_FRAME) { |
| 775 update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */ | 775 update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */ |
| 776 count_sat = COEF_COUNT_SAT_AFTER_KEY; | 776 count_sat = COEF_COUNT_SAT_AFTER_KEY; |
| 777 } else { | 777 } else { |
| 778 update_factor = COEF_MAX_UPDATE_FACTOR; | 778 update_factor = COEF_MAX_UPDATE_FACTOR; |
| 779 count_sat = COEF_COUNT_SAT; | 779 count_sat = COEF_COUNT_SAT; |
| 780 } | 780 } |
| 781 for (t = TX_4X4; t <= TX_32X32; t++) | 781 for (t = TX_4X4; t <= TX_32X32; t++) |
| 782 adapt_coef_probs(cm, t, count_sat, update_factor); | 782 adapt_coef_probs(cm, t, count_sat, update_factor); |
| 783 } | 783 } |
| OLD | NEW |