From c4ca21fcde457b255cef4f945934d8e451880ea3 Mon Sep 17 00:00:00 2001
From: Jean-Marc Valin <jmvalin@jmvalin.ca>
Date: Thu, 15 Sep 2011 10:10:40 -0700
Subject: [PATCH] Moves opus_compare to the same base64 tar.gz as the rest of
 the code

---
 Makefile.am                   |  5 ++++-
 Makefile.draft                | 10 ++++++++--
 doc/build_draft.sh            | 15 ++++++++-------
 doc/draft-ietf-codec-opus.xml | 10 +++++++---
 {doc => src}/opus_compare.c   |  0
 5 files changed, 27 insertions(+), 13 deletions(-)
 rename {doc => src}/opus_compare.c (100%)

diff --git a/Makefile.am b/Makefile.am
index bfd4061b6..f5c595701 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,7 +26,7 @@ pkginclude_HEADERS = src/opus.h src/opus_multistream.h celt/opus_types.h celt/op
 
 noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
 
-noinst_PROGRAMS = test_opus test_repacketizer
+noinst_PROGRAMS = test_opus test_repacketizer opus_compare
 
 test_opus_SOURCES = src/test_opus.c
 
@@ -36,6 +36,9 @@ test_repacketizer_SOURCES = src/test_repacketizer.c
 
 test_repacketizer_LDADD = libopus.la -lm
 
+opus_compare_SOURCES = src/opus_compare.c
+opus_compare_LDADD = -lm
+
 if CUSTOM_MODES
 pkginclude_HEADERS += celt/opus_custom.h
 noinst_PROGRAMS += test_opus_custom
diff --git a/Makefile.draft b/Makefile.draft
index 37d62fc0f..f75b05ce4 100644
--- a/Makefile.draft
+++ b/Makefile.draft
@@ -97,6 +97,9 @@ OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C))
 TESTOPUS_SRCS_C = src/test_opus.c
 TESTOPUS_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(TESTOPUS_SRCS_C))
 
+OPUSCOMPARE_SRCS_C = src/opus_compare.c
+OPUSCOMPARE_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(OPUSCOMPARE_SRCS_C))
+
 LIBS = m
 
 LDLIBDIRS = ./
@@ -104,7 +107,7 @@ LDLIBDIRS = ./
 # Rules
 default: all
 
-all: $(TARGET) lib test_opus
+all: $(TARGET) lib test_opus opus_compare
 
 lib: $(TARGET)
 
@@ -114,5 +117,8 @@ $(TARGET): $(OBJS)
 test_opus$(EXESUFFIX): $(TESTOPUS_OBJS) $(TARGET)
 	$(LINK.o.cmdline)
 	
+opus_compare$(EXESUFFIX): $(OPUSCOMPARE_OBJS)
+	$(LINK.o.cmdline)
+	
 clean:
-	rm -f test_opus$(EXESUFFIX) $(TARGET) $(OBJS) $(TESTOPUS_OBJS)
+	rm -f test_opus$(EXESUFFIX) opus_compare$(EXESUFFIX) $(TARGET) $(OBJS) $(TESTOPUS_OBJS)
diff --git a/doc/build_draft.sh b/doc/build_draft.sh
index 105dbd05a..bb8706b19 100755
--- a/doc/build_draft.sh
+++ b/doc/build_draft.sh
@@ -23,6 +23,7 @@ for f in `cat "${toplevel}"/opus_sources.mk "${toplevel}"/celt_sources.mk \
   cp -a "${toplevel}/${f}" "${destdir}/${f}"
 done
 cp -a "${toplevel}"/src/test_opus.c "${destdir}"/src/
+cp -a "${toplevel}"/src/opus_compare.c "${destdir}"/src/
 cp -a "${toplevel}"/celt/test_opus_custom.c "${destdir}"/celt/
 cp -a "${toplevel}"/celt/opus_custom.h "${destdir}"/celt/
 cp -a "${toplevel}"/Makefile.draft "${destdir}"/Makefile
@@ -36,13 +37,13 @@ tar czf opus_source.tar.gz "${destdir}"
 echo building base64 version
 cat opus_source.tar.gz| base64 -w 66 | sed 's/^/###/' > opus_source.base64
 
-echo '<figure>' > opus_compare_escaped.c
-echo '<artwork>' >> opus_compare_escaped.c
-echo '<![CDATA[' >> opus_compare_escaped.c
-cat opus_compare.c >> opus_compare_escaped.c
-echo ']]>' >> opus_compare_escaped.c
-echo '</artwork>' >> opus_compare_escaped.c
-echo '</figure>' >> opus_compare_escaped.c
+#echo '<figure>' > opus_compare_escaped.c
+#echo '<artwork>' >> opus_compare_escaped.c
+#echo '<![CDATA[' >> opus_compare_escaped.c
+#cat opus_compare.c >> opus_compare_escaped.c
+#echo ']]>' >> opus_compare_escaped.c
+#echo '</artwork>' >> opus_compare_escaped.c
+#echo '</figure>' >> opus_compare_escaped.c
 
 echo running xml2rfc
 xml2rfc draft-ietf-codec-opus.xml draft-ietf-codec-opus.html &
diff --git a/doc/draft-ietf-codec-opus.xml b/doc/draft-ietf-codec-opus.xml
index 4bf79b9d8..a5f354076 100644
--- a/doc/draft-ietf-codec-opus.xml
+++ b/doc/draft-ietf-codec-opus.xml
@@ -5297,8 +5297,10 @@ the latter shall take precedence.
 
 <t>
 Compliance with this specification means that a decoder's output MUST be
- within the thresholds specified by the opus_compare.c tool in
- <xref target="opus-compare"/> compared to the reference implementation.
+ within the thresholds specified by the opus_compare.c tool (included
+ with the code) when compared to the reference implementation. Either the floating-point
+ implementation or the fixed-point implementation can be used as a reference and being
+ within the threshold for one of the two is sufficient.
 </t>
 
 <t>
@@ -5591,12 +5593,14 @@ Development snapshots are provided at
 
 </section>
 
+<!-- 
 <section anchor="opus-compare" title="opus_compare.c">
 <t>
 <?rfc include="opus_compare_escaped.c"?>
 </t>
 </section>
-
+ -->
+ 
 <section anchor="self-delimiting-framing" title="Self-Delimiting Framing">
 <t>
 To use the internal framing described in <xref target="modes"/>, the decoder
diff --git a/doc/opus_compare.c b/src/opus_compare.c
similarity index 100%
rename from doc/opus_compare.c
rename to src/opus_compare.c
-- 
GitLab