Permalink
Browse files

copyright lines. more succinct zlib stuff. authors file. updates to l…

…icenses
  • Loading branch information...
1 parent 9aa2d2e commit c16c416a83118f113236a2cda577b0152087974c Brian Whitman committed Jun 6, 2011
View
@@ -0,0 +1,8 @@
+echoprint-codegen was written by
+
+Dan Ellis <dpwe@ee.columbia.edu>
+Brian Whitman <brian@echonest.com>
+Alastair Porter <alastair@porter.net.nz>
+
+and is Copyright 2011 The Echo Nest Corporation.
+
View
27 LICENSE
@@ -1,3 +1,6 @@
+echoprint-codegen is open source software licensed under the "MIT License"
+More information about the MIT License: http://en.wikipedia.org/wiki/MIT_License
+
Copyright (c) 2011 The Echo Nest Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -16,4 +19,26 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+THE SOFTWARE.
+
+
+libcodegen makes use of the following pieces of software:
+
+- Murmurhash by Austin Appleby (Public Domain / MIT)
+http://sites.google.com/site/murmurhash/
+
+- Boost (Boost Software License)
+http://www.boost.org/users/license.html
+
+- Base64.cpp and Base64.h, see source files for license
+Copyright (C) 2004-2008 René Nyffenegger
+
+
+codegen (the example binary that the makefile also builds) makes use of libcodegen and:
+
+- Taglib (LGPL)
+http://developer.kde.org/~wheeler/taglib.html
+
+- ffmpeg (via system shell, you must install ffmpeg on your own)
+http://www.ffmpeg.org/legal.html
+
View
@@ -1,5 +1,6 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
#include <string.h>
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#include "Common.h"
#include <iostream>
#include <string>
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#include <stddef.h>
#include <stdio.h>
#include <iostream>
View
@@ -1,7 +1,9 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef AUDIOSTREAMINPUT_H
#define AUDIOSTREAMINPUT_H
#include "Common.h"
View
@@ -1,7 +1,9 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#include <sstream>
#include <iostream>
#include <iomanip>
@@ -10,7 +12,7 @@
#include "Fingerprint.h"
#include "Base64.h"
-#include "easyzlib.h"
+#include <zlib.h>
Fingerprint* Codegen::computeFingerprint(SubbandAnalysis *pSubbandAnalysis, int start_offset) {
Fingerprint *pFingerprint = new Fingerprint(pSubbandAnalysis, start_offset);
@@ -53,10 +55,27 @@ string Codegen::createCodeString(vector<FPCode> vCodes) {
string Codegen::compress(const string& s) {
- long nDest = (long)EZ_COMPRESSMAXDESTLENGTH((float)s.size());
- unsigned char *pDest = new unsigned char[nDest];
- ezcompress(pDest, &nDest, (unsigned char*)s.c_str(), s.size());
- string encoded = base64_encode(pDest, nDest, true);
- delete [] pDest;
+ long max_compressed_length = s.size()*2;
+ unsigned char *compressed = new unsigned char[max_compressed_length];
+
+ // zlib the code string
+ z_stream stream;
+ stream.next_in = (Bytef*)(unsigned char*)s.c_str();
+ stream.avail_in = (uInt)s.size();
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+ stream.opaque = (voidpf)0;
+ deflateInit(&stream, Z_DEFAULT_COMPRESSION);
+ do {
+ stream.next_out = compressed;
+ stream.avail_out = max_compressed_length;
+ if(deflate(&stream, Z_FINISH) == Z_STREAM_END) break;
+ } while (stream.avail_out == 0);
+ uint compressed_length = stream.total_out;
+ deflateEnd(&stream);
+
+ // base64 the zlib'd code string
+ string encoded = base64_encode(compressed, compressed_length, true);
+ delete [] compressed;
return encoded;
}
View
@@ -1,12 +1,14 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef CODEGEN_H
#define CODEGEN_H
// Entry point for generating codes from PCM data.
-#define VERSION 4.00
+#define VERSION 4.10
#include <memory>
#include <string>
View
@@ -1,7 +1,9 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef COMMON_H
#define COMMON_H
View
@@ -1,7 +1,9 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef FILE_H
#define FILE_H
#include <string.h>
View
@@ -1,7 +1,9 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#include "Fingerprint.h"
#include "Params.h"
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef FINGERPRINT_H
#define FINGERPRINT_H
View
@@ -16,13 +16,12 @@ MODULES_LIB = \
Fingerprint.o \
MatrixUtility.o \
SubbandAnalysis.o \
- VectorUtility.o \
- easyzlib.o
+ VectorUtility.o
MODULES = $(MODULES_LIB) Metadata.o
main: $(MODULES) main.o
$(CXX) $(MODULES) $(LDFLAGS) main.o -o ../codegen.$(UNAME)-$(ARCH)
- $(CXX) -shared -fPIC -o libcodegen.$(UNAME)-$(ARCH).so $(MODULES_LIB)
+ $(CXX) -shared -fPIC -o libcodegen.$(UNAME)-$(ARCH).so $(MODULES_LIB) -lz
ifeq ($(UNAME),Darwin)
libtool -dynamic -flat_namespace -install_name libcodegen.4.0.0.dylib -lSystem -compatibility_version 4.0 -macosx_version_min 10.6 \
-current_version 4.0.0 -o libcodegen.4.0.0.dylib -undefined suppress \
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#include "VectorUtility.h"
#include "MatrixUtility.h"
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef MATRIXUTILITY_H
#define MATRIXUTILITY_H
View
@@ -1,5 +1,6 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef METADATA_H
#define METADATA_H
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef PARAMS_H
#define PARAMS_H
View
@@ -1,5 +1,7 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
+//
#include "SubbandAnalysis.h"
View
@@ -1,7 +1,9 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef SUBBANDANALYSIS_H
#define SUBBANDANALYSIS_H
#include "Common.h"
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#include "VectorUtility.h"
#include <stddef.h>
#include <math.h>
View
@@ -1,8 +1,10 @@
//
-// Copyright 2011 The Echo Nest. All rights reserved.
+// echoprint-codegen
+// Copyright 2011 The Echo Nest Corporation. All rights reserved.
//
+
#ifndef VECTORUTILITY_H
#define VECTORUTILITY_H
Oops, something went wrong.

0 comments on commit c16c416

Please sign in to comment.