Yushin Cho | 77bba8d | 2016-11-04 16:36:56 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 14 | void od_encode_checkpoint(const daala_enc_ctx *enc, od_rollback_buffer *rbuf) { |
Nathan E. Egge | 476c63c | 2017-05-18 18:35:16 -0400 | [diff] [blame] | 15 | #if !CONFIG_ANS |
Nathan E. Egge | 6675be0 | 2016-12-21 13:02:43 -0500 | [diff] [blame] | 16 | od_ec_enc_checkpoint(&rbuf->ec, &enc->w.ec); |
| 17 | #else |
Nathan E. Egge | 476c63c | 2017-05-18 18:35:16 -0400 | [diff] [blame] | 18 | #error "CONFIG_PVQ currently requires !CONFIG_ANS." |
Nathan E. Egge | 6675be0 | 2016-12-21 13:02:43 -0500 | [diff] [blame] | 19 | #endif |
Yushin Cho | c49ef3a | 2017-03-13 17:27:25 -0700 | [diff] [blame] | 20 | OD_COPY(&rbuf->adapt, enc->state.adapt, 1); |
Yushin Cho | 77bba8d | 2016-11-04 16:36:56 -0700 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | void od_encode_rollback(daala_enc_ctx *enc, const od_rollback_buffer *rbuf) { |
Nathan E. Egge | 476c63c | 2017-05-18 18:35:16 -0400 | [diff] [blame] | 24 | #if !CONFIG_ANS |
Nathan E. Egge | 6675be0 | 2016-12-21 13:02:43 -0500 | [diff] [blame] | 25 | od_ec_enc_rollback(&enc->w.ec, &rbuf->ec); |
| 26 | #else |
Nathan E. Egge | 476c63c | 2017-05-18 18:35:16 -0400 | [diff] [blame] | 27 | #error "CONFIG_PVQ currently requires !CONFIG_ANS." |
Nathan E. Egge | 6675be0 | 2016-12-21 13:02:43 -0500 | [diff] [blame] | 28 | #endif |
Yushin Cho | c49ef3a | 2017-03-13 17:27:25 -0700 | [diff] [blame] | 29 | OD_COPY(enc->state.adapt, &rbuf->adapt, 1); |
Yushin Cho | 77bba8d | 2016-11-04 16:36:56 -0700 | [diff] [blame] | 30 | } |