blob: 4dc51f64a0795b1838d80bc11c2a0fc822ae11f5 [file] [log] [blame]
Yaowu Xuc27fc142016-08-22 16:08:15 -07001/*
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Yaowu Xuc27fc142016-08-22 16:08:15 -07003 *
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07004 * 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 Xuc27fc142016-08-22 16:08:15 -070010 */
11
Yaowu Xuf883b422016-08-30 14:01:10 -070012#ifndef AV1_ENCODER_SUBEXP_H_
13#define AV1_ENCODER_SUBEXP_H_
Yaowu Xuc27fc142016-08-22 16:08:15 -070014
15#ifdef __cplusplus
16extern "C" {
17#endif
18
Alex Conversee54fd032016-06-06 15:12:06 -070019#include "aom_dsp/bitwriter.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070020#include "aom_dsp/prob.h"
21
Thomas Davies80188d12016-10-26 16:08:35 -070022void av1_write_prob_diff_update(aom_writer *w, aom_prob newp, aom_prob oldpm);
Yaowu Xuc27fc142016-08-22 16:08:15 -070023
Alex Conversee54fd032016-06-06 15:12:06 -070024void av1_cond_prob_diff_update(aom_writer *w, aom_prob *oldp,
Thomas Davies80188d12016-10-26 16:08:35 -070025 const unsigned int ct[2], int probwt);
Yaowu Xuc27fc142016-08-22 16:08:15 -070026
Yaowu Xuf883b422016-08-30 14:01:10 -070027int av1_prob_diff_update_savings_search(const unsigned int *ct, aom_prob oldp,
Thomas Davies80188d12016-10-26 16:08:35 -070028 aom_prob *bestp, aom_prob upd,
29 int probwt);
Yaowu Xuc27fc142016-08-22 16:08:15 -070030
Yaowu Xuf883b422016-08-30 14:01:10 -070031int av1_prob_diff_update_savings_search_model(const unsigned int *ct,
Alex Conversea9ce4b72016-05-25 10:28:03 -070032 const aom_prob oldp,
Yaowu Xuf883b422016-08-30 14:01:10 -070033 aom_prob *bestp, aom_prob upd,
Thomas Davies80188d12016-10-26 16:08:35 -070034 int stepsize, int probwt);
Yaowu Xuc27fc142016-08-22 16:08:15 -070035
Thomas Davies80188d12016-10-26 16:08:35 -070036int av1_cond_prob_diff_update_savings(aom_prob *oldp, const unsigned int ct[2],
37 int probwt);
hui su0d103572017-03-01 17:58:01 -080038#if CONFIG_SUBFRAME_PROB_UPDATE
Yaowu Xuf883b422016-08-30 14:01:10 -070039int av1_prob_update_search_subframe(unsigned int ct[][2], aom_prob oldp,
40 aom_prob *bestp, aom_prob upd, int n);
clang-format55ce9e02017-02-15 22:27:12 -080041int 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 su0d103572017-03-01 17:58:01 -080044#endif // CONFIG_SUBFRAME_PROB_UPDATE
Yaowu Xuc27fc142016-08-22 16:08:15 -070045
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 Xuf883b422016-08-30 14:01:10 -070051void aom_write_primitive_symmetric(aom_writer *w, int word,
52 unsigned int mag_bits);
Yaowu Xuc27fc142016-08-22 16:08:15 -070053#ifdef __cplusplus
54} // extern "C"
55#endif
56
Yaowu Xuf883b422016-08-30 14:01:10 -070057#endif // AV1_ENCODER_SUBEXP_H_