]> granicus.if.org Git - libvpx/commitdiff
Add pluggable bitwriters.
authorAlex Converse <aconverse@google.com>
Mon, 21 Mar 2016 21:23:55 +0000 (14:23 -0700)
committerAlex Converse <aconverse@google.com>
Fri, 25 Mar 2016 18:02:41 +0000 (11:02 -0700)
This will make the code change for a pure ANS experiment manageable.

Change-Id: I3c72a2d8e75afa2cc8e56992ee91f4760202f4d4

vp10/encoder/bitwriter.h [new file with mode: 0644]
vp10/vp10cx.mk

diff --git a/vp10/encoder/bitwriter.h b/vp10/encoder/bitwriter.h
new file mode 100644 (file)
index 0000000..f53a132
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ *  Copyright (c) 2016 The WebM project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+/* The purpose of this header is to provide compile time pluggable bit writer
+ * implementations with a common interface. */
+
+#ifndef VPX10_ENCODER_BITWRITER_H_
+#define VPX10_ENCODER_BITWRITER_H_
+
+#include "./vpx_config.h"
+#include "vpx_dsp/prob.h"
+
+#if CONFIG_ANS
+typedef struct BufAnsCoder BufAnsCoder;
+#include "vp10/encoder/buf_ans.h"
+#define vp10_writer BufAnsCoder
+#define vp10_write buf_uabs_write
+#define vp10_write_bit buf_uabs_write_bit
+#define vp10_write_literal buf_uabs_write_literal
+#else
+#include "vpx_dsp/bitwriter.h"
+#define vp10_writer vpx_writer
+#define vp10_write vpx_write
+#define vp10_write_bit vpx_write_bit
+#define vp10_write_literal vpx_write_literal
+#endif
+
+#endif  // VPX10_ENCODER_BITWRITER_H_
index 810005ce0642c8d6c26701cd59f60e2d54329333..34b766f023cab0902939775a98c0057e4ca3cca2 100644 (file)
@@ -18,6 +18,7 @@ VP10_CX_SRCS_REMOVE-no  += $(VP10_COMMON_SRCS_REMOVE-no)
 VP10_CX_SRCS-yes += vp10_cx_iface.c
 
 VP10_CX_SRCS-yes += encoder/bitstream.c
+VP10_CX_SRCS-yes += encoder/bitwriter.h
 VP10_CX_SRCS-yes += encoder/context_tree.c
 VP10_CX_SRCS-yes += encoder/context_tree.h
 VP10_CX_SRCS-yes += encoder/cost.h