2010-05-18 19:58:33 +04:00
|
|
|
/*
|
2016-09-02 00:32:49 +03:00
|
|
|
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
|
2010-05-18 19:58:33 +04:00
|
|
|
*
|
2016-09-02 00:32:49 +03:00
|
|
|
* This source code is subject to the terms of the BSD 2 Clause License and
|
|
|
|
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
|
|
|
|
* was not distributed with this source code in the LICENSE file, you can
|
|
|
|
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
|
|
|
|
* Media Patent License 1.0 was not distributed with this source code in the
|
|
|
|
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
|
2010-05-18 19:58:33 +04:00
|
|
|
*/
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#ifndef AOM_DSP_BITWRITER_H_
|
|
|
|
#define AOM_DSP_BITWRITER_H_
|
2010-05-18 19:58:33 +04:00
|
|
|
|
2016-06-07 01:12:06 +03:00
|
|
|
#include "aom_dsp/dkboolwriter.h"
|
2016-08-23 02:08:15 +03:00
|
|
|
#include "aom_dsp/prob.h"
|
2013-12-17 00:53:09 +04:00
|
|
|
|
2014-01-19 00:16:11 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-06-07 01:12:06 +03:00
|
|
|
typedef struct aom_dk_writer aom_writer;
|
2011-07-19 17:17:25 +04:00
|
|
|
|
2016-06-07 01:12:06 +03:00
|
|
|
static INLINE void aom_start_encode(aom_writer *bc, uint8_t *buffer) {
|
|
|
|
aom_dk_start_encode(bc, buffer);
|
|
|
|
}
|
2011-07-19 17:17:25 +04:00
|
|
|
|
2016-06-07 01:12:06 +03:00
|
|
|
static INLINE void aom_stop_encode(aom_writer *bc) { aom_dk_stop_encode(bc); }
|
2012-07-14 02:21:29 +04:00
|
|
|
|
2016-06-07 01:12:06 +03:00
|
|
|
static INLINE void aom_write(aom_writer *br, int bit, int probability) {
|
|
|
|
aom_dk_write(br, bit, probability);
|
2011-07-19 17:17:25 +04:00
|
|
|
}
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
static INLINE void aom_write_bit(aom_writer *w, int bit) {
|
2016-06-07 01:12:06 +03:00
|
|
|
aom_dk_write_bit(w, bit);
|
2013-05-08 05:19:50 +04:00
|
|
|
}
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
static INLINE void aom_write_literal(aom_writer *w, int data, int bits) {
|
2016-06-07 01:12:06 +03:00
|
|
|
aom_dk_write_literal(w, data, bits);
|
2013-05-08 05:19:50 +04:00
|
|
|
}
|
|
|
|
|
2014-01-19 00:16:11 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // AOM_DSP_BITWRITER_H_
|