blob: c60e2d3d7791fe0f0184e8d930cdf554cb9ef761 [file] [log] [blame]
Yushin Cho77bba8d2016-11-04 16:36:56 -07001/*
2 * Copyright (c) 2001-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 "encint.h"
13
14void od_encode_checkpoint(const daala_enc_ctx *enc, od_rollback_buffer *rbuf) {
Nathan E. Egge476c63c2017-05-18 18:35:16 -040015#if !CONFIG_ANS
Nathan E. Egge6675be02016-12-21 13:02:43 -050016 od_ec_enc_checkpoint(&rbuf->ec, &enc->w.ec);
17#else
Nathan E. Egge476c63c2017-05-18 18:35:16 -040018#error "CONFIG_PVQ currently requires !CONFIG_ANS."
Nathan E. Egge6675be02016-12-21 13:02:43 -050019#endif
Yushin Choc49ef3a2017-03-13 17:27:25 -070020 OD_COPY(&rbuf->adapt, enc->state.adapt, 1);
Yushin Cho77bba8d2016-11-04 16:36:56 -070021}
22
23void od_encode_rollback(daala_enc_ctx *enc, const od_rollback_buffer *rbuf) {
Nathan E. Egge476c63c2017-05-18 18:35:16 -040024#if !CONFIG_ANS
Nathan E. Egge6675be02016-12-21 13:02:43 -050025 od_ec_enc_rollback(&enc->w.ec, &rbuf->ec);
26#else
Nathan E. Egge476c63c2017-05-18 18:35:16 -040027#error "CONFIG_PVQ currently requires !CONFIG_ANS."
Nathan E. Egge6675be02016-12-21 13:02:43 -050028#endif
Yushin Choc49ef3a2017-03-13 17:27:25 -070029 OD_COPY(enc->state.adapt, &rbuf->adapt, 1);
Yushin Cho77bba8d2016-11-04 16:36:56 -070030}