[SCM] libambix/master: New upstream version 0.1.1
umlaeute at users.alioth.debian.org
umlaeute at users.alioth.debian.org
Sun Oct 16 21:42:21 UTC 2016
The following commit has been merged in the master branch:
commit a473dd669d3e1764e173665a8c6f2a74154d1053
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date: Sun Oct 16 23:31:33 2016 +0200
New upstream version 0.1.1
diff --git a/.travis.yml b/.travis.yml
index db98016..ae9be66 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -47,13 +47,9 @@ before_script:
script:
- make
-- LD_LIBRARY_PATH=/usr/local/lib make distcheck
+- LD_LIBRARY_PATH=/usr/local/lib VERBOSE=1 make distcheck
after_success:
- if [[ "x${DO_COVERAGE}" = "xyes" ]] ; then LD_LIBRARY_PATH=/usr/local/lib ./coverage.sh; fi
- if [[ "yes.${TRAVIS_BRANCH}.${TRAVIS_PULLREQUEST}" = "yes.master." ]]; then ./.deploy-documentation.sh ; fi
- bash <(curl -s https://codecov.io/bash)
-
-after_failure:
- # spit out any test-suite results...
- - find . -name test-suite.log -exec grep . {} \+
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..8cb1400
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,4 @@
+ © 2012, Institute of Electronic Music and Acoustics
+ © 2012, ivana
+ © 2012-2016, IOhannes m zmölnig
+ © 2016, Matthias Kronlachner
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 0000000..098e89d
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,1043 @@
+libambix (0.1.1) unstable; urgency=medium
+
+ [ IOhannes m zmölnig ]
+ * debugging printout in full precision
+ * updated pinv testdata
+ * raise threshold for pinv-test
+ * scale the differences to the fixedpoint max
+ * b2e_identity4x4_float: allow to set the eps
+ * tests/b2e_eye4_float32: allow to set the eps
+ * use double internally for test-data generation
+ * use float64_t internally if no speed-loss is to be expected
+ * tests/common_b2e: group ambix file operations
+ * epsilon for tests/b2e_eye4_f32_f64
+ * epsilon for tests/b2e_eye4_f32_i32
+ * adjusted epsilon for b2e_rand4x7_*_pcm16
+ * use VERBOSE envvar to display the test-suite.log on failure
+ * added coverity-override for CID:153347
+ * early exit if no strings are being added
+ * early check for valid data (to avoid dereference before NULL-check)
+ * made CAF-markers C-compatible
+ * helper-script to get authors and copyright per file
+ * added CHANGELOG and NEWS
+
+ -- IOhannes m zmölnig <zmoelnig at iem.at> Sun, 16 Oct 2016 23:21:31 +0200
+
+libambix (0.1) unstable; urgency=medium
+
+ [ IOhannes m zmölnig ]
+ * fixed typos in header
+ * return standard exit-codes
+ * fixed double free if ai_copy_block() failed
+ * allow dynamic matrices
+ * helper-functions to calculate predefined matrices
+ * prevent both matrix-file and matrix-specs at the same time
+ * overload '-X' flag to sepcify adaptor matrix
+ * updated help-printout
+ * re-formatted README (as markdown)
+ * initial Travis-CI config
+ * install build-dependencies for sndfile
+ * go back to project build-dir after building libsndfile
+ * verbose build of libsndfile
+ * fixed check for AMBIX_MATRIX_FUMA
+ * removed superfluous NULL-pointer check
+ * free data on early exit
+ * free temporary fmt buffer
+ * run the test-suite
+ * build everything verbosely
+ * remove libtool libs for libsndfile
+ * debug: check whether /usr/local/lib is in LD_LIBRARY_PATH
+ * debugging via ldd: which libsndfile is used?
+ * set LD_LIBRARY_PATH before running 'make check'
+ * started contributing guide
+
+ [ Matthias Kronlachner ]
+ * pd read external avoid loop on end of file
+ * pd write external support selection of sampleformat
+ * add support for read/write float64 (double)
+ * libsndfile backend support float64 (double)
+ * null backend support float64
+ * coreaudio backend float64 support
+ * add float64 matrix multiplication
+ * add pseudo-inverse matrix operation
+ * utils add float64 support
+
+ [ IOhannes m zmölnig ]
+ * ensure 'foreign' mode for automake
+ * [libambix/tests] include data.h into dist tarball
+ * [libambix/tests] include data/file1.caf into dist tarball
+ * pseudo-build test-data
+ * run `make distcheck` as part of the travis-ci build
+ * need to set the LD_LIBRARY_PATH for distcheck as well
+ * C<=C99 does not allow variable-declarations inside loop-preamble
+ * 'make distcheck' includes 'make check'
+ * copyright-update, trailing whitespace, moved comment
+ * fixed memleaks when calculating the pseudo-inverse fails
+ * fixed memleak when calculating the inverse fails
+ * Fixed typo resulting in FTBFS
+ * Update README.md
+ * more contibuting
+ * don't overwrite the to-be-inverted matrix
+ * nicer printout
+ * zero-padding, doc
+ * testing ambix_matrix_pinv()
+ * free temporary matrix after use.
+ * free eye-matrix after use
+ * skip unimplemented tests
+ * proper NULL-initialization of pointers
+ * print addresses when printing matrices
+ * STOPTEST macro to indicate successfull run of subtest
+ * use STARTTEST/STOPTEST
+ * mtxinverse_test takes 'const' matrices
+ * dynamically transpose data rather than storing transposed data statically
+ * some constness tests for matrix operations
+ * compiler warnings about unimplemented tests
+ * remember to do even more constness tests
+ * added matrix-constness test to testsuite
+ * [doxygen] subgroups
+ * use ascii - rather than unicode –
+ * removed empty lines
+ * fixed comments
+ * easier to read return of -abs()
+ * test-implementation (float32 only) for mergeadaptor_matrix
+ * declarations of the mergeadaptor_matrix() functions
+ * easier to read "return -abs(err)"
+ * call _ambix_mergeAdaptormatrix() if ambix->use_matrix is set when writing
+ * setting the adaptor-matrix in WRITE+BASIC mode switches to BASIC2EXTENDED
+ * fixed typo
+ * easier to read "return -abs(err)"
+ * [doxygen] (sub)sections for cmdline utilities
+ * return INVALID_MATRIX if matrix cannot be inverted
+ * use realinfo.fileformat for setting adaptormatrix in WRITE mode
+ * (fake) return success in the *_if() helpers
+ * print_if() helper that doesn't exit
+ * print matrix if it is uninvertible
+ * test invertibility of standard matrices
+ * basic test for basic2extended writing
+ * first basic2extended test
+ * make ambix_matrix_transpose() and ambix_matrix_invert() as private by prefixing '_'
+ * added _ambix_matrix_transpose() to private header
+ * alternative implementation for matrix inversion
+ * build the alternative matrix-inversion
+ * function prototypes for matrix inversion in private.h
+ * [matrix] use gauss-jordan inversion from matrix-invert.c
+ * [matrix] remove local implementation of gauss-jordan inversion
+ * use cholesky's algorithm to (pseudo) invert matrices
+ * note that cholesky's inversion gives us the pseudo-inverse for free
+ * renamed 'simple' tests to 'basic'
+ * renamed ambix_none.c to common_none.c
+ * saner frequency calculation
+ * use a normal frequency
+ * STARTTEST/STOPTEST now take format-strings and require \n
+ * start/stop for b2e test
+ * b2e: use identity matrix for first test
+ * run b2e test
+ * less verbose
+ * basic2extended testing a number of square matrices
+ * avoid passing of duplicate info to b2e test
+ * use new API for b2e tests
+ * don't test EXTENDED ambi readback
+ * be more specific about writing EXTENDED files as BASIC
+ * allow to open a basic2extended file for writing
+ * need to pass the ambichannels-on-disk to ambix_open()
+ * description of which FuMa matrix is being tested
+ * free mtx after use
+ * free pinv-matrix after use
+ * lower frequency for test-signal
+ * cleanup for early exit
+ * another basic2extended test with a [4x9] random-matrix
+ * make sure to reserve enough memory in the adaptorbuffer
+ * merge-adaptormatrix: cols=full set; rows=reduced set
+ * supporting BASIC2EXTENDED writing
+ * destroy temp matrix after use
+ * run tests in functions to isolate them
+ * removed "goto cleanup"
+ * compare against target ambichannels
+ * use '%g' to pretty-print floats
+ * re-use index variables
+ * simplify addings new TESTS to Makefile.am
+ * split basic2extended tests into separate files
+ * allocate enough memory to hold both raw and adaptored ambi-channels
+ * whitespace
+ * allow to run valgrind for unit-tests
+ * disabled serial-tests so check-valgrind works
+ * fixed memleak in const-matrix tests
+ * remove AX_VALGRIND_DFLT
+ * allow coverity-scan for this branch
+ * ambix_mergeadaptormatrix for all types
+ * basic2extended test with 4x7 matrix
+ * removed unneeded includes
+ * [tests] lower thresholds for diffs
+ * [tests] print used epsilon on failure
+ * [tests] basic2extended tests with extrachannels
+ * added float64 tests
+ * [tests] added basic2extended tests for PCM formats
+ * revert coverity-scan builds on all branches
+ * added copyright info for cholesky decomposition
+ * forgot closing comment
+ * support for using AMB-files as input to ambix-interleave
+ * fixed UUID-printout
+ * renamed 'interleavedata' to the more correct 'interleavedata'
+ * function to DEinterleave data
+ * don't cast the result of malloc()
+ * cleanup heap-allocated memory on early exit
+ * provide a working-buffer for de-interleaving mulichannel input data
+ * use temporary variable for number of channels per source
+ * use temporary variable to check the success of sf_readf()
+ * de-interleave multichannel input data
+ * whitespace
+ * don't build the gh-pages branch with travis-ci
+ * documentation on BASIC2EXTENDED writing
+ * simple doxygen apidoc deploy-script for travis/gh-pages
+ * deploy doxygen
+ * fixed typo in travis.yml
+ * only deploy doxygen if not a PR and on master
+ * getting rid of 'realpath'
+ * print the do-doxygen variable
+ * use C-style comments
+ * TRAVIS_PULLREQUEST is <empty> when there's no PR
+ * link to API documentation
+ * [travis] hardcoding the repository
+ * [travis] print errors when early exiting doxygen-deploy
+ * [travis] B-D on doxygen
+ * [travis] drop DOXYGEN_DEPLOY variable
+ * [travis] drop unneeded blacklist for gh-pages branch
+ * [doxygen] don't embed TIMESTAMP into html
+ * use C++-style comments for missing code
+ * [doxygen] free() the info junk
+ * [doxygen] cosmetic fixes
+ * [ooxygen] rephrased the basic2extended explanation
+ * [doxygen] fix URL to mathjax
+ * [doxygen] one-line project description
+ * [doxygen] use <a href> for external links
+ * [doxygen] started FAQ
+ * [doxygen] exclude a few section from documentation
+ * private versions of _ambix_matrix_multiply() and _ambix_matrix_pinv()
+ * deprecate ambix_matrix_pinv() and ambix_matrix_multiply()
+ * updated copyright
+ * updated copyright-dates
+ * added '--enable-debug' flag to configure
+ * re-ordered flags: preprocessor, compiler, linker
+ * raise visibility for DEBUG builds
+ * added LDFLAGS to coverage builds (and use configure --enable-debug)
+ * more generic testsuite-tests
+ * print line-number when accumulating diffs
+ * some generic tests for matrix-diff
+ * added generic test for data utils
+ * tricking higher coverage
+ * disabled unused code
+ * more matrix tests
+ * disabling more unused code
+ * ignore intermedia files from coverage-analysis
+ * private tests
+ * renamed deploy-doxygen to deploy-documentation
+ * [travis-ci] use addons.apt for installing packages
+ * deploy coverage directory as well...
+ * [travis-ci] create a coverage report
+ * run gcc+coverage and clang+coverity
+ * deploy commits the entire output-directory (and is more verbose)
+ * Use codecov.io as an external code-coverage test service
+ * collapsed duplicate code in ambix_set_adaptormatrix
+ * Call codecov.io after coverage.sh
+ * added codecov.io badge to README.md
+ * fix hyphenation of up-to-date
+
+ [ Matthias Kronlachner ]
+ * add marker and region functions to api
+ * add markers and regions to ambix_t_struct
+ * add implementation for marker and regions
+ * add marker and region debug printout to utilities
+ * add unit test for reading/writing markers and regions
+
+ [ IOhannes m zmölnig ]
+ * make doxyfile settable
+ * fixed typo
+ * mention output and *input* of audio-data
+ * mention float64 asd possible format
+ * single-line fail_if()
+ * run a simpl2extended-test with chunksize=0
+ * cast functions to make values representable in low-resolution formats
+ * make data_* generator functions accept a format-argument
+ * mroe towards type-agnostic tests
+ * adapted to new type-agnostic API
+ * adapted to new type-agnostic API
+ * easier debugging by using helper-vars
+ * include common_b2e.h
+ * adapt to new API (and use a header for function declarations)
+ * alignment, printout...
+ * first test to pass fmt
+ * enabled int32 and int16 builds for specific test (b2e-eye4x4)
+ * split format-tests
+ * [travis-ci] display test-suite logs in case of failure
+ * type-variable readf/writef wrappers
+ * use vartype filereader/writer
+ * consistent function-names for data_* foo
+ * put data_size() and data_calloc() into common-header
+ * use vartype data for b2e tests
+ * consinstent indentation
+ * common helper-functions getpid and unlink
+ * use new helper-functions to create unique filenames
+ * fun to generate uniqueish filename
+ * better uniquefilename generator
+ * use ambixtest_rmfile() instead of unlink()
+ * dynamic outfilename
+ * added a counter to allow for multiple files in the same process
+ * FILENAME macros
+ * use FILENAME macro
+ * use FILENAME_FILE macro for output files
+ * unique-filenames are now generated in the unittestfile itself
+ * indentation
+ * fixed indentation
+ * fixed left-over code that causes FTFBS
+ * normalized indentation
+ * install ca-certificates to (hopefully) support coverity's new certificate
+ * ignore .gcno files
+ * test for ambix_get_sndfile()
+ * build get_sndfile test
+ * yet another workaround for travis-ci's outdated ca-certificates
+ * fixed typo
+ * disable unused code via preprocessor
+ * renamed tests/matrix to tests/matrixtests
+ * allow mtx_pinv() tests without reference result
+ * try to invert MATRIX_ONE and MATRIX_ZERO
+ * early exit if matrix_diff() has NaNs (rather than failure)
+ * fail if mtx-inversions succeeds and no reference result is present.
+ * untabify
+
+ [ Matthias Kronlachner ]
+ * add missing documentation to marker api functions
+ * add private functions for handling chunks and reading/writing marker/region/strings data
+ * add read/write any chunk to sndfile implementation
+ * add implementation of reading/writing marker/region/strings chunk
+ * remove debug outputs
+ * check datasize before reading to avoid crash in case of invalid chunks
+ * remove code duplication for byteswapping
+ * remove warning of passing incompatible pointer types
+ * cast to avoid warnings
+
+ [ IOhannes m zmölnig ]
+ * fixed-all-the-things
+
+ [ Matthias Kronlachner ]
+ * fixed return code
+ * add read/write markers when opening file
+ * marker chunk fix unnecessary allocations
+ * add empty string in marker/region to unittest
+ * pd read output number of markers/regions
+ * pd-read external marker region read/seek support
+ * remove printf from marker unittest
+ * utils info print marker/region info
+
+ [ IOhannes m zmölnig ]
+ * [doc] note on unit-tests and CI
+ * Fixed memleaks in unit-test
+ * Fixed memory leaks in new marker_region_chunk code
+ * refactored ambix_write_chunk()
+ * [tests] link markers_region with common.c
+ * [tests] create "unique" filename for markers_region test
+ * [tests] remove test datafile once we are done
+ * C<99 needs variable declarations at beginning of block
+ * exclude .git* files from export
+ * exclude .git* files from export
+ * bumped version to 0.1
+
+ -- IOhannes m zmölnig <zmoelnig at iem.at> Sun, 5 Oct 2016 22:50:17 +0200
+
+libambix (0.0.1) unstable; urgency=medium
+
+ [ iem user ]
+ * cleaned up include paths
+
+ [ iem user ]
+ * forgot ambix.h
+ * adjusted to custom libsndfile
+ * startup script for custom libsndfile
+ * load some more libraries
+ * some more tests
+ * ax testfiles
+
+ [ IOhannes m zmölnig ]
+ * moved external to pd/ folder
+ * almost empty header files
+ * UTF-8ified
+ * doxygen documentation
+ * dummy base file
+ * start of autotools
+ * doxygen config
+ * use 'unsigned long' rather than 'size_t'
+ * added ambix_err_t
+ * dummy implementation
+ * define AMBIX_INTERNAL when building the library
+ * more documentation
+ * return codes are ambix_err_t
+ * updated gitignore
+ * implemented ambix_get_sndfile
+ * added sampleformat enum
+ * check for libsndfile
+ * start to read files
+ * renamed AMBIX_EXTERN to AMBIX_API
+ * use AMBIX_API
+ * samplerate as double
+ * documentation
+ * typedefs for number types of given width
+ * check for stdint.h
+ * private header
+ * reading matrix
+ * added some fields to ambix_t
+ * might work (or now)
+ * protect file-inclusion with ifdef
+ * no need to check for unistd.h and stdint.h
+ * added matrix type
+ * UUID-chunk handling is now in separate file
+ * put matrix functionality in separate file
+ * removed functions now found in separate files
+ * build newly added files
+ * _ambix_checkuuid() returns uint32_t
+ * use new ambixmatrix_t type
+ * moved sndfile code into separate file
+ * added utility functions
+ * use utility functions
+ * test utilities
+ * reorganized code: (private) sources live in src/
+ * fixed leftovers from function-renames
+ * fixed double free on ambix_close()
+ * set ambixinfo structure after reading
+ * print some information
+ * 32bit byte-swapper helper
+ * ambix_matrix_fill_swapped() to fill matrix with byte-swapped data
+ * check whether we need to byte-swap and do accordingly
+ * reduced includes
+ * UTF8ified
+ * fixed typo
+ * moved typedefs into separate header file
+ * AMBI_EXPORT on gcc: visibility("default")
+ * use visibility=hidden by default
+ * use camelCase for function names
+ * remove trailing whitespace
+ * added some more errors
+ * functions for getting/setting the matrix
+ * fixed typo when assigning samplerate to ambixinfo
+ * reset ambixinfo before setting it and returning to host
+ * print reconstruction matrix
+ * return reconstruction matrix (if feasible)
+ * return proper error codes
+ * MARK() define for easier debugging
+ * use matrix from args
+ * return AMBIX_ERR_SUCCESS rather than 0
+ * added ambix_matrix_copy()
+ * implemented matrix multiplication
+ * renamed getReconstructionMatrix() to getAdaptorMatrix()
+ * dummy implementations for reading audio
+ * documentation
+ * initial adaptorbuffer handling
+ * it's "adaptor" not "adapator"
+ * initialize adaptor buffer on open
+ * function-rename ambix_getReconstructionMatrix() -> ambix_getAdaptorMatrix()
+ * adaptorbuffer resize now takes a sizeof() argument
+ * ambix_matrix_create() and ambix_matrix_destroy()
+ * adaptor code
+ * implement _ambix_readf_ for libsndfile
+ * deinitialize adaptorbuffer on ambix_close()
+ * simple read implementation
+ * shortened and improved description of ambix_readf_*
+ * API for writing ambix files
+ * backend implementation for writing audio to CAF
+ * renamed _ambix_adaptor to _ambix_splitAdaptor
+ * implement mergeAdapator
+ * fixed possible segfault
+ * implement data writing
+ * accessor functions for UUID by version
+ * implemented ambix_matrix_to_uuid1
+ * comment about quality of UUID
+ * renamed setPremultiplyMatrix() to setAdaptorMatrix()
+ * added filemode for read&write
+ * store openmode in ambix_t structure
+ * store byteswap info in ambix_t struct
+ * ambix_write_header()
+ * write_header() implementation
+ * check format before writing header
+ * fixed forgotten */
+ * documentation
+ * write_uuidchunk
+ * setting adaptormatrix for AMBIX_SIMPLE
+ * use matrix2 rather than finalmatrix
+ * shadow ambixinfo to allow easy conversion
+ * ambix_matrix_eye()
+ * clear 2nd matrix on ambix_close()
+ * AMBIX_SIMPLE->AMBIX_EXTENDED conversion
+ * use variables to enhance readability
+ * added ambix_test a simple ambix file writer
+ * private data is now only in backend
+ * first draft of _ambix_write_uuidchunk
+ * (dummy) checks before reading/writing
+ * typo prevented full copy of ambixinfo
+ * check whether properties are correct for writing
+ * _ambix_print_info() helper
+ * handle AMBIX_READ flag
+ * initialize everything to 0
+ * print_sfinfo() helper
+ * initialize everything to 0
+ * force otherchannels to 0 when opening ambix simple
+ * added FIXXME that ambix_open() shouldn't fail so often
+ * ambix_info now takes a list of files
+ * write simple and extended files
+ * use C-style comments rather than C++-style
+ * uncomment the 'extern "C"' clause
+ * moved format-detection logic out of sndfile.c
+ * moved variables to form better groups
+ * check whether reading/writing has started
+ * return negative error in ambix_(read|write)f_*
+ * made it compile...
+ * added unsigned int type to number32_t union
+ * _ambix_swap4array()
+ * simpler implementation (and easier to optimize)
+ * only free matrix if it is self-allocated
+ * full test writing ambix extended
+ * try to get properly aligned memory
+ * freeing chunk_info on close()
+ * trying to get properly align memory
+ * print utilities
+ * is_CAF is only boolean
+ * don't forget to swap rows/cols
+ * write something into matrix
+ * what utilities to expect
+ * moved matrix and utility declaration in separate headers
+ * start (not much yet)
+ * starting ambix_interleave
+ * seems to work a bit...
+ * fixed docs so doxygen stops complaining
+ * better wording
+ * use upper-case at beginning of sentence
+ * re-organized code
+ * protect against double inclusion
+ * checks for libraries
+ * specify Makefile's at beginning of configure.ac
+ * include config.h if possible
+ * write defines to config.h
+ * tests for some sndfile specifics
+ * typedefs for (u)int16
+ * sndfile.h should only be included in the backend specific implementation
+ * need stdio.h for fprintf()
+ * added pkg-config support for autotools
+ * use pkg-config to check for sndfile
+ * use SNDFILE_(CFLAGS|LIBS) for building ambix_interleave
+ * read blocksize from cmdline
+ * ambix_open overwrites ambixinfo, so use a copy
+ * use blocksize from cmdline (and fix copying code)
+ * print info on channels and frames after opening input files
+ * added --help and --version options
+ * added ambix_deinterleave
+ * return SUCCESS on success
+ * matrix multiplication of data-chunks
+ * unit tests
+ * include stdint.h on linux
+ * include unit-tests
+ * renamed 'success' to 'pass' to 'pass'
+ * added fail_if() and friends
+ * a real test: matrices
+ * fixed some issues caught by unittests
+ * ignore some autotools stuff
+ * added some common functions
+ * migrating functions to common.c
+ * some more functions: comparing anonymous data
+ * test for writing AMBIX_NONE files
+ * print data and fix data_sine()
+ * fixed data_sine()
+ * finalized
+ * tests for ambix simple
+ * add eps to _diff() functions
+ * split tests into functions
+ * more data, better eps
+ * added STARTTEST macro
+ * check for isNan
+ * use other matrix values to avoid roundign errors
+ * autoprefix
+ * new data generator: ramp
+ * test for large data multiplication with eye
+ * fixing matrix multiplications
+ * at least deinterleaving simple files now works
+ * test for ambix_extended
+ * fixed extra-names
+ * calloc(membercount, membersize)
+ * changed matrix_fill to accept additional byteswap parameter
+ * adapted to new matrix_fill function
+ * made it work more sanely
+ * implemented matrix reading
+ * removed byteswap business from public API
+ * no more byteswap in ambix API
+ * apply function renames
+ * renamed ambixfileformat to fileformat
+ * renamed 'otherchannels' to 'extrachannels'
+ * adapted to field renames
+ * adapted to no transpose/no byteswap ambix API
+ * error messages and matrix reading
+ * removed ambix_matrix_fill_transposed() from public API
+ * count samples that are outside eps
+ * test for chunked writing
+ * apply interleaver
+ * less verbose
+ * added data_transpose()
+ * fixed datamul test
+ * simplified code
+ * seems to work...
+ * cleaned up code
+ * removed trailing whitespace
+ * ISO-8859-15 to UTF-8
+ * renamed ambixinfo_t to ambix_info_t and likewise ambixmatrix_t
+ * renamed CamelCase names to lower_case names
+ * added license
+ * moved COPYING to root
+ * distribute doxygen file
+ * better wording
+ * generic install instruction
+ * added autogen.sh
+ * removed functions that are now in utils.h
+ * renamed ambix_isFullSet to ambix_is_fullset
+ * allow compilation on libsndfile without get_chunk()
+ * added support for SFC_UUID
+ * added test for sf_set_chunk()
+ * fixed UUID reading with HAVE_UUID_INFO
+ * unlink (delete) files after tests
+ * switch to iterator based chunk reading
+ * check for iterator based chunk access in sndfile
+ * renamed ambix_ to ambix-
+ * what's next?
+ * fixed memleaks in tests
+ * automake doesn't like hyphens in variables
+ * added NULL backend
+ * added ENABLED/DISABLED automake-conditionals
+ * enable silent rules
+ * added forgotten files
+ * let configure handle the soname version
+ * updated homepage field
+ * renamed matrix_fill functions
+ * adapted to function rename
+ * adapted to function rename
+ * remove trailing '====' when printing tests
+ * renamed private member variables
+ * added short readme
+ * clarified docs
+ * first half-implementation of FuMa->ambix converter
+ * allow .amb files to be read
+ * moved doxygen config into doc/ folder
+ * use tex to set formulas
+ * its libambix not libGcrypt
+ * added main documentation in libambix.h
+ * usage documentation (reading)
+ * documentation fixups
+ * removed ambix_write_header()
+ * ambix_write_header() has been removed
+ * ambix_write_header() has been removed
+ * removed executable flag from data files
+ * removed start-script only valid for a special computer
+ * getting rid of old code
+ * added check for OS
+ * more documentation
+ * stub for Pd-external
+ * configure the Pd-part
+ * added some more M4-macros
+ * added convenience links and RTE_FLAGS
+ * made it compile
+ * starting to implement ambix_read~
+ * rename CHECK_RTE to IEM_CHECK_RTE
+ * more in pd
+ * fixed splitAdaptormatrix implementations
+ * ambix_writef_*() takes pointer to const data
+ * use (const) pointers where appropriate
+ * non-threaded and working prototype
+ * link against libambix
+ * added ambix-dump, as simple utility that dumps ambix-files to the stdout
+ * shortened lines in comments to 80chars
+ * formatting
+ * ambix_writef() now take pointers to const sources
+ * iso2utf conversion
+ * use v5(SHA1) UUIDs
+ * added notes on format bugs
+ * renamed "SIMPLE" to "BASIC"
+ * enumerate some common conversion matrices
+ * doxygen files now reside in doc/
+ * added pd to SUBDIRS
+ * make _matrix_(diag|router) available internally
+ * move _matrix_sid2acn into separate source file
+ * move FuMa code into separate file
+ * added docs about .amb format
+ * started to port jack.play to ambix-jplay
+ * fixed boilerplate description
+ * enhanced utils/README
+ * added copyright boilerplate to ambix-jplay
+ * use ambix-jplay throughout
+ * use full pathname in usage()
+ * indentation
+ * common files for jack-clients
+ * slowly moving towards ambix-jplay
+ * when requesting EXTENDED as BASIC, return the number of decoded ambichannels
+ * small jcommon library
+ * include jcommon library into build system
+ * got some sound
+ * code cleanup
+ * properly setting memory to zero
+ * when splitting the interleaved data, we need to take care of the _real_ channel layout
+ * properly split out the extrachannels
+ * don't fail if libsamplerate cannot be found
+ * include config.h if there
+ * include jack.record as ambix-jrecord
+ * don't override HAVE_SAMPLERATE
+ * run even without libsamplerate
+ * AC_DEFINE(HAVE_*) for pkg-config
+ * starting to make it work
+ * renamed 'jack_client_unique_store' to 'jack_client_unique'
+ * group jack calls together
+ * added 'jack_client_unique' to libjcommon
+ * added '_jack_port_register' to jcommon
+ * moved functions to jcommon
+ * compiles, now make it work
+ * disabled unneeded cmdline flags
+ * fixed copyright dates for rohan
+ * changed 'jack.record' to 'ambix-jrecord'
+ * build ambix-jrecord
+ * trying to read matrixfile
+ * AVN numbering starts at zero
+ * provide client-unique function for (const char*)
+ * recording something
+ * provide default filename to ease debugging
+ * basic recording works!
+ * set adaptor matrix
+ * remove debug printout for matrices
+ * better description
+ * matix_permutate
+ * better matrix_print
+ * ambix-matrix check
+ * return NULL if FuMa is invalid
+ * hopefully good implementation of FuMa matrices
+ * removed unneeded code
+ * only calculate weight+order matrix once during life-cycle
+ * trying to reduce stack-size and simplify code
+ * 0order FuMa-matrix
+ * simplified code a bit
+ * 1st attempt to create ambix2fuma mapping
+ * check ambix2fuma matrices
+ * creating AMBIX2FUMA matrices
+ * fixed ambix2fuma conversion
+ * run some tests on matrix fillers
+ * add "name" argument to STARTTEST
+ * more checks for matrix fillers
+ * prototype for '_matrix_ambix2fuma'
+ * MATRIX_SID implementation
+ * starting to implement MATRIX_N3D
+ * N3D/SN3D and SID/ACN
+ * use fabs() rather than abs() for float32_t
+ * print small values with %g
+ * raise eps to 1e-6
+ * proper labelling for the matrices tests
+ * free memory
+ * prevent memleaks
+ * fully initialize (S)N3D weight vectors
+ * updated TODO
+ * fixed memleaks
+ * added inversion check for norm/order
+ * changed bitmask fields for AMBIX_READ/AMBIX_WRITE
+ * implementation of ambix_seek()
+ * allow seeking
+ * implemented ambix_seek
+ * more TODO
+ * use PACKAGE_VERSION for version display
+ * remove unneccessary includes
+ * added '-v' flag
+ * print some more matrices
+ * --version information ambix-j(record|play)
+ * added synopsis for jtools
+ * consistent help/version information
+ * don't install devtools
+ * note on install target
+ * fixed description of ambix_seek()
+ * AMBIX_SIMPLE -> AMBIX_BASIC
+ * install libraries into rte_
+ * no more pkglib_, we use rte_ now
+ * enable build of Pd externals
+ * fixed CFLAGS/LIBADD for libjcommon.la
+ * include <stdio.h> for printf()
+ * build-system issues have been sorted out
+ * clarified README
+ * ignore lots of by-products
+ * fixed typos
+ * more cross-references
+ * added first draft for [ambix_write~]
+ * allow to set matrix
+ * use post() rather than printf()
+ * added BUGS file
+ * added note about [writesf~] license
+ * changed 'Libgcrypt' to 'libambix' in boilerplate
+ * mention MSP in ambix_read~
+ * don't fail if no matrix is present
+ * code cleanup
+ * starting to re-implement ambix_read~ with threads
+ * we have sound but it is jerky
+ * remove whitespaces
+ * only seek if needed
+ * playback works
+ * search canvas-paths for file
+ * send matrix when in EXTENDED mode
+ * disable MARK()
+ * fail if we cannot allocate a deinterleavebuffer
+ * explain a bit about the ambix-deinterleave bug
+ * fixed bug when deinterlacing extra-only files
+ * nicer error messages
+ * ambix-deinterleave bug has been fixed
+ * run AM_PROG_CC_C_O for per-target flags
+ * use AM_CPPFLAGS rather than INCLUDES
+ * remove testing target
+ * only copy the matrix if opening was successfull
+ * output ambixinfo
+ * it seems like we should lock the shared data in the tick callback
+ * clear buffer (to avoid playing old samples)
+ * linebreaks to increase readability
+ * hopefully got the EOF check right
+ * don't start to send samples if we still need to send out matrix/ambixinfo
+ * build [ambix_info]
+ * updated help-patches
+ * install Pd-stuff into @rtedir@/ambix
+ * generate ambix-meta.pd
+ * fix file-handle leak
+ * output full filename
+ * use calloc() instead of malloc()
+ * fix memleak
+ * removed pd/old/ directory
+ * use "private_data" instead of "private" member
+ * cast results of malloc() and friends to correct types
+ * functions always have to declare what they will return
+ * declarations of some used functions
+ * in C++ <enum>s and <int>s are not the same
+ * include <unistd> when needed
+ * C++ is more strict regarding implicit casts
+ * trailing whitespaces
+ * ambix_write_matrix() does not return anything
+ * include "jcommon/observe-signal.h" when needed
+ * rindex() returns (const char*) when given a (const char*)
+ * don't include search in generated docs
+ * coalesce all headers into ambix.h
+ * moved main docs into .incl file (and hide it in generated files)
+ * output HTML into apiref/ directory
+ * build doxygen documentation
+ * check for doxygen
+ * only build docs if doxygen is present
+ * libambix.h is now called libambix.incl
+ * libambix.doxy lives in srcdir
+ * add Pd-patches to distribution
+ * adding pkg-config files
+ * version-info is set to 0:0:0
+ * removed unneeded code
+ * spell it "AMBIsonics eXchange"
+ * ISO-8859 to UTF-8 conversion
+ * only use stdint.h replacements for MSVC
+ * don't fail if a pkg-module cannot be found
+ * dummy VS208 project
+ * made debug project work
+ * explicit type-casts to reduce warnings in MSVC
+ * MSVC doesn't know about "inline", only "__inline"
+ * trying to make reducer_v work with MSVC
+ * use rows_v[] to check whether the setting is valid
+ * fixed "Release" config
+ * more type-fixes to keep MSVC happy
+ * visualstudio property pages
+ * use property pages
+ * project for ambix-info
+ * dummy projects for utils
+ * updated projects
+ * removed unneeded variables
+ * made it compile with MSVC
+ * moved HAVE_SNDFILE_H from ambix.vsprops to libsndfile.vsprops
+ * made it compile without wawrnings on MSVC
+ * MSVC properties for Pd
+ * added project for [ambix_info]
+ * fixed typos in tmpvar names
+ * dummy projects for Pd objects
+ * on w32, define MSW
+ * added pthread propertypage
+ * add more pd-objects to solution
+ * added hacks to ease compilation with MSVC/MinGW
+ * added winhacks to w32-builds
+ * add pthreads to read~/write~ externals
+ * make [ambix_read~] compile on MSVC
+ * our libsndfile has all the chunk-stuff
+ * make buildlog-files project specific
+ * build with winhacks
+ * more msvc fixes for strncpy() and the like...
+ * provide a strndup implementation
+ * use winhacks
+ * strndup() is needed both on msvc and mingw
+ * enhance target-specific flags with AM_FLAGS
+ * fix crasher bug with signed/unsigned
+ * indentation
+ * snprintf() takes a const format-string
+ * getting rid of warnings
+ * dummy use of variables
+ * remove lines that don't do anything
+ * fixed typo '==' is not the same as '='
+ * use parenthesis to clarify what is going on
+ * decrement frames to write by the actual number of frames written
+ * removed obsolete doxygen settings
+ * no need to check uint32>=0
+ * memsetting entire chunk to 0
+ * C<C99 does not really allow to repeat typedefs
+ * handle the case where realloc() returns NULL
+ * check return of malloc()
+ * always return negative errors in _write() functions
+ * check return of malloc()
+ * still trying to get rid of signed/unsigned warnings
+ * include config.h is available
+ * include sys/types.h if available
+ * only use PACKAGE_BUGREPORT|URL if available
+ * C-style comments are /* */ rather than \* *\
+ * protect usage of PACKAGE_VERSION
+ * replacement library for uncommon functions
+ * use 'static' so we can inline the replacements
+ * added replacement/ folder to build
+ * use replacement/strndup.h
+ * use central replacement/strndup.h
+ * distribute but don't install headers
+ * add path to find replacement/*.h
+ * renamed win to w32
+ * Makefile.am generator
+ * should be EXTRA_DIST rather than noinst_DATA
+ * avoid ambiguities
+ * add build/ to autoconf
+ * added pthread.vsprops
+ * force [ambix_readX~] to be build after [ambix_read~]
+ * ignore MSVC files
+ * add winhacks.h to dist
+ * typos
+ * fixed spelling
+ * krazy2 spelling corrections
+ * UTF8'ified
+ * XCode3 project file for building C-libraries
+ * fix null-backend
+ * use "struct SNDFILE_tag" rather than "typedef SNDFILE"
+ * buildable project
+ * updated project file to build universal binaries
+ * working on ambix framework
+ * more on AmbiX.framework
+ * framework that almost works
+ * use @rpath as INSTALL_PATH
+ * note on embedding libsndfile
+ * iso2utf8
+ * style-fixes according to krazy2
+ * added documentation
+ * threaded reader/writer objectclasses for Pd have been implemented
+ * todo: (optionally) replace libsndfile dependency
+ * added m4-macros to check for OSX-frameworks
+ * replaced C-style comments with shell-comments
+ * check for AudioToolbox framework
+ * stub implementation for coreaudio loader
+ * Added (conditional) check of ObjC
+ * use CoreAudio as fallback when no libsndfile is present
+ * move default AM_CONDITIONALs out of sndfile block
+ * added "--with-sndfile" flags to configure
+ * _ambix_get_sndfile() now returns 'struct SNDFILE_tag*'
+ * conditionally build programs depending on sndfile
+ * disable checks for sndfile if requested by user
+ * disable checks for CoreAudio if requested
+ * disable checks for JACK if requested
+ * fix typo when setting default values for "have_sndfile"
+ * disable checks for libsamplerate if requested
+ * fixed help-string for --with-CoreAudio
+ * move ambix_get_sndfile to the end
+ * properly set OBJCFLAGS
+ * starting to work on coreaudio backend
+ * Fix file description header
+ * CoreAudio support also needs the Foundation-framework
+ * opending ExtAudioFile via AudioFile
+ * opening works!
+ * starting open_write()
+ * trying to construct ambix2coreaudio info
+ * check result of coreaudio2ambix_info()
+ * simplify is_AMBIX code
+ * make isCAF endian-safe
+ * UUID print helpers
+ * check endianness of file vs host
+ * trying to fix AM_CONDITIONALS for double-checked frameworks
+ * removed stray ]
+ * conditionally build Pd-externals
+ * replace AC_LIB_APPENDTOVAR with ordinary shell-code
+ * seeking
+ * indentation
+ * more error checking
+ * first draft of CoreAudio reader
+ * first draft of coreaudio writer
+ * first draft for writing UUID-chunk using CoreAudio
+ * now make it work...
+ * indentation
+ * no need to reimplement the get_sndfile() in all non-sndfile backends
+ * unifying the format converters
+ * trying to write (unsuccessfully)
+ * set is_AMBIX when opening for writing
+ * setting byteswap/channels when opening for writing
+ * reduce verbosity
+ * ambix_readf may return less frames than requestd!
+ * ambix_readf() can return less frames than requested without being a bug
+ * split AMBIX_SIMPLE tests
+ * split test(s) for AMBIX_NONE
+ * split AMBIX_EXTENDED tests
+ * make sure that %d only gets an (int)
+ * better printout
+ * fixed bytesPerFrame calculation
+ * use coreaudio_getFlags() to calculate the lpcm flags
+ * try to correctly use bigEndian & nativeEndian
+ * fixed printf format specifier: it's %lu rather than %ul
+ * [savepanel] instead of [openpanel]
+ * renamed coreaudio_setFormat() to coreaudio_setClientFormat()
+ * removed empty manual
+ * Moved Pd-sample code into 'samples/' subfolder
+ * remove trailing whitespaces
+
+ [ ivana ]
+ * simle test for opening/closing a CAF-file
+ * Added seek-tests and modified open and close test (close returns !NULL when fails).
+ * Added new test for read and write functions, don't work
+
+ [ IOhannes m zmölnig ]
+ * use define AMBIXTEST_FILE1 for hardcoded testfiles
+ * added MARK() macro
+ * skip test if file cannot be opened rather than fail
+ * wrapper scripts to run tests in valgrind
+ * free ressources that have been allocated
+ * allow to disable building of RTE-plugins completely
+ * code-coverage analyser using gcov/lcov
+ * no need to disable-shared for coverage-tests
+ * proper array initialization
+ * added testfile
+ * fixing filename for test-data
+ * put data definitions into separate header-file
+ * format clarification
+ * modernized call to AM_INIT_AUTOMAKE
+ * fixing FuMa format (thanks to Aaron Heller)
+ * new phony targets "buildtests"
+ * terser testing of matrix creation,...
+ * ambix_close() returns ambix_err_t
+ * tests currently need serial-tests
+ * use AM_TESTS_ENVIRONMENT instead of TESTS_ENVIRONMENT
+ * make sure that o.client_name is NULL-terminated
+ * destroy expand/reduce/weightorder matrices on error
+ * destroy expand/reduce/weightorder matrices on error
+ * freeing temporary data on early exit (CID:22439)
+ * freeing temporary memory
+ * no need to call ai_close() if ai_dump_block() failed
+ * removed superfluous check
+ * default format to "0" and do default handling afterwards
+ * added missing "break;"
+ * use 64bit integer arithmetic for multiplying large integers
+ * check return of sf_open() (and assert ai->outhandles)
+ * make sure ai->outinfo has been allocated
+ * evaluate result of ambix_matrix_copy()
+ * proper detection of SFM_RDRW
+ * check whether ambix_readf() returns negative framecount
+ * (un)locking mutex in ctor
+ * (un)locking mutex in ctor
+ * fixed error printout
+ * protecting x_state with mutex
+ * ouch, need to unlock() the mutex after use...
+ * protex x_state with mutex
+ * no need to call ai_close() if ai_dump_block() failed (again)
+ * simplified error-handling in ambix-dump
+ * text alignment
+
+ -- IOhannes m zmölnig <zmoelnig at iem.at> Sun, 14 Apr 2014 12:21:57 +0200
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..2c0c460
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,29 @@
+libambix (0.1.1) unstable; urgency=medium
+
+ * Fixed coverity-scan issues
+ CID: 153342,153344,153345,153346,153347
+
+ * Adjusted test-suite tresholds
+ To cater for different precisions on various CPU-types
+
+ -- IOhannes m zmölnig <zmoelnig at iem.at> Sun, 16 Oct 2016 23:21:51 +0200
+
+libambix (0.1) unstable; urgency=medium
+
+ * Support for float64
+
+ * Support for markers in CAF-files
+
+ * Stable matrix inversion
+
+ * Many bug fixes,...
+
+ * travis-ci, coverity & codecov integration
+
+ -- IOhannes m zmölnig <zmoelnig at iem.at> Sun, 5 Oct 2016 22:50:17 +0200
+
+libambix (0.0.1) unstable; urgency=medium
+
+ * Initial release.
+
+ -- IOhannes m zmölnig <zmoelnig at iem.at> Sun, 14 Apr 2014 12:21:57 +0200
diff --git a/build/utils/git-copyright.py b/build/utils/git-copyright.py
new file mode 100755
index 0000000..f254d7c
--- /dev/null
+++ b/build/utils/git-copyright.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# git-copyright: extract copyright-information from git
+#
+#
+# Copyright © 2016, IOhannes m zmölnig, forum::für::umläute, institute of electronic music and acoustics (iem)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+# .
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Affero General Public License for more details.
+# .
+# You should have received a copy of the GNU Affero General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+from __future__ import print_function
+
+import git
+import sys
+
+verbose = 0
+
+def eprint(*args, **kwargs):
+ print(*args, file=sys.stderr, **kwargs)
+
+author_aliases={
+ "zmoelnig": "IOhannes m zmölnig",
+ "IOhannes m zmoelnig": "zmoelnig",
+ "iem user": "Institute of Electronic Music and Acoustics",
+ "CUBEmixer": "Institute of Electronic Music and Acoustics",
+ }
+
+
+def commits2authordates(path):
+ g = git.cmd.Git(path)
+ #g.log('--name-only', '--pretty="%% %ad %an"')
+
+ ## collect all commits
+ #g.log('--pretty="%h %ad %an"', '--date=short').split("\n")
+
+ commits=g.log('--pretty=%h').split("\n")
+
+ filedict=dict()
+ copydict=dict()
+ for c in commits:
+ if verbose:
+ eprint("processing %s" % (c))
+ author=g.show('--pretty="%an"', '-s', c).strip('"')
+ date=g.show('--pretty="%ad"', '-s', '--date=short', c).strip('"')
+ files=g.show('--pretty=', '--name-only', c).split("\n")
+ while author in author_aliases:
+ author=author_aliases[author]
+ for f in files:
+ f=f.strip('"')
+ if not f in filedict:
+ filedict[f]=dict()
+ if not author in filedict[f]:
+ filedict[f][author]=[]
+ filedict[f][author]+=[date]
+ if not author in copydict:
+ copydict[author]=[]
+ copydict[author]+=[date]
+ return (filedict, copydict)
+
+def copyright4files(filedict):
+ for f in sorted(filedict):
+ thisfile=filedict[f]
+ authors=list(thisfile.keys())
+ authors.sort()
+ copyright=[]
+ for a in authors:
+ dates=thisfile[a]
+ dates.sort()
+ year0=dates[0].split("-")[0]
+ year1=dates[-1].split("-")[0]
+ if year0 == year1:
+ if year0 == "2012":break
+ copyright+=["%s, %s" % (year0, a)]
+ else:
+ copyright+=["%s-%s, %s" % (year0,year1, a)]
+ if copyright:
+ print("%s" % (f))
+ copyright.sort()
+ for c in copyright:
+ print(" © %s" % (c))
+
+def copyright4repo(copydict):
+ if copydict:
+ authors=list(copydict.keys())
+ authors.sort()
+ copyright=[]
+ for a in authors:
+ dates=copydict[a]
+ dates.sort()
+ year0=dates[0].split("-")[0]
+ year1=dates[-1].split("-")[0]
+ if year0 == year1:
+ # if year0 == "2012":break
+ copyright+=["%s, %s" % (year0, a)]
+ else:
+ copyright+=["%s-%s, %s" % (year0,year1, a)]
+ if copyright:
+ copyright.sort()
+ for c in copyright:
+ print(" © %s" % (c))
+
+def main():
+ import argparse
+ global verbose
+
+ parser = argparse.ArgumentParser(description='Extract copyright information from archive.')
+ parser.add_argument('--verbose', '-v', action='store_true',
+ help='raise verbosity')
+ parser.add_argument('--per-file', action='store_true',
+ help='show per-file copyright information (rather than per-project)')
+ args = parser.parse_args()
+
+ verbose = args.verbose
+
+ c4f, c4r = commits2authordates(".")
+ if args.per_file:
+ copyright4files(c4f)
+ else:
+ copyright4repo(c4r)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/configure.ac b/configure.ac
index 685f4bb..154e0bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([ambix],[0.1],[zmoelnig at iem.at],
+AC_INIT([ambix],[0.1.1],[zmoelnig at iem.at],
[libambix],[http://ambisonics.iem.at/xchange/format])
AM_INIT_AUTOMAKE([foreign])
diff --git a/libambix/src/adaptor.c b/libambix/src/adaptor.c
index dcc3842..493577e 100644
--- a/libambix/src/adaptor.c
+++ b/libambix/src/adaptor.c
@@ -87,7 +87,7 @@ _AMBIX_SPLITADAPTOR(int16);
-#define _AMBIX_SPLITADAPTOR_MATRIX(type) \
+#define _AMBIX_SPLITADAPTOR_MATRIX(type, sumtype) \
ambix_err_t _ambix_splitAdaptormatrix_##type(const type##_t*source, uint32_t sourcechannels, \
const ambix_matrix_t*matrix, \
type##_t*dest_ambi, type##_t*dest_other, \
@@ -100,7 +100,7 @@ _AMBIX_SPLITADAPTOR(int16);
uint32_t outchan, inchan; \
const type##_t*src = source+sourcechannels*f; \
for(outchan=0; outchan<fullambichannels; outchan++) { \
- float32_t sum=0.; \
+ sumtype##_t sum=0.; \
for(inchan=0; inchan<rawambichannels; inchan++) { \
sum+=mtx[outchan][inchan] * src[inchan]; \
} \
@@ -112,13 +112,13 @@ _AMBIX_SPLITADAPTOR(int16);
return AMBIX_ERR_SUCCESS; \
}
-_AMBIX_SPLITADAPTOR_MATRIX(float32);
-_AMBIX_SPLITADAPTOR_MATRIX(float64);
+_AMBIX_SPLITADAPTOR_MATRIX(float32, float32);
+_AMBIX_SPLITADAPTOR_MATRIX(float64, float64);
/* both _int16 and _int32 are highly unoptimized!
* LATER: add some fixed point magic to speed things up
*/
-_AMBIX_SPLITADAPTOR_MATRIX(int32);
-_AMBIX_SPLITADAPTOR_MATRIX(int16);
+_AMBIX_SPLITADAPTOR_MATRIX(int32, float32);
+_AMBIX_SPLITADAPTOR_MATRIX(int16, float32);
#define _AMBIX_MERGEADAPTOR(type) \
ambix_err_t _ambix_mergeAdaptor_##type(const type##_t*source1, uint32_t source1channels, \
@@ -143,7 +143,7 @@ _AMBIX_MERGEADAPTOR(int16);
//#define _AMBIX_MERGEADAPTOR_MATRIX(type) \
-#define _AMBIX_MERGEADAPTOR_MATRIX(type) \
+#define _AMBIX_MERGEADAPTOR_MATRIX(type, sumtype) \
ambix_err_t _ambix_mergeAdaptormatrix_##type(const type##_t*ambi_data, const ambix_matrix_t*matrix, \
const type##_t*otherdata, uint32_t source2channels, \
type##_t*destination, int64_t frames) { \
@@ -156,7 +156,7 @@ _AMBIX_MERGEADAPTOR(int16);
uint32_t outchan, inchan; \
const type##_t*src = ambi_data+fullambichannels*f; \
for(outchan=0; outchan<ambixchannels; outchan++) { \
- float32_t sum=0.; \
+ sumtype##_t sum=0.; \
for(inchan=0; inchan<fullambichannels; inchan++) { \
sum+=mtx[outchan][inchan] * src[inchan]; \
} \
@@ -169,7 +169,7 @@ _AMBIX_MERGEADAPTOR(int16);
return AMBIX_ERR_SUCCESS; \
}
-_AMBIX_MERGEADAPTOR_MATRIX(float32);
-_AMBIX_MERGEADAPTOR_MATRIX(float64);
-_AMBIX_MERGEADAPTOR_MATRIX(int32);
-_AMBIX_MERGEADAPTOR_MATRIX(int16);
+_AMBIX_MERGEADAPTOR_MATRIX(float32, float32);
+_AMBIX_MERGEADAPTOR_MATRIX(float64, float64);
+_AMBIX_MERGEADAPTOR_MATRIX(int32, float32);
+_AMBIX_MERGEADAPTOR_MATRIX(int16, float32);
diff --git a/libambix/src/marker_region_chunk.c b/libambix/src/marker_region_chunk.c
index db6fb21..33319d2 100644
--- a/libambix/src/marker_region_chunk.c
+++ b/libambix/src/marker_region_chunk.c
@@ -62,31 +62,32 @@ typedef enum {
} kCAF_SMPTE_TimeType; // uint32_t
/* this is for the mType field of CAFMarker */
+#define AMBIX_MAKE_MARKER(a, b, c, d) ((uint32_t) ((((uint32_t) (a)) << 24) | ((b) << 16) | ((c) << 8) | (d)))
typedef enum {
kCAFMarkerType_Generic = 0,
- kCAFMarkerType_ProgramStart = 'pbeg',
- kCAFMarkerType_ProgramEnd = 'pend',
- kCAFMarkerType_TrackStart = 'tbeg',
- kCAFMarkerType_TrackEnd = 'tend',
- kCAFMarkerType_Index = 'indx',
- kCAFMarkerType_RegionStart = 'rbeg',
- kCAFMarkerType_RegionEnd = 'rend',
- kCAFMarkerType_RegionSyncPoint = 'rsyc',
- kCAFMarkerType_SelectionStart = 'sbeg',
- kCAFMarkerType_SelectionEnd = 'send',
- kCAFMarkerType_EditSourceBegin = 'cbeg',
- kCAFMarkerType_EditSourceEnd = 'cend',
- kCAFMarkerType_EditDestinationBegin = 'dbeg',
- kCAFMarkerType_EditDestinationEnd = 'dend',
- kCAFMarkerType_SustainLoopStart = 'slbg',
- kCAFMarkerType_SustainLoopEnd = 'slen',
- kCAFMarkerType_ReleaseLoopStart = 'rlbg',
- kCAFMarkerType_ReleaseLoopEnd = 'rlen'
+ kCAFMarkerType_ProgramStart = AMBIX_MAKE_MARKER('p', 'b', 'e', 'g'),
+ kCAFMarkerType_ProgramEnd = AMBIX_MAKE_MARKER('p', 'e', 'n', 'd'),
+ kCAFMarkerType_TrackStart = AMBIX_MAKE_MARKER('t', 'b', 'e', 'g'),
+ kCAFMarkerType_TrackEnd = AMBIX_MAKE_MARKER('t', 'e', 'n', 'd'),
+ kCAFMarkerType_Index = AMBIX_MAKE_MARKER('i', 'n', 'd', 'x'),
+ kCAFMarkerType_RegionStart = AMBIX_MAKE_MARKER('r', 'b', 'e', 'g'),
+ kCAFMarkerType_RegionEnd = AMBIX_MAKE_MARKER('r', 'e', 'n', 'd'),
+ kCAFMarkerType_RegionSyncPoint = AMBIX_MAKE_MARKER('r', 's', 'y', 'c'),
+ kCAFMarkerType_SelectionStart = AMBIX_MAKE_MARKER('s', 'b', 'e', 'g'),
+ kCAFMarkerType_SelectionEnd = AMBIX_MAKE_MARKER('s', 'e', 'n', 'd'),
+ kCAFMarkerType_EditSourceBegin = AMBIX_MAKE_MARKER('c', 'b', 'e', 'g'),
+ kCAFMarkerType_EditSourceEnd = AMBIX_MAKE_MARKER('c', 'e', 'n', 'd'),
+ kCAFMarkerType_EditDestinationBegin = AMBIX_MAKE_MARKER('d', 'b', 'e', 'g'),
+ kCAFMarkerType_EditDestinationEnd = AMBIX_MAKE_MARKER('d', 'e', 'n', 'd'),
+ kCAFMarkerType_SustainLoopStart = AMBIX_MAKE_MARKER('s', 'l', 'b', 'g'),
+ kCAFMarkerType_SustainLoopEnd = AMBIX_MAKE_MARKER('s', 'l', 'e', 'n'),
+ kCAFMarkerType_ReleaseLoopStart = AMBIX_MAKE_MARKER('r', 'l', 'b', 'g'),
+ kCAFMarkerType_ReleaseLoopEnd = AMBIX_MAKE_MARKER('r', 'l', 'e', 'n'),
} kCAFMarkerType; // uint32_t
/* individual marker struct */
typedef struct {
- uint32_t mType;
+ kCAFMarkerType mType;
float64_t mFramePosition;
uint32_t mMarkerID; // reference to a mStringsIDs for naming
CAF_SMPTE_Time mSMPTETime;
@@ -204,6 +205,8 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
/* first parse strings and save into a struct for later usage */
while (strings_datasize) {
void*strings_data = _ambix_read_chunk(ambix, strg_id.a, chunk_it++, &strings_datasize);
+ if (!strings_data)
+ continue;
if (strings_datasize > SIZEOF_CAFStrings) {
uint32_t temp_num_strings = 0;
int64_t mstrings_datasize = 0;
@@ -213,8 +216,7 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
if (byteswap)
_ambix_swap4array(&strings_chunk->mNumEntries, 1);
if (strings_datasize < (SIZEOF_CAFStrings + strings_chunk->mNumEntries*sizeof(CAFStringID))) {
- if (strings_data)
- free(strings_data);
+ free(strings_data);
break;
}
temp_num_strings = strings_chunk->mNumEntries;
@@ -245,8 +247,7 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
mystrings.num_strings++;
}
}
- if (strings_data)
- free(strings_data);
+ free(strings_data);
}
/* parse markers */
@@ -257,14 +258,15 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
mark_id.b[0] = 'm'; mark_id.b[1] = 'a'; mark_id.b[2] = 'r'; mark_id.b[3] = 'k';
while (marker_datasize) {
void*marker_data = _ambix_read_chunk(ambix, mark_id.a, chunk_it++, &marker_datasize);
+ if (!marker_data)
+ continue;
if (marker_datasize > 2*sizeof(uint32_t)) {
CAFMarkerChunk* marker_chunk = (CAFMarkerChunk*)marker_data;
unsigned char* bytePtr = NULL;
if (byteswap)
swap_marker_chunk(marker_chunk);
if (marker_datasize < (marker_chunk->mNumberMarkers*(sizeof(CAFMarker)) + 2*sizeof(uint32_t))) {
- if (marker_data)
- free(marker_data);
+ free(marker_data);
break;
}
bytePtr = (unsigned char*)marker_data;
@@ -285,8 +287,7 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
bytePtr += sizeof(CAFMarker);
}
}
- if (marker_data)
- free(marker_data);
+ free(marker_data);
}
} while(0);
@@ -301,6 +302,8 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
while (region_datasize) {
region_data = _ambix_read_chunk(ambix, regn_id.a, chunk_it++, ®ion_datasize);
+ if(!region_data)
+ continue;
if (region_datasize > 2*sizeof(uint32_t)) {
int64_t data_read = 0;
unsigned char* bytePtr = NULL;
@@ -308,8 +311,7 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
if (byteswap)
swap_region_chunk(region_chunk);
if (region_datasize < (region_chunk->mNumberRegions*(SIZEOF_CAFRegion+sizeof(CAFMarker)) + SIZEOF_CAFRegionChunk)) {
- if (region_data)
- free(region_data);
+ free(region_data);
break;
}
bytePtr = (unsigned char*)region_data;
@@ -347,8 +349,7 @@ ambix_err_t _ambix_read_markersregions(ambix_t*ambix) {
ambix_add_region(ambix, &new_ambix_region);
}
}
- if (region_data)
- free(region_data);
+ free(region_data);
}
} while(0);
@@ -383,31 +384,35 @@ void add_string_to_data(int id, unsigned char *byte_ptr_stringid, char *name, in
ambix_err_t _ambix_write_markersregions(ambix_t*ambix) {
uint32_t i;
int byteswap = ambix->byteswap;
+ uint32_t num_strings = ambix->num_markers+ambix->num_regions;
void *strings_data = NULL;
- uint32_t num_strings = ambix->num_markers+ambix->num_regions;
+ void *marker_data = NULL;
+ void *region_data = NULL;
uint32_t datasize_strings = 0;
+ uint32_t datasize_markers = 0;
+ uint32_t datasize_regions = 0;
+
unsigned char* byte_ptr_strings = NULL;
unsigned char* byte_ptr_stringid = NULL;
int64_t byteoffset_strings = 0;
-
- void *marker_data = NULL;
- uint32_t datasize_markers = 0;
+ CAFStrings *strings_chunk = NULL;
/* reserve space for strings */
- if (num_strings > 0) {
- CAFStrings *strings_chunk = NULL;
- datasize_strings = sizeof(uint32_t)+num_strings*sizeof(CAFStringID);
- strings_data = calloc(1, datasize_strings+256); // reserve a fixed space of 256 bytes for each string
- byte_ptr_strings = (unsigned char*)strings_data;
- byte_ptr_strings += (sizeof(uint32_t)+num_strings*(sizeof(CAFStringID)));
- byte_ptr_stringid = (unsigned char*)strings_data;
- byte_ptr_stringid += sizeof(uint32_t);
- strings_chunk = (CAFStrings*)strings_data;
- strings_chunk->mNumEntries = num_strings;
- if (byteswap)
- _ambix_swap4array(&strings_chunk->mNumEntries, 1);
+ if (!num_strings) {
+ return AMBIX_ERR_SUCCESS;
}
+ datasize_strings = sizeof(uint32_t)+num_strings*sizeof(CAFStringID);
+ strings_data = calloc(1, datasize_strings+256); // reserve a fixed space of 256 bytes for each string
+ byte_ptr_strings = (unsigned char*)strings_data;
+ byte_ptr_strings += (sizeof(uint32_t)+num_strings*(sizeof(CAFStringID)));
+ byte_ptr_stringid = (unsigned char*)strings_data;
+ byte_ptr_stringid += sizeof(uint32_t);
+ strings_chunk = (CAFStrings*)strings_data;
+ strings_chunk->mNumEntries = num_strings;
+ if (byteswap)
+ _ambix_swap4array(&strings_chunk->mNumEntries, 1);
+
/* markers */
if (ambix->num_markers > 0) {
CAFMarkerChunk* marker_chunk = NULL;
@@ -442,52 +447,57 @@ ambix_err_t _ambix_write_markersregions(ambix_t*ambix) {
}
/* regions */
- // a region consists of 2 markers (start,end) and region chunk
- uint32_t datasize_regions = 2*sizeof(uint32_t) + ambix->num_regions*(SIZEOF_CAFRegion + 2*sizeof(CAFMarker));
- void *region_data = calloc(1, datasize_regions);
- CAFRegionChunk* region_chunk = (CAFRegionChunk*)region_data;
- unsigned char* byte_ptr_regions = (unsigned char*)region_data;
- region_chunk->mSMPTE_TimeType = kCAF_SMPTE_TimeTypeNone;
- region_chunk->mNumberRegions = ambix->num_regions;
- if (byteswap)
- swap_region_chunk(region_chunk);
- // offset the data pointer by 2*uint32_t to point to start of mRegions
- byte_ptr_regions += 2*sizeof(uint32_t);
- for (i=0; i<ambix->num_regions;i++) {
- CAFRegion *new_region = NULL;
- CAFMarker *start_marker = NULL, *end_marker = NULL;
-
- /* region */
- new_region = (CAFRegion*) byte_ptr_regions;
- new_region->mRegionID = i+1; // does not have a connection with a string
- new_region->mFlags = 0;
- new_region->mNumberMarkers = 2; // start, end marker
-
- /* start region marker */
- byte_ptr_regions += SIZEOF_CAFRegion; // offset pointer to start marker
- start_marker = (CAFMarker*)byte_ptr_regions;// &((new_region->mMarkers)[0]);
- start_marker->mType = kCAFMarkerType_RegionStart;
- start_marker->mFramePosition = ambix->regions[i].start_position;
- start_marker->mMarkerID = ambix->num_markers+i+1; // string ID -> num_markers+1...num_markers+num_regions
- start_marker->mChannel = 0; // 0 means for all channels
-
- /* end region marker */
- byte_ptr_regions += sizeof(CAFMarker); // offset pointer to end marker
- end_marker = (CAFMarker*)byte_ptr_regions; // &new_region->mMarkers[1];
- end_marker->mType = kCAFMarkerType_RegionEnd;
- end_marker->mFramePosition = ambix->regions[i].end_position;
- end_marker->mMarkerID = ambix->num_markers+i+1; // string ID -> num_markers+1...num_markers+num_regions
- end_marker->mChannel = 0; // 0 means for all channels
- if (byteswap) {
- swap_region(new_region);
- swap_marker(start_marker);
- swap_marker(end_marker);
- }
- byte_ptr_regions += sizeof(CAFMarker);
+ if (ambix->num_regions > 0) {
+ // a region consists of 2 markers (start,end) and region chunk
+ CAFRegionChunk* region_chunk = NULL;
+ unsigned char* byte_ptr_regions = NULL;
+ datasize_regions = 2*sizeof(uint32_t) + ambix->num_regions*(SIZEOF_CAFRegion + 2*sizeof(CAFMarker));
+ region_data = calloc(1, datasize_regions);
+ region_chunk = (CAFRegionChunk*)region_data;
+ byte_ptr_regions = (unsigned char*)region_data;
+
+ region_chunk->mSMPTE_TimeType = kCAF_SMPTE_TimeTypeNone;
+ region_chunk->mNumberRegions = ambix->num_regions;
+ if (byteswap)
+ swap_region_chunk(region_chunk);
+ // offset the data pointer by 2*uint32_t to point to start of mRegions
+ byte_ptr_regions += 2*sizeof(uint32_t);
+ for (i=0; i<ambix->num_regions;i++) {
+ CAFRegion *new_region = NULL;
+ CAFMarker *start_marker = NULL, *end_marker = NULL;
+
+ /* region */
+ new_region = (CAFRegion*) byte_ptr_regions;
+ new_region->mRegionID = i+1; // does not have a connection with a string
+ new_region->mFlags = 0;
+ new_region->mNumberMarkers = 2; // start, end marker
+
+ /* start region marker */
+ byte_ptr_regions += SIZEOF_CAFRegion; // offset pointer to start marker
+ start_marker = (CAFMarker*)byte_ptr_regions;// &((new_region->mMarkers)[0]);
+ start_marker->mType = kCAFMarkerType_RegionStart;
+ start_marker->mFramePosition = ambix->regions[i].start_position;
+ start_marker->mMarkerID = ambix->num_markers+i+1; // string ID -> num_markers+1...num_markers+num_regions
+ start_marker->mChannel = 0; // 0 means for all channels
+
+ /* end region marker */
+ byte_ptr_regions += sizeof(CAFMarker); // offset pointer to end marker
+ end_marker = (CAFMarker*)byte_ptr_regions; // &new_region->mMarkers[1];
+ end_marker->mType = kCAFMarkerType_RegionEnd;
+ end_marker->mFramePosition = ambix->regions[i].end_position;
+ end_marker->mMarkerID = ambix->num_markers+i+1; // string ID -> num_markers+1...num_markers+num_regions
+ end_marker->mChannel = 0; // 0 means for all channels
+ if (byteswap) {
+ swap_region(new_region);
+ swap_marker(start_marker);
+ swap_marker(end_marker);
+ }
+ byte_ptr_regions += sizeof(CAFMarker);
- add_string_to_data(ambix->num_markers+i+1, byte_ptr_stringid, ambix->regions[i].name, &byteoffset_strings, byte_ptr_strings, &datasize_strings, byteswap);
- byte_ptr_strings += (strlen((const char*)ambix->regions[i].name)+1);
- byte_ptr_stringid += sizeof(CAFStringID);
+ add_string_to_data(ambix->num_markers+i+1, byte_ptr_stringid, ambix->regions[i].name, &byteoffset_strings, byte_ptr_strings, &datasize_strings, byteswap);
+ byte_ptr_strings += (strlen((const char*)ambix->regions[i].name)+1);
+ byte_ptr_stringid += sizeof(CAFStringID);
+ }
}
/* add the chunk data */
diff --git a/libambix/src/sndfile.c b/libambix/src/sndfile.c
index 4448fc4..21939fa 100644
--- a/libambix/src/sndfile.c
+++ b/libambix/src/sndfile.c
@@ -472,6 +472,7 @@ void* _ambix_read_chunk(ambix_t*ax, uint32_t id, uint32_t chunk_it, int64_t *dat
*datasize = chunk_info.datalen;
return chunk_info.data;
#endif
+ /* coverity[unreachable]: reachable in the case of sndfile without set_chunk */
*datasize = 0;
return NULL;
}
diff --git a/libambix/tests/basic2extended_identity4x4_float32.c b/libambix/tests/basic2extended_identity4x4_float32.c
index 28356c2..3e24473 100644
--- a/libambix/tests/basic2extended_identity4x4_float32.c
+++ b/libambix/tests/basic2extended_identity4x4_float32.c
@@ -3,6 +3,9 @@
#ifndef FMT
# define FMT FLOAT32
#endif
+#ifndef EPS
+# define EPS 0
+#endif
int test_defaultmatrix(const char*name, uint32_t rows, uint32_t cols, ambix_matrixtype_t mtyp,
uint32_t xtrachannels, uint32_t chunksize, float32_t eps, ambixtest_presentationformat_t fmt) {
@@ -21,7 +24,7 @@ int test_defaultmatrix(const char*name, uint32_t rows, uint32_t cols, ambix_matr
int main(int argc, char**argv) {
int err=0;
- err+=test_defaultmatrix("IDENTITY1024:" STRINGIFY(FMT), 4, 4, AMBIX_MATRIX_IDENTITY, 0, 1024, 0, FMT);
- err+=test_defaultmatrix("IDENTITY0000:" STRINGIFY(FMT), 4, 4, AMBIX_MATRIX_IDENTITY, 0, 0, 0, FMT);
+ err+=test_defaultmatrix("IDENTITY1024:" STRINGIFY(FMT), 4, 4, AMBIX_MATRIX_IDENTITY, 0, 1024, EPS, FMT);
+ err+=test_defaultmatrix("IDENTITY0000:" STRINGIFY(FMT), 4, 4, AMBIX_MATRIX_IDENTITY, 0, 0, EPS, FMT);
return pass();
}
diff --git a/libambix/tests/basic2extended_identity4x4_float32__f64.c b/libambix/tests/basic2extended_identity4x4_float32__f64.c
index 3cc43b2..08bebb8 100644
--- a/libambix/tests/basic2extended_identity4x4_float32__f64.c
+++ b/libambix/tests/basic2extended_identity4x4_float32__f64.c
@@ -1,2 +1,3 @@
#define FMT FLOAT64
+#define EPS 2e-8
#include "basic2extended_identity4x4_float32.c"
diff --git a/libambix/tests/basic2extended_identity4x4_float32__i32.c b/libambix/tests/basic2extended_identity4x4_float32__i32.c
index 8353436..1a9199f 100644
--- a/libambix/tests/basic2extended_identity4x4_float32__i32.c
+++ b/libambix/tests/basic2extended_identity4x4_float32__i32.c
@@ -1,2 +1,4 @@
#define FMT INT32
+#define EPS 1e-8
+
#include "basic2extended_identity4x4_float32.c"
diff --git a/libambix/tests/basic2extended_rand4x7_3extra_pcm16.c b/libambix/tests/basic2extended_rand4x7_3extra_pcm16.c
index 4500166..f1641c6 100644
--- a/libambix/tests/basic2extended_rand4x7_3extra_pcm16.c
+++ b/libambix/tests/basic2extended_rand4x7_3extra_pcm16.c
@@ -24,6 +24,6 @@ int test_datamatrix(const char*name, uint32_t rows, uint32_t cols, float32_t*dat
int main(int argc, char**argv) {
int err=0;
- err+=test_datamatrix ("'rand'[5x7]", 4, 7, data_4_7 , 3, 1024, 7e-5);
+ err+=test_datamatrix ("'rand'[5x7]", 4, 7, data_4_7 , 3, 1024, 8e-5);
return pass();
}
diff --git a/libambix/tests/basic2extended_rand4x7_pcm16.c b/libambix/tests/basic2extended_rand4x7_pcm16.c
index 2444488..e3b86b0 100644
--- a/libambix/tests/basic2extended_rand4x7_pcm16.c
+++ b/libambix/tests/basic2extended_rand4x7_pcm16.c
@@ -24,6 +24,6 @@ int test_datamatrix(const char*name, uint32_t rows, uint32_t cols, float32_t*dat
int main(int argc, char**argv) {
int err=0;
- err+=test_datamatrix ("'rand'[4x7]", 4, 7, data_4_7 , 0, 1024, 7e-5);
+ err+=test_datamatrix ("'rand'[4x7]", 4, 7, data_4_7 , 0, 1024, 8e-5);
return pass();
}
diff --git a/libambix/tests/common.c b/libambix/tests/common.c
index 91713c4..1e769ad 100644
--- a/libambix/tests/common.c
+++ b/libambix/tests/common.c
@@ -28,6 +28,17 @@
#endif
#include <string.h>
+#include <float.h>
+#ifdef DBL_DECIMAL_DIG
+ #define OP_DBL_Digs (DBL_DECIMAL_DIG)
+#else
+ #ifdef DECIMAL_DIG
+ #define OP_DBL_Digs (DECIMAL_DIG)
+ #else
+ #define OP_DBL_Digs (DBL_DIG + 3)
+ #endif
+#endif
+
static char* snprintdata(char*out, size_t size, ambixtest_presentationformat_t fmt, const void*data, uint64_t index) {
switch(fmt) {
case INT16 :
@@ -52,15 +63,16 @@ static char* snprintdata(char*out, size_t size, ambixtest_presentationformat_t f
void matrix_print(const ambix_matrix_t*mtx) {
printf("matrix[%p] ", mtx);
- printf(" [%dx%d]@%p\n", mtx->rows, mtx->cols, mtx->data);
+ printf(" [%dx%d]@%p\n[\n", mtx->rows, mtx->cols, mtx->data);
if(mtx->data) {
uint32_t c, r;
for(r=0; r<mtx->rows; r++) {
for(c=0; c<mtx->cols; c++)
- printf(" %05f", mtx->data[r][c]);
+ printf(" %.*e", OP_DBL_Digs - 1, mtx->data[r][c]);
printf("\n");
}
}
+ printf("]\n");
}
#define MAX_OVER 10
float32_t matrix_diff(uint32_t line, const ambix_matrix_t*A, const ambix_matrix_t*B, float32_t eps) {
@@ -119,9 +131,11 @@ float32_t data_diff(uint32_t line,
switch(fmt) {
case INT16 :
v=((int16_t*)A)[i]-((int16_t*)B)[i];
+ v/=0xFFFF;
break;
case INT32 :
v=((int32_t*)A)[i]-((int32_t*)B)[i];
+ v/=0xFFFFFFFF;
break;
case FLOAT32:
v=((float32_t*)A)[i]-((float32_t*)B)[i];
@@ -214,13 +228,13 @@ void*data_calloc(ambixtest_presentationformat_t fmt, size_t nmembers) {
}
void*data_sine(ambixtest_presentationformat_t fmt, uint64_t frames, uint32_t channels, float32_t freq) {
- float32_t periods=freq/44100.;
+ float64_t periods=freq/44100.;
void*data=data_calloc(fmt, frames*channels);
int64_t frame;
for(frame=0; frame<frames; frame++) {
int32_t chan;
float64_t f=(float64_t)frame*periods;
- float64_t value=0.5*sinf(f);
+ float64_t value=0.5*sin(f);
for(chan=0; chan<channels; chan++)
setdata(fmt, data, f*channels+chan, value);
}
@@ -229,8 +243,8 @@ void*data_sine(ambixtest_presentationformat_t fmt, uint64_t frames, uint32_t cha
void*data_ramp(ambixtest_presentationformat_t fmt, uint64_t frames, uint32_t channels) {
void*data=data_calloc(fmt, frames*channels);
- double increment=1./(double)frames;
- double value=0.;
+ float64_t increment=1./(double)frames;
+ float64_t value=0.;
int64_t frame;
for(frame=0; frame<frames; frame++) {
int32_t chan;
diff --git a/libambix/tests/common_basic2extended.c b/libambix/tests/common_basic2extended.c
index d7adb72..e1cc5de 100644
--- a/libambix/tests/common_basic2extended.c
+++ b/libambix/tests/common_basic2extended.c
@@ -59,9 +59,6 @@ int check_create_b2e(const char*path, ambix_sampleformat_t format,
/* we want to write an EXTENDED file using the BASIC api (full set) */
winfo.fileformat=AMBIX_BASIC;
- ambix=ambix_open(path, AMBIX_WRITE, &winfo);
- if(fail_if((NULL==ambix), __LINE__, "couldn't create ambix file '%s' for writing", path))return 1;
-
orgambidata =data_sine(fmt, framesize, fullambichannels, periods);
orgotherdata=data_ramp(fmt, framesize, extrachannels);
if(fail_if((NULL==orgambidata), __LINE__, "couldn't create ambidata %dx%d sine @ %f", (int)framesize, (int)fullambichannels, (float)periods))return 1;
@@ -70,6 +67,9 @@ int check_create_b2e(const char*path, ambix_sampleformat_t format,
memcpy(ambidata, orgambidata, framesize*fullambichannels*data_size(fmt));
memcpy(otherdata, orgotherdata, framesize*extrachannels*data_size(fmt));
+ ambix=ambix_open(path, AMBIX_WRITE, &winfo);
+ if(fail_if((NULL==ambix), __LINE__, "couldn't create ambix file '%s' for writing", path))return 1;
+
err=ambix_set_adaptormatrix(ambix, matrix);
#if 0
if(1 || AMBIX_ERR_SUCCESS!=err) {
diff --git a/libambix/tests/matrixtests.c b/libambix/tests/matrixtests.c
index c013623..63d09e2 100644
--- a/libambix/tests/matrixtests.c
+++ b/libambix/tests/matrixtests.c
@@ -26,16 +26,16 @@
#include <stdlib.h>
static float32_t leftdata_4_3[]= {
- 0.19, 0.06, 0.14,
- 0.05, 0.08, 0.44,
- 0.25, 0.90, 0.77,
- 0.83, 0.51, 0.58,
+ 1.89999997615814208984e-01, 5.99999986588954925537e-02, 1.40000000596046447754e-01,
+ 5.00000007450580596924e-02, 7.99999982118606567383e-02, 4.39999997615814208984e-01,
+ 2.50000000000000000000e-01, 8.99999976158142089844e-01, 7.69999980926513671875e-01,
+ 8.29999983310699462891e-01, 5.09999990463256835938e-01, 5.79999983310699462891e-01,
};
static float32_t leftdata_4_4[]= {
- 0.7131185686247925, 0.1054799265939327, 0.1882023608287114, 0.1496964665104298,
- 0.9035382689904633, 0.0958506183093942, 0.1490156537909140, 0.6730762573692578,
- 0.7110257215280688, 0.4278857180785819, 0.5050723092090162, 0.2342525090113509,
- 0.1917073427152419, 0.3837280931544647, 0.0397484032568303, 0.5895499716980565,
+ 7.13118553161621093750e-01, 1.05479925870895385742e-01, 1.88202366232872009277e-01, 1.49696469306945800781e-01,
+ 9.03538286685943603516e-01, 9.58506166934967041016e-02, 1.49015650153160095215e-01, 6.73076272010803222656e-01,
+ 7.11025714874267578125e-01, 4.27885711193084716797e-01, 5.05072295665740966797e-01, 2.34252512454986572266e-01,
+ 1.91707342863082885742e-01, 3.83728086948394775391e-01, 3.97484041750431060791e-02, 5.89549958705902099609e-01,
};
static float32_t rightdata_3_2[]= {
0.22, 0.46,
@@ -51,16 +51,16 @@ static float32_t resultdata_4_2[]= {
};
static float32_t resultpinv_4_3[] = {
/* (leftdata[4,3])^-1 */
- 0.320059925923633, -0.616572833442599, -0.758203952544301, 1.397070173352668,
--0.475395139478048, -2.112396458091558, 1.443108803981482, -0.198593134445739,
- 0.349719602203337, 2.683861685335670, -0.150602340058839, -0.196372558639406,
+ 3.20059925317764282227e-01, -6.16572856903076171875e-01, -7.58203923702239990234e-01, 1.39707016944885253906e+00,
+ -4.75395143032073974609e-01, -2.11239647865295410156e+00, 1.44310879707336425781e+00, -1.98593139648437500000e-01,
+ 3.49719613790512084961e-01, 2.68386173248291015625e+00, -1.50602340698242187500e-01, -1.96372553706169128418e-01,
};
static float32_t resultpinv_4_4[] = {
/* (leftdata[4,4])^-1 */
- 3.260687761423661,-0.750604578051301,-1.027983295100203, 0.437466478433052,
- 4.478583197847279,-3.527343133136301,-0.883177052786819, 3.240826676373624,
- -6.751824651655014, 2.959470009112655, 3.874801812795508,-3.203980734335171,
- -3.520111656963465, 2.340434097800232, 0.647874863173282,-0.339426118611342,
+ 3.26068806648254394531e+00, -7.50604689121246337891e-01, -1.02798342704772949219e+00, 4.37466591596603393555e-01,
+ 4.47858381271362304688e+00, -3.52734327316284179688e+00, -8.83177340030670166016e-01, 3.24082684516906738281e+00,
+ -6.75182533264160156250e+00, 2.95947027206420898438e+00, 3.87480235099792480469e+00, -3.20398116111755371094e+00,
+ -3.52011203765869140625e+00, 2.34043407440185546875e+00, 6.47875070571899414062e-01, -3.39426249265670776367e-01,
};
static void mtxinverse_test(const ambix_matrix_t *mtx, const ambix_matrix_t *result, float32_t eps) {
ambix_matrix_t *pinv = 0;
@@ -594,7 +594,7 @@ int main(int argc, char**argv) {
datamul_eye_tests(1e-7);
#endif
datamul_4_2_tests(1024, 1e-7);
- mtxinverse_tests(1e-5);
+ mtxinverse_tests(3e-5);
return pass();
}
diff --git a/release.sh b/release.sh
new file mode 100755
index 0000000..7ef0162
--- /dev/null
+++ b/release.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+####################################
+# prepare package for release
+
+# DONE: get current version from configure.ac
+# DONE: ChangeLog generator using git-dch
+# DONE: update configure.ac
+# TODO: automatically update AUTHORS
+# TODO: automatically prepare NEWS (from ChangeLog)
+# TODO: automatically launch editors for ChangeLog/NEWS/AUTHORS
+# TODO: automatically tag (if all went well)
+
+CHANGELOG=CHANGELOG
+NEWS=NEWS
+AUTHORS=AUTHORS
+
+error() {
+ echo "$@" 1>&2
+}
+fatal() {
+ error "$@"
+ exit 1
+}
+usage() {
+ fatal "usage: $0 [<LASTVERSION>] <CURVERSION>" 1>&2
+}
+
+getoldversion () {
+ dpkg-parsechangelog --count 1 -l${CHANGELOG} | egrep "^Version:" | head -1 | cut -f2 -d' '
+}
+getmoduleversion() {
+ grep "^AC_INIT" configure.ac |
+ sed -e 's|[^,]*,||' \
+ -e 's|,.*||' \
+ -e 's|[][]||g'
+}
+getgitbranch() {
+ git rev-parse --abbrev-ref HEAD
+}
+
+if [ -d "debian/" ]; then
+ fatal "debian/ directory exists"
+fi
+
+if [ "$(getgitbranch)" != "master" ]; then
+ fatal "current branch '$(getgitbranch)' is not 'master'"
+fi
+
+if [ "x$2" = "x" ]; then
+## guess current version
+ NEWVERSION=$1
+ OLDVERSION=$(getoldversion)
+else
+ OLDVERSION=$1
+ NEWVERSION=$2
+fi
+
+if [ "x${NEWVERSION}" = "x" ]; then
+ NEWVERSION=$(getmoduleversion)
+fi
+
+if git tag -l v${OLDVERSION} | grep . >/dev/null
+then
+ :
+else
+ fatal "it seems like there is no tag 'v${OLDVERSION}'"
+fi
+
+if [ "x${OLDVERSION}" = "x" ]; then
+ usage
+fi
+
+echo "updating from ${OLDVERSION}"
+
+if [ "x${NEWVERSION}" = "x" ]; then
+ usage
+fi
+
+if dpkg --compare-versions ${OLDVERSION} ge ${NEWVERSION}
+then
+ fatal "version mismatch: ${NEWVERSION} is not newer than ${OLDVERSION}"
+fi
+
+echo "updating to ${NEWVERSION}"
+
+OK=false
+mkdir debian
+touch debian/control
+cp ${CHANGELOG} debian/changelog
+gbp dch -R --since "v${OLDVERSION}" -N "${NEWVERSION}" && cat debian/changelog > ${CHANGELOG} && OK=true
+dch --news ${NEWS} || OK=false
+rm -rf debian
+
+if [ "x${OK}" = "xtrue" ]; then
+ sed -e "s|^\(AC_INIT[^,]*\),[[][^,]*[]],\(.*\)|\1,[${NEWVERSION}],\2|" -i configure.ac
+fi
+
+if [ "x${OK}" = "xtrue" ]; then
+ echo "all went well"
+ echo ""
+ echo "- please check your ${CHANGELOG}"
+ echo "- please check&edit your ${NEWS}"
+ echo "- please check&edit your ${AUTHORS}"
+ echo "- and don't forget to git-tag the new version as v${NEWVERSION}"
+ echo " git tag v${NEWVERSION} -m \"released v${NEWVERSION}\""
+else
+ fatal "ouch, something went wrong..."
+fi
--
libambix packaging
More information about the pkg-multimedia-commits
mailing list