Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 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. |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 12 | #ifndef AV1_ENCODER_SUBEXP_H_ |
| 13 | #define AV1_ENCODER_SUBEXP_H_ |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 14 | |
| 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
Alex Converse | e54fd03 | 2016-06-06 15:12:06 -0700 | [diff] [blame] | 19 | #include "aom_dsp/bitwriter.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 20 | #include "aom_dsp/prob.h" |
| 21 | |
Thomas Davies | 80188d1 | 2016-10-26 16:08:35 -0700 | [diff] [blame] | 22 | void av1_write_prob_diff_update(aom_writer *w, aom_prob newp, aom_prob oldpm); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 23 | |
Alex Converse | e54fd03 | 2016-06-06 15:12:06 -0700 | [diff] [blame] | 24 | void av1_cond_prob_diff_update(aom_writer *w, aom_prob *oldp, |
Thomas Davies | 80188d1 | 2016-10-26 16:08:35 -0700 | [diff] [blame] | 25 | const unsigned int ct[2], int probwt); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 26 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 27 | int av1_prob_diff_update_savings_search(const unsigned int *ct, aom_prob oldp, |
Thomas Davies | 80188d1 | 2016-10-26 16:08:35 -0700 | [diff] [blame] | 28 | aom_prob *bestp, aom_prob upd, |
| 29 | int probwt); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 30 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 31 | int av1_prob_diff_update_savings_search_model(const unsigned int *ct, |
Alex Converse | a9ce4b7 | 2016-05-25 10:28:03 -0700 | [diff] [blame] | 32 | const aom_prob oldp, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 33 | aom_prob *bestp, aom_prob upd, |
Thomas Davies | 80188d1 | 2016-10-26 16:08:35 -0700 | [diff] [blame] | 34 | int stepsize, int probwt); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 35 | |
Thomas Davies | 80188d1 | 2016-10-26 16:08:35 -0700 | [diff] [blame] | 36 | int av1_cond_prob_diff_update_savings(aom_prob *oldp, const unsigned int ct[2], |
| 37 | int probwt); |
hui su | 0d10357 | 2017-03-01 17:58:01 -0800 | [diff] [blame] | 38 | #if CONFIG_SUBFRAME_PROB_UPDATE |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 39 | int av1_prob_update_search_subframe(unsigned int ct[][2], aom_prob oldp, |
| 40 | aom_prob *bestp, aom_prob upd, int n); |
clang-format | 55ce9e0 | 2017-02-15 22:27:12 -0800 | [diff] [blame] | 41 | int av1_prob_update_search_model_subframe( |
| 42 | unsigned int ct[ENTROPY_NODES][COEF_PROBS_BUFS][2], const aom_prob *oldp, |
| 43 | aom_prob *bestp, aom_prob upd, int stepsize, int n); |
hui su | 0d10357 | 2017-03-01 17:58:01 -0800 | [diff] [blame] | 44 | #endif // CONFIG_SUBFRAME_PROB_UPDATE |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 45 | |
| 46 | // |
| 47 | // mag_bits is number of bits for magnitude. The alphabet is of size |
| 48 | // 2 * 2^mag_bits + 1, symmetric around 0, where one bit is used to |
| 49 | // indicate 0 or non-zero, mag_bits bits are used to indicate magnitide |
| 50 | // and 1 more bit for the sign if non-zero. |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 51 | void aom_write_primitive_symmetric(aom_writer *w, int word, |
| 52 | unsigned int mag_bits); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 53 | #ifdef __cplusplus |
| 54 | } // extern "C" |
| 55 | #endif |
| 56 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 57 | #endif // AV1_ENCODER_SUBEXP_H_ |