[flac-dev] Patch for website, updates docs

2021-07-17 Thread Martijn van Beurden
Hi all,

Attached is a patch for the flac-website git. This patch copies some
corrections from the source code documentation to the website, updates
copyright dates, fixes a charset issue on changelog.html and updates
git links.

Kind regards, Martijn van Beurden
From c99423ddbdb6d686df5fbb079a5dcd71ffa79994 Mon Sep 17 00:00:00 2001
From: Martijn van Beurden 
Date: Sun, 5 Jul 2020 20:58:10 +0200
Subject: [PATCH] Get website up-to-date with source code docs and other fixes

This patch copies some corrections from the source code
documentation to the website, updates copyright dates, fixes
a charset issue on changelog.html and updates git links
---
 changelog.html | 28 --
 comparison.html| 19 
 developers.html| 21 +
 documentation.html | 19 
 documentation_bugs.html| 21 +
 documentation_example_code.html| 21 +
 documentation_format_overview.html | 21 +
 documentation_tasks.html   | 19 
 documentation_tools.html   | 19 
 documentation_tools_flac.html  | 23 +--
 documentation_tools_metaflac.html  | 31 +++-
 download.html  | 19 
 faq.html   | 19 
 features.html  | 19 
 format.html| 47 +++---
 id.html| 19 
 index.html | 19 
 itunes.html| 19 
 license.html   | 21 +
 links.html | 19 
 news.html  | 19 
 ogg_mapping.html   | 19 
 22 files changed, 174 insertions(+), 307 deletions(-)

diff --git a/changelog.html b/changelog.html
index c424cfa..480781d 100644
--- a/changelog.html
+++ b/changelog.html
@@ -1,6 +1,6 @@
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;>
-
-
+
+
 
 
 
@@ -8,7 +8,7 @@
 
 
 
-   
+   



@@ -28,10 +28,13 @@
 
home|
faq|
+   news|
+   download|
documentation|
-   developers|
+   comparison|
changelog|
-   http://xiph.org/flac;>more
+   links|
+   developers
 
 
 
@@ -330,7 +333,7 @@

General:

-   Move development to Xiph.org http://git.xiph.org/?p=flac.git;a=summary;>git repository.
+   Move development to Xiph.org git 
repository.
The --sector-align
 option of flac has been deprecated and may 
not exist in future versions.  http://www.etree.org/shnutils/shntool/;>shntool provides similar 
functionality.
Support for the RF64 and Wave64 
formats in flac (see below).
Better handling of cuesheets with 
non-CD-DA sample rates.
@@ -1544,16 +1547,9 @@
 
 
 
-   
-   
-   
-   
-   Copyright (c) 2004-2009  Josh Coalson
-   
-   Copyright (c) 2011-2016  Xiph.Org Foundation
-   
-   
-   
+   Copyright (c) 2000-2009  Josh Coalson
+   
+   Copyright (c) 2011-2020  Xiph.Org Foundation
 
 
 
diff --git a/comparison.html b/comparison.html
index 6ddf706..77780c0 100644
--- a/comparison.html
+++ b/comparison.html
@@ -1,5 +1,6 @@
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;>
-
+
+
 
 
 
@@ -7,7 +8,7 @@
 
 
 
-   
+   



@@ -465,17 +466,9 @@
 
 
 
-   
-   
-   
-   
-Copyright (c) 2000-2009  Josh Coalson, 
2011-2014 Xiph.Org Foundation
-   
-   
-   http://validator.w3.org/check?uri=referer;>
-   
-   
-   
+   Copyright (c) 2000-2009  Josh Coalson
+   
+   Copyright (c) 2011-2020  Xiph.Org Foundation
 
 
 
diff --git a/developers.html b/developers.html
index d4a5a58..d4f37f0 100644
--- a/developers.html
+++ b/developers.html
@@ -1,5 +1,6 @@
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;>
-
+
+
 
 
 
@@ -7,7 +8,7 @@
 
 
 
-   
+   



@@ -56,7 +57,7 @@
FLAC Format Specification 
- The formal specification.
Ogg FLAC Mapping - 
How FLAC should be embedded in an Ogg container.
ID Registration - Register an 
ID if you need to write custom metadata.

[flac-dev] Patch for website, updates docs

2020-07-06 Thread Martijn van Beurden
Hi all,

Attached is a patch for the flac-website git. This patch copies some
corrections from the source code documentation to the website, updates
copyright dates, fixes a charset issue on changelog.html and updates
git links.

Kind regards, Martijn van Beurden

P.S. I've sent this e-mail two times before, but it looks like it
doesn't get through. That's why I now try with a gzipped patch.


0001-Get-website-up-to-date-with-source-code-docs-and-oth.patch.gz
Description: GNU Zip compressed data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] Patch of documentation, analyse function and compression ratio display

2020-07-05 Thread Martijn van Beurden
Hi all,

Attached are three patches.

The first patch changes links to git.xiph.org to gitlab.xiph.org. The
second patch enables the flac analyse function to be able to handle frames
which are over 4Gbit in size. The third one fixes the compression ratio
display of very small files.

Kind regards,

Martijn van Beurden
From 2d875b71e56b35cd1ca0ff1fc4b163ccf77ae4bd Mon Sep 17 00:00:00 2001
From: Martijn van Beurden 
Date: Sat, 4 Jul 2020 14:19:40 +0200
Subject: [PATCH 1/3] Update links to Xiph git in documentation

---
 doc/html/changelog.html  | 2 +-
 doc/html/developers.html | 2 +-
 doc/html/documentation_example_code.html | 2 +-
 doc/html/license.html| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/html/changelog.html b/doc/html/changelog.html
index fc0dc4d7..3094ffa0 100644
--- a/doc/html/changelog.html
+++ b/doc/html/changelog.html
@@ -330,7 +330,7 @@
 			
 General:
 
-	Move development to Xiph.org http://git.xiph.org/?p=flac.git;a=summary;>git repository.
+	Move development to Xiph.org git repository.
 	The --sector-align option of flac has been deprecated and may not exist in future versions.  http://www.etree.org/shnutils/shntool/;>shntool provides similar functionality.
 	Support for the RF64 and Wave64 formats in flac (see below).
 	Better handling of cuesheets with non-CD-DA sample rates.
diff --git a/doc/html/developers.html b/doc/html/developers.html
index 06d31c0f..b96ea7f3 100644
--- a/doc/html/developers.html
+++ b/doc/html/developers.html
@@ -54,7 +54,7 @@
 			FLAC Format Specification - The formal specification.
 			Ogg FLAC Mapping - How FLAC should be embedded in an Ogg container.
 			ID Registration - Register an ID if you need to write custom metadata.
-			https://git.xiph.org/?p=flac.git;a%3Dsummary;>Git access - for checking out the source code.
+			https://gitlab.xiph.org/xiph/flac;>Git access - for checking out the source code.
 			http://sourceforge.net/p/flac/bugs/;>Bug Tracker - to submit bug reports and patches
 		
 	
diff --git a/doc/html/documentation_example_code.html b/doc/html/documentation_example_code.html
index dea608a2..bf078be4 100644
--- a/doc/html/documentation_example_code.html
+++ b/doc/html/documentation_example_code.html
@@ -42,7 +42,7 @@
 	
 	
 	
-		The FLAC source code has several small example programs that demonstrate how to use the libraries.  The source is available on the http://xiph.org/flac/download.html;>download page, or can be https://git.xiph.org/?p=flac.git;>checked out from git.  The examples complement the API documentation.
+		The FLAC source code has several small example programs that demonstrate how to use the libraries.  The source is available on the http://xiph.org/flac/download.html;>download page, or can be https://gitlab.xiph.org/xiph/flac;>checked out from git.  The examples complement the API documentation.
 		
 		Currently the examples show how to encode WAV files to FLAC and vice-versa using both libFLAC and libFLAC++.  Over time we'll be adding more examples.
 	
diff --git a/doc/html/license.html b/doc/html/license.html
index 22733880..b5d2accd 100644
--- a/doc/html/license.html
+++ b/doc/html/license.html
@@ -48,7 +48,7 @@
 		
 		The FLAC project also makes available software that implements the formats, which is distributed according to http://opensource.org/docs/definition.php;>Open Source licenses as follows:
 		
-		The reference implementation libraries are licensed under the New https://git.xiph.org/?p=flac.git;a=blob_plain;f=COPYING.Xiph;>BSD License.  In simple terms, these libraries may be used by any application, Open or proprietary, linked or incorporated in whole, so long as acknowledgement is made to Xiph.org Foundation when using the source code in whole or in derived works.  The Xiph License is free enough that the libraries have been used in commercial products to implement FLAC, including in the firmware of hardware devices where other Open Source licenses can be problematic.  In the source code these libraries are called libFLAC and libFLAC++.
+		The reference implementation libraries are licensed under the New https://gitlab.xiph.org/xiph/flac/-/blob/master/COPYING.Xiph;>BSD License.  In simple terms, these libraries may be used by any application, Open or proprietary, linked or incorporated in whole, so long as acknowledgement is made to Xiph.org Foundation when using the source code in whole or in derived works.  The Xiph License is free enough that the libraries have been used in commercial products to implement FLAC, including in the firmware of hardware devices where other Open Source licenses can be problematic.  In the source code these libraries are called libFLAC and libFLAC++.
 		
 		The rest of the software that the FLAC project provides is licensed under the http://www.gnu.org/licenses/licenses.html#GPL;>GNU General Public License (GPL).  This software includes various utilities for converting 

[flac-dev] [PATCH] Switch to utimensat for newer POSIX versions

2019-08-09 Thread Rosen Penev
Some libcs like uClibc-ng can optionally disable deprecated functions.
utime is one of them. When done so, both the header and the function go
missing.

This fixes flac_utime to work in such a situation.
---
 include/share/compat.h   | 10 +-
 src/libFLAC/metadata_iterators.c |  9 +++--
 src/share/grabbag/file.c |  9 +++--
 3 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/include/share/compat.h b/include/share/compat.h
index f3041655..a063c083 100644
--- a/include/share/compat.h
+++ b/include/share/compat.h
@@ -112,9 +112,13 @@
 #include  /* for utime() */
 #endif
 #else
+#if _POSIX_C_SOURCE >= 200809L
+#include 
+#else
 #include  /* some flavors of BSD (like OS X) require this to get 
time_t */
 #include  /* for utime() */
 #endif
+#endif
 
 #if defined _MSC_VER
 #  if _MSC_VER >= 1800
@@ -160,11 +164,15 @@
 
 #define flac_fopen fopen
 #define flac_chmod chmod
-#define flac_utime utime
 #define flac_unlink unlink
 #define flac_rename rename
 #define flac_stat stat
 
+#if _POSIX_C_SOURCE >= 200809L
+#define flac_utime(a, b) utimensat (AT_FDCWD, a, *b, 0)
+#else
+#define flac_utime utime
+#endif
 #endif
 
 #ifdef _WIN32
diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c
index 352a6c7a..d5255eb9 100644
--- a/src/libFLAC/metadata_iterators.c
+++ b/src/libFLAC/metadata_iterators.c
@@ -3422,13 +3422,18 @@ FLAC__bool get_file_stats_(const char *filename, struct 
flac_stat_s *stats)
 
 void set_file_stats_(const char *filename, struct flac_stat_s *stats)
 {
-   struct utimbuf srctime;
-
FLAC__ASSERT(0 != filename);
FLAC__ASSERT(0 != stats);
 
+#if _POSIX_C_SOURCE >= 200809L
+   struct timespec srctime[2] = {};
+   srctime[0].tv_sec = stats->st_atime;
+   srctime[1].tv_sec = stats->st_mtime;
+#else
+   struct utimbuf srctime;
srctime.actime = stats->st_atime;
srctime.modtime = stats->st_mtime;
+#endif
(void)flac_chmod(filename, stats->st_mode);
(void)flac_utime(filename, );
 #if !defined _MSC_VER && !defined __BORLANDC__ && !defined __MINGW32__
diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c
index 2c67bebf..edd835a6 100644
--- a/src/share/grabbag/file.c
+++ b/src/share/grabbag/file.c
@@ -27,7 +27,6 @@
 #include  /* for _O_BINARY */
 #else
 #include  /* some flavors of BSD (like OS X) require this to get 
time_t */
-#include  /* for utime() */
 #endif
 #if defined __EMX__
 #include  /* for setmode(), O_BINARY */
@@ -53,11 +52,17 @@
 void grabbag__file_copy_metadata(const char *srcpath, const char *destpath)
 {
struct flac_stat_s srcstat;
-   struct utimbuf srctime;
 
if(0 == flac_stat(srcpath, )) {
+#if _POSIX_C_SOURCE >= 200809L
+   struct timespec srctime[2] = {};
+   srctime[0].tv_sec = srcstat.st_atime;
+   srctime[1].tv_sec = srcstat.st_mtime;
+#else
+   struct utimbuf srctime;
srctime.actime = srcstat.st_atime;
srctime.modtime = srcstat.st_mtime;
+#endif
(void)flac_chmod(destpath, srcstat.st_mode);
(void)flac_utime(destpath, );
}
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 4/5] SIMD: accelerate decoding of 16-bit FLAC

2018-08-27 Thread Olivier Tristan

I do see some improvements in x64 build using SSE4.1. (VS2017)

You didn't see any improvements on your end ?

Le 18/02/2017 à 17:47, lvqcl a écrit :

This patch adds 2 new functions,
FLAC__lpc_restore_signal_intrin_sse41() and
FLAC__lpc_restore_signal_16_intrin_sse41().

The decoding speed of Subset-compatible 16-bit FLAC files
is slightly increased on SSE4.1-compatible CPUs.


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


--
Olivier Tristan
Research & Development
www.uvi.net

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] move CreateFile() function from libFLAC

2018-08-18 Thread Erik de Castro Lopo
lvqcl wrote:

> This patch renames flac_internal_CreateFile_utf8() function to
> grabbag__CreateFile_utf8() and
> moves it from /src/libFLAC/windows_unicode_filenames.c into
> src/share/grabbag/file.c
> This function is not used by libFLAC anyway.
> 
> After this, it should be possible to compile libFLAC as UWP.

Was submitted via github and has been merged.

Thanks!

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] move CreateFile() function from libFLAC

2018-08-18 Thread lvqcl
This patch renames flac_internal_CreateFile_utf8() function to
grabbag__CreateFile_utf8() and
moves it from /src/libFLAC/windows_unicode_filenames.c into
src/share/grabbag/file.c
This function is not used by libFLAC anyway.

After this, it should be possible to compile libFLAC as UWP.

In the old code there were 3 different #if  conditionals around the
code that uses CreateFile_utf8():
1)  #ifdef _WIN32 ... #endif
2)  #if defined _WIN32 && !defined __CYGWIN__ ... #endif
3)  #if defined _MSC_VER || defined __MINGW32__ ... #endif
It seems for me that the 2nd version makes more sense,so I replaced
them all with it.

Also this patch removes WINAPI_FAMILY_PARTITION ... CreateFile2 etc
stuff from the code.
The file src/share/grabbag/file.c contains non-UWP function
GetFileInformationByHandle,
and nobody complained, so it's OK to use non-UWP
CreateFileA/CreateFileW as well.


move_function_CreateFile_out_of_libFLAC.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 3/2] Free memory on errors in all safe_realloc_*() functions

2018-07-20 Thread Miroslav Lichvar
---
 include/share/alloc.h | 36 +---
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/include/share/alloc.h b/include/share/alloc.h
index 63878db0..97752f0c 100644
--- a/include/share/alloc.h
+++ b/include/share/alloc.h
@@ -174,34 +174,46 @@ static inline void *safe_realloc_add_2op_(void *ptr, 
size_t size1, size_t size2)
 static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t 
size2, size_t size3)
 {
size2 += size1;
-   if(size2 < size1)
+   if(size2 < size1) {
+   free(ptr);
return 0;
+   }
size3 += size2;
-   if(size3 < size2)
+   if(size3 < size2) {
+   free(ptr);
return 0;
-   return realloc(ptr, size3);
+   }
+   return safe_realloc_(ptr, size3);
 }
 
 static inline void *safe_realloc_add_4op_(void *ptr, size_t size1, size_t 
size2, size_t size3, size_t size4)
 {
size2 += size1;
-   if(size2 < size1)
+   if(size2 < size1) {
+   free(ptr);
return 0;
+   }
size3 += size2;
-   if(size3 < size2)
+   if(size3 < size2) {
+   free(ptr);
return 0;
+   }
size4 += size3;
-   if(size4 < size3)
+   if(size4 < size3) {
+   free(ptr);
return 0;
-   return realloc(ptr, size4);
+   }
+   return safe_realloc_(ptr, size4);
 }
 
 static inline void *safe_realloc_mul_2op_(void *ptr, size_t size1, size_t 
size2)
 {
if(!size1 || !size2)
-   return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) 
semantics */
-   if(size1 > SIZE_MAX / size2)
+   return safe_realloc_(ptr, 0); /* preserve POSIX realloc(ptr, 0) 
semantics */
+   if(size1 > SIZE_MAX / size2) {
+   free(ptr);
return 0;
+   }
return safe_realloc_(ptr, size1*size2);
 }
 
@@ -209,10 +221,12 @@ static inline void *safe_realloc_mul_2op_(void *ptr, 
size_t size1, size_t size2)
 static inline void *safe_realloc_muladd2_(void *ptr, size_t size1, size_t 
size2, size_t size3)
 {
if(!size1 || (!size2 && !size3))
-   return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) 
semantics */
+   return safe_realloc_(ptr, 0); /* preserve POSIX realloc(ptr, 0) 
semantics */
size2 += size3;
-   if(size2 < size3)
+   if(size2 < size3) {
+   free(ptr);
return 0;
+   }
return safe_realloc_mul_2op_(ptr, size1, size2);
 }
 
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/2] Fix safe_realloc_add_2op_() to free memory when reallocation fails

2018-07-20 Thread Miroslav Lichvar
---
 include/share/alloc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/share/alloc.h b/include/share/alloc.h
index 914de9ba..63878db0 100644
--- a/include/share/alloc.h
+++ b/include/share/alloc.h
@@ -168,7 +168,7 @@ static inline void *safe_realloc_add_2op_(void *ptr, size_t 
size1, size_t size2)
free(ptr);
return 0;
}
-   return realloc(ptr, size2);
+   return safe_realloc_(ptr, size2);
 }
 
 static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t 
size2, size_t size3)
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 1/2] Avoid double free in iconvert()

2018-07-20 Thread Miroslav Lichvar
When safe_realloc_add_2op_(utfbuf, ...) is called with an invalid size
and returns 0, set utfbuf to 0 to avoid second deallocation later in the
function.
---
 src/share/utf8/iconvert.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/share/utf8/iconvert.c b/src/share/utf8/iconvert.c
index 472ca876..03068ac9 100644
--- a/src/share/utf8/iconvert.c
+++ b/src/share/utf8/iconvert.c
@@ -150,8 +150,10 @@ int iconvert(const char *fromcode, const char *tocode,
   return ret;
 }
 newbuf = safe_realloc_add_2op_(utfbuf, (ob - utfbuf), /*+*/1);
-if (!newbuf)
+if (!newbuf) {
+  utfbuf = 0;
   goto fail;
+}
 ob = (ob - utfbuf) + newbuf;
 *ob = '\0';
 *to = newbuf;
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/7] PowerPC64 performance improvements

2018-07-12 Thread Anton Blanchard
Hi,

> Are those all Virtual Machines? If so, how do you really know that
> the performance is 3.3x?

I have access to a number of different POWER9 systems, all native.

Thanks,
Anton
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/7] PowerPC64 performance improvements

2018-07-12 Thread Brian Willoughby

On Jul 11, 2018, at 5:59 PM, Anton Blanchard  wrote:
> Hi Brian,
> 
>> Thank you for this collection of patches.
>> 
>> How can I test them? What platforms (computers) have the ppc64 or
>> POWER9 processor?
> 
> The IBM Bounty Source page has a list of resources:
> 
> https://www.bountysource.com/teams/ibm/bounties
> 
> Travis also has ppc64le support, so if you add the linux-ppc64le target
> then FLAC will be tested on ppc64le.
> 
> Thanks,
> Anton

Are those all Virtual Machines? If so, how do you really know that the 
performance is 3.3x?

Brian

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/7] PowerPC64 performance improvements

2018-07-11 Thread Anton Blanchard
Hi Brian,

> Thank you for this collection of patches.
> 
> How can I test them? What platforms (computers) have the ppc64 or
> POWER9 processor?

The IBM Bounty Source page has a list of resources:

https://www.bountysource.com/teams/ibm/bounties

Travis also has ppc64le support, so if you add the linux-ppc64le target
then FLAC will be tested on ppc64le.

Thanks,
Anton
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/7] PowerPC64 performance improvements

2018-07-10 Thread Brian Willoughby
Thank you for this collection of patches.

How can I test them? What platforms (computers) have the ppc64 or POWER9 
processor?

Brian


On Jul 10, 2018, at 2:31 PM, Anton Blanchard  wrote:
> 
> The following series adds initial vector support for PowerPC64.
> On POWER9, flac --best is about 3.3x faster.
> 
> Amitay Isaacs (2):
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 7/7] Add VSX optimised versions of autocorrelation loops

2018-07-10 Thread Anton Blanchard
Add a POWER8 and POWER9 version of the autocorrelation functions.

flac --best is about 3.3x faster on POWER9 with this patch.

Signed-off-by: Anton Blanchard 
---
 src/libFLAC/Makefile.am   |   1 +
 src/libFLAC/include/private/lpc.h |  14 +
 src/libFLAC/lpc_intrin_vsx.c  | 942 ++
 src/libFLAC/stream_encoder.c  |  30 +
 4 files changed, 987 insertions(+)
 create mode 100644 src/libFLAC/lpc_intrin_vsx.c

diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index 863f7f95..f0f32f04 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -114,6 +114,7 @@ libFLAC_sources = \
lpc_intrin_sse2.c \
lpc_intrin_sse41.c \
lpc_intrin_avx2.c \
+   lpc_intrin_vsx.c \
md5.c \
memory.c \
metadata_iterators.c \
diff --git a/src/libFLAC/include/private/lpc.h 
b/src/libFLAC/include/private/lpc.h
index 63d64324..64dfd1f8 100644
--- a/src/libFLAC/include/private/lpc.h
+++ b/src/libFLAC/include/private/lpc.h
@@ -91,6 +91,20 @@ void 
FLAC__lpc_compute_autocorrelation_intrin_sse_lag_12_new(const FLAC__real da
 void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_16_new(const FLAC__real 
data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
 #endif
 #  endif
+#if defined(FLAC__CPU_PPC64) && defined(FLAC__USE_VSX)
+#ifdef FLAC__HAS_TARGET_POWER9
+void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_4(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_8(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_12(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_16(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+#endif
+#ifdef FLAC__HAS_TARGET_POWER8
+void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_4(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_8(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_12(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_16(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
+#endif
+#endif
 #endif
 
 /*
diff --git a/src/libFLAC/lpc_intrin_vsx.c b/src/libFLAC/lpc_intrin_vsx.c
new file mode 100644
index ..48c82182
--- /dev/null
+++ b/src/libFLAC/lpc_intrin_vsx.c
@@ -0,0 +1,942 @@
+/* libFLAC - Free Lossless Audio Codec library
+ * Copyright (C) 2000-2009  Josh Coalson
+ * Copyright (C) 2011-2016  Xiph.Org Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Xiph.org Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include 
+#endif
+
+#ifndef FLAC__INTEGER_ONLY_LIBRARY
+#ifndef FLAC__NO_ASM
+#if defined(FLAC__CPU_PPC64) && defined(FLAC__USE_VSX)
+
+#include "private/cpu.h"
+#include "private/lpc.h"
+#include "FLAC/assert.h"
+#include "FLAC/format.h"
+
+#include 
+
+#ifdef FLAC__HAS_TARGET_POWER8
+__attribute__((target("cpu=power8")))
+void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_16(const 
FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[])
+{
+   long i;
+   long limit = 

[flac-dev] [PATCH 5/7] Check if compiler supports target attribute on ppc64

2018-07-10 Thread Anton Blanchard
From: Amitay Isaacs 

Check if the compiler supports __attribute__((target("cpu=power8")))
and __attribute__((target("cpu=power9")))

Signed-off-by: Amitay Isaacs 
---
 configure.ac | 20 
 1 file changed, 20 insertions(+)

diff --git a/configure.ac b/configure.ac
index 55078293..3d18bb91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,6 +175,26 @@ else
 AC_DEFINE([FLAC__HAS_X86INTRIN], 0)
 fi
 
+if test x"$cpu_ppc64" = xtrue ; then
+
+AC_C_ATTRIBUTE([target("cpu=power8")],
+  [have_cpu_power8=yes],
+  [have_cpu_power8=no])
+if test x"$have_cpu_power8" = xyes ; then
+  AC_DEFINE(FLAC__HAS_TARGET_POWER8)
+  AH_TEMPLATE(FLAC__HAS_TARGET_POWER8, [define if compiler has 
__attribute__((target("cpu=power8"))) support])
+fi
+
+AC_C_ATTRIBUTE([target("cpu=power9")],
+  [have_cpu_power9=yes],
+  [have_cpu_power9=no])
+if test x"$have_cpu_power9" = xyes ; then
+  AC_DEFINE(FLAC__HAS_TARGET_POWER9)
+  AH_TEMPLATE(FLAC__HAS_TARGET_POWER9, [define if compiler has 
__attribute__((target("cpu=power9"))) support])
+fi
+
+fi
+
 case "$host" in
i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
*-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 6/7] Add runtime detection of POWER8 and POWER9

2018-07-10 Thread Anton Blanchard
Use getauxval() to determine if we are on POWER8 or POWER9 or newer.
POWER8 is represented by version 2.07 and POWER9 by version 3.00.

Signed-off-by: Anton Blanchard 
---
 src/libFLAC/cpu.c | 31 +++
 src/libFLAC/include/private/cpu.h |  6 ++
 2 files changed, 37 insertions(+)

diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c
index bf0708c8..64da9cbc 100644
--- a/src/libFLAC/cpu.c
+++ b/src/libFLAC/cpu.c
@@ -53,6 +53,9 @@
 #define dfprintf(file, format, ...)
 #endif
 
+#if defined FLAC__CPU_PPC
+#include 
+#endif
 
 #if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined 
FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
 
@@ -230,6 +233,29 @@ x86_cpu_info (FLAC__CPUInfo *info)
 #endif
 }
 
+static void
+ppc_cpu_info (FLAC__CPUInfo *info)
+{
+#if defined FLAC__CPU_PPC
+#ifndef PPC_FEATURE2_ARCH_3_00
+#define PPC_FEATURE2_ARCH_3_00 0x0080
+#endif
+
+#ifndef PPC_FEATURE2_ARCH_2_07
+#define PPC_FEATURE2_ARCH_2_07 0x8000
+#endif
+
+   if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_3_00) {
+   info->ppc.arch_3_00 = true;
+   } else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) {
+   info->ppc.arch_2_07 = true;
+   }
+#else
+   info->ppc.arch_2_07 = false;
+   info->ppc.arch_3_00 = false;
+#endif
+}
+
 void FLAC__cpu_info (FLAC__CPUInfo *info)
 {
memset(info, 0, sizeof(*info));
@@ -238,6 +264,8 @@ void FLAC__cpu_info (FLAC__CPUInfo *info)
info->type = FLAC__CPUINFO_TYPE_IA32;
 #elif defined FLAC__CPU_X86_64
info->type = FLAC__CPUINFO_TYPE_X86_64;
+#elif defined FLAC__CPU_PPC
+   info->type = FLAC__CPUINFO_TYPE_PPC;
 #else
info->type = FLAC__CPUINFO_TYPE_UNKNOWN;
 #endif
@@ -247,6 +275,9 @@ void FLAC__cpu_info (FLAC__CPUInfo *info)
case FLAC__CPUINFO_TYPE_X86_64:
x86_cpu_info (info);
break;
+   case FLAC__CPUINFO_TYPE_PPC:
+   ppc_cpu_info (info);
+   break;
default:
info->use_asm = false;
break;
diff --git a/src/libFLAC/include/private/cpu.h 
b/src/libFLAC/include/private/cpu.h
index 3fe279b0..e07aa09d 100644
--- a/src/libFLAC/include/private/cpu.h
+++ b/src/libFLAC/include/private/cpu.h
@@ -153,6 +153,7 @@
 typedef enum {
FLAC__CPUINFO_TYPE_IA32,
FLAC__CPUINFO_TYPE_X86_64,
+   FLAC__CPUINFO_TYPE_PPC,
FLAC__CPUINFO_TYPE_UNKNOWN
 } FLAC__CPUInfo_Type;
 
@@ -173,11 +174,16 @@ typedef struct {
FLAC__bool fma;
 } FLAC__CPUInfo_x86;
 
+typedef struct {
+   FLAC__bool arch_3_00;
+   FLAC__bool arch_2_07;
+} FLAC__CPUInfo_ppc;
 
 typedef struct {
FLAC__bool use_asm;
FLAC__CPUInfo_Type type;
FLAC__CPUInfo_x86 x86;
+   FLAC__CPUInfo_ppc ppc;
 } FLAC__CPUInfo;
 
 void FLAC__cpu_info(FLAC__CPUInfo *info);
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 4/7] Add m4 macro to check for C __attribute__ features

2018-07-10 Thread Anton Blanchard
From: Amitay Isaacs 

Signed-off-by: Amitay Isaacs 
---
 m4/c_attribute.m4 | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 m4/c_attribute.m4

diff --git a/m4/c_attribute.m4 b/m4/c_attribute.m4
new file mode 100644
index ..48aa6223
--- /dev/null
+++ b/m4/c_attribute.m4
@@ -0,0 +1,18 @@
+#
+# Check for supported __attribute__ features
+#
+# AC_C_ATTRIBUTE(FEATURE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+AC_DEFUN([AC_C_ATTRIBUTE],
+[AS_VAR_PUSHDEF([CACHEVAR], [ax_cv_c_attribute_$1])dnl
+AC_CACHE_CHECK([for  __attribute__ (($1))],
+  CACHEVAR,[
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
+[[ void foo(void) __attribute__ (($1)); ]])],
+[AS_VAR_SET(CACHEVAR, [yes])],
+[AS_VAR_SET(CACHEVAR, [no])])])
+AS_VAR_IF(CACHEVAR,yes,
+  [m4_default([$2], :)],
+  [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 3/7] configure.ac: Fix FLAC__CPU_PPC on little endian, and add FLAC__CPU_PPC64

2018-07-10 Thread Anton Blanchard
FLAC__CPU_PPC wasn't catching powerpcle or powerpc64le. Fix that and
add a new define for FLAC__CPU_PPC64.

Signed-off-by: Anton Blanchard 
---
 configure.ac | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 592e7750..55078293 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,7 +141,16 @@ case "$host_cpu" in
AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
asm_optimisation=$asm_opt
;;
-   powerpc|powerpc64)
+   powerpc64|powerpc64le)
+   cpu_ppc64=true
+   cpu_ppc=true
+   AC_DEFINE(FLAC__CPU_PPC)
+   AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
+   AC_DEFINE(FLAC__CPU_PPC64)
+   AH_TEMPLATE(FLAC__CPU_PPC64, [define if building for PowerPC64])
+   asm_optimisation=$asm_opt
+   ;;
+   powerpc|powerpcle)
cpu_ppc=true
AC_DEFINE(FLAC__CPU_PPC)
AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
@@ -157,6 +166,7 @@ esac
 AM_CONDITIONAL(FLAC__CPU_X86_64, test "x$cpu_x86_64" = xtrue)
 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
+AM_CONDITIONAL(FLaC__CPU_PPC64, test "x$cpu_ppc64" = xtrue)
 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
 
 if test "x$ac_cv_header_x86intrin_h" = xyes; then
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/7] configure.ac: Add VSX enable/disable

2018-07-10 Thread Anton Blanchard
We want to create functions with PowerPC VSX instructions, so add
a configure check.

Signed-off-by: Anton Blanchard 
---
 configure.ac | 13 +
 1 file changed, 13 insertions(+)

diff --git a/configure.ac b/configure.ac
index 77e3628e..592e7750 100644
--- a/configure.ac
+++ b/configure.ac
@@ -228,6 +228,19 @@ AC_DEFINE(FLAC__USE_ALTIVEC)
 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
 fi
 
+AC_ARG_ENABLE(vsx,
+AC_HELP_STRING([--disable-vsx], [Disable VSX optimizations]),
+[case "${enableval}" in
+   yes) use_vsx=true ;;
+   no)  use_vsx=false ;;
+   *) AC_MSG_ERROR(bad value ${enableval} for --enable-vsx) ;;
+esac],[use_vsx=true])
+AM_CONDITIONAL(FLaC__USE_VSX, test "x$use_vsx" = xtrue)
+if test "x$use_vsx" = xtrue ; then
+AC_DEFINE(FLAC__USE_VSX)
+AH_TEMPLATE(FLAC__USE_VSX, [define to enable use of VSX instructions])
+fi
+
 AC_ARG_ENABLE(avx,
 AC_HELP_STRING([--disable-avx], [Disable AVX, AVX2 optimizations]),
 [case "${enableval}" in
-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 0/7] PowerPC64 performance improvements

2018-07-10 Thread Anton Blanchard
The following series adds initial vector support for PowerPC64.
On POWER9, flac --best is about 3.3x faster.

Amitay Isaacs (2):
  Add m4 macro to check for C __attribute__ features
  Check if compiler supports target attribute on ppc64

Anton Blanchard (5):
  configure.ac: Remove SPE detection code
  configure.ac: Add VSX enable/disable
  configure.ac: Fix FLAC__CPU_PPC on little endian, and add
FLAC__CPU_PPC64
  Add runtime detection of POWER8 and POWER9
  Add VSX optimised versions of autocorrelation loops

 configure.ac  |  53 +-
 m4/c_attribute.m4 |  18 +
 src/libFLAC/Makefile.am   |   1 +
 src/libFLAC/cpu.c |  31 +
 src/libFLAC/include/private/cpu.h |   6 +
 src/libFLAC/include/private/lpc.h |  14 +
 src/libFLAC/lpc_intrin_vsx.c  | 942 ++
 src/libFLAC/stream_encoder.c  |  30 +
 8 files changed, 1086 insertions(+), 9 deletions(-)
 create mode 100644 m4/c_attribute.m4
 create mode 100644 src/libFLAC/lpc_intrin_vsx.c

-- 
2.17.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Fix more GCC warnings about case fall-through

2018-05-05 Thread Erik de Castro Lopo
lvqcl wrote:

> THere was a patch that silences GCC -Wimplicit-fallthrough warnings, see
> https://git.xiph.org/?p=flac.git;a=commit;h=1b5c09e4c692e243239945be3cba3ec72ea1699f
> 
> There are a few more places that need this treatment. The patch is attached.


Applied. Thanks!

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Fix more GCC warnings about case fall-through

2018-05-02 Thread lvqcl
THere was a patch that silences GCC -Wimplicit-fallthrough warnings, see
https://git.xiph.org/?p=flac.git;a=commit;h=1b5c09e4c692e243239945be3cba3ec72ea1699f

There are a few more places that need this treatment. The patch is attached.


Fix-more-GCC-implicit-fallthrough-warnings.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] More generic version of MSVC bug workaround

2018-05-02 Thread lvqcl
There was a fix for a bug in MSVC 2015 update2:
https://github.com/xiph/flac/commit/94a61241b02064c7d9fe508f72a742f2a90b8492

It seems that it's not the only version affected, see comment from
40th in this commit.
Also, JRMC is affected:
https://yabb.jriver.com/interact/index.php/topic,115742.0.html

So, it makes sense to remove version check: better safe than sorry,
and performance
impact should be very small (probably negligible) anyway.


Better-workaround-for-MSVC-bugs.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] doc: Add notes about subframe sample size

2017-06-12 Thread Erik de Castro Lopo
Ruud van Asseldonk wrote:

> Here you go.

Wonderful. Thank you!

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] doc: Add notes about subframe sample size

2017-06-11 Thread Reto Kromer
Ruud van Asseldonk wrote:

>I hope this helps future implementers.

Thank you very much, Ruud! I posted our advice on GitHub:

  https://github.com/privatezero/flac_markdown/issues/53

Best regards, Reto

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] doc: Add notes about subframe sample size

2017-06-11 Thread Dave Rice
Hi Ruud van Asseldonk,

> On Jun 11, 2017, at 7:24 AM, Ruud van Asseldonk  wrote:
> 
>>> I'm jumping in on this thread to make a few remarks about the spec. I
>>> implemented a FLAC decoder by only looking at the spec, and I have a few
>>> notes that would have saved me a lot of time if the spec had mentioned
>>> them. They are obvious in hindsight, of course.
>>> 
>>> * If the channel assignment includes a difference channel, then the
>>> subframe for that channel has one extra bit per sample in order to
>>> encode the difference.
>>> 
>>> * The number of bits per sample for a subframe, is the number of bits
>>> per sample of the frame, minus the number of wasted bits per sample of
>>> the subframe (and possibly plus one for a difference channel).
>>> 
>>> I hope this helps future implementers.
>> 
>> I would love to see a patch against the documentation for this.
>> 
>> Erik
> 
> Here you go.
> 
> Kind regards,
> 
> Ruud van Asseldonk
> <0001-doc-Add-notes-about-subframe-sample-size.patch>___

Do you mind to submit this patch as well to cel...@ietf.org 
 (info at https://www.ietf.org/mailman/listinfo/cellar 
). That working group is 
currently working on the Flac format documentation in 
https://github.com/privatezero/flac_markdown 
 and 
https://datatracker.ietf.org/wg/cellar/documents/ 
.
Dave Rice

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] doc: Add notes about subframe sample size

2017-06-11 Thread Ruud van Asseldonk
>> I'm jumping in on this thread to make a few remarks about the spec. I
>> implemented a FLAC decoder by only looking at the spec, and I have a few
>> notes that would have saved me a lot of time if the spec had mentioned
>> them. They are obvious in hindsight, of course.
>>
>> * If the channel assignment includes a difference channel, then the
>> subframe for that channel has one extra bit per sample in order to
>> encode the difference.
>>
>> * The number of bits per sample for a subframe, is the number of bits
>> per sample of the frame, minus the number of wasted bits per sample of
>> the subframe (and possibly plus one for a difference channel).
>>
>> I hope this helps future implementers.
> 
> I would love to see a patch against the documentation for this.
> 
> Erik

Here you go.

Kind regards,

Ruud van Asseldonk
From 7ee085acc99bb60f0335f93f96682a0a0cf66649 Mon Sep 17 00:00:00 2001
From: Ruud van Asseldonk 
Date: Sun, 11 Jun 2017 13:16:27 +0200
Subject: [PATCH] doc: Add notes about subframe sample size

---
 doc/html/format.html | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/html/format.html b/doc/html/format.html
index bce3c453..1047092a 100644
--- a/doc/html/format.html
+++ b/doc/html/format.html
@@ -1267,7 +1267,7 @@
 3
 			
 			
-Sample size in bits:
+Sample size in bits: [5]
 
 
 	000 : get from STREAMINFO metadata block
@@ -1367,6 +1367,11 @@
 
 	The "UTF-8" coding used for the sample/frame number is the same variable length code used to store compressed UCS-2, extended to handle larger input.
 
+
+	For subframes that encode a difference channel,
+	the sample size is one bit larger than the sample size of the frame,
+	in order to be able to encode the difference between extreme values.
+
 
 			
 		
@@ -1489,6 +1494,8 @@
 	1 : k wasted bits-per-sample in source subblock, k-1 follows, unary coded; e.g. k=3 = 001 follows, k=7 = 001 follows.
 
 
+The size of the samples stored in the subframe is the subframe sample size reduced by k bits.
+Decoded samples must be shifted left by k bits.
 			
 		
 	
-- 
2.13.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] some typos in header files.

2017-03-20 Thread Erik de Castro Lopo
lvqcl wrote:

> The attached patch fixes a few typos.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] some typos in header files.

2017-03-20 Thread lvqcl

The attached patch fixes a few typos.

fix_typos.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] fix LLVM compile

2017-03-01 Thread lvqcl

Olivier Tristan wrote:


Hi guys,

Please find attached a patch that fixes the OSX build with llvm
only __asm__ is supported but GCC support both so it's not an issue  
using this one AFAIK.


lvqcl can probably confirm this.


I can obly confirm that it works in GCC/MinGW, but that's expected.
Also, ffmpeg uses __asm__  for inline x86 assembly.
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] fix LLVM compile

2017-02-27 Thread Olivier Tristan
Hi guys,

Please find attached a patch that fixes the OSX build with llvm
only __asm__ is supported but GCC support both so it's not an issue using
this one AFAIK.

lvqcl can probably confirm this.

Thanks !



-- 
Olivier Tristan
Research & Development
www.uvi.net
diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c
index 67a076d..bf0708c 100644
--- a/src/libFLAC/cpu.c
+++ b/src/libFLAC/cpu.c
@@ -81,7 +81,7 @@ cpu_xgetbv_x86(void)
return (uint32_t)_xgetbv(0);
 #elif defined __GNUC__
uint32_t lo, hi;
-   asm volatile (".byte 0x0f, 0x01, 0xd0" : "=a"(lo), "=d"(hi) : "c" (0));
+   __asm__ volatile (".byte 0x0f, 0x01, 0xd0" : "=a"(lo), "=d"(hi) : "c" 
(0));
return lo;
 #else
return 0;
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 6/5] comments in stream_decoder.c

2017-02-21 Thread Erik de Castro Lopo
lvqcl wrote:

> There are 2 comments in stream_decoder.c that mention
> FLAC__lpc_restore_signal_asm_ia32_mmx() requirement for
> the output array.
> The text is updated to include intrinsic functions too.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] SIMD: remove outdated SSE2 code

2017-02-21 Thread Erik de Castro Lopo
lvqcl wrote:

> 
> The patch is attached.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 6/5] comments in stream_decoder.c

2017-02-20 Thread lvqcl

There are 2 comments in stream_decoder.c that mention
FLAC__lpc_restore_signal_asm_ia32_mmx() requirement for
the output array.
The text is updated to include intrinsic functions too.

06_decoder_comment.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] SIMD: remove outdated SSE2 code

2017-02-20 Thread lvqcl

Erik de Castro Lopo wrote:


lvqcl wrote:



Ok, will do it, but currently xiph git still contains old code.


Sorry, should be updated now.


The patch is attached.

05_v2_remove_old_intrin_func.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] SIMD: remove outdated SSE2 code

2017-02-20 Thread Erik de Castro Lopo
lvqcl wrote:

> 
> Ok, will do it, but currently xiph git still contains old code.

Sorry, should be updated now.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] SIMD: remove outdated SSE2 code

2017-02-20 Thread lvqcl

Erik de Castro Lopo wrote:


Sorry, this patch fails to apply on top of the others. Would
you be able to rebase against what's currently in the tree?


Ok, will do it, but currently xiph git still contains old code.
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 2/5] SIMD: remove extra space

2017-02-19 Thread Brian Willoughby
I agree with Erik regarding this patch.


On Feb 19, 2017, at 12:17 PM, Erik de Castro Lopo  wrote:
> lvqcl wrote:
>> Most libFLAC code don't have a space between if and a parenthesis,
>> so the patch removes them from lpc_intrin_sseNN.c files.
> 
> I don't really agree with this one. If anything I think we should
> slowly move to making the code insert a space between the `if` and
> the open parenthesis because its easier to read.
> 
> Erik

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 4/5] SIMD: accelerate decoding of 16-bit FLAC

2017-02-19 Thread Erik de Castro Lopo
lvqcl wrote:

> This patch adds 2 new functions,
> FLAC__lpc_restore_signal_intrin_sse41() and
> FLAC__lpc_restore_signal_16_intrin_sse41().
> 
> The decoding speed of Subset-compatible 16-bit FLAC files
> is slightly increased on SSE4.1-compatible CPUs.

Applied. Thanks.

Erik

-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 3/5] SIMD: accelerate decoding of some 24-bit FLAC

2017-02-19 Thread Erik de Castro Lopo
lvqcl wrote:

> This patch accelerates decoding of non-Subset 24-bit FLAC files
> (where lpc_order > 12).
> 
> (The improved function is FLAC__lpc_restore_signal_wide_intrin_sse41().
> It requires SSE4.1 and it's used only by 32-bit libFLAC)

Applied. Thanks.

Erik

-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 1/5] SIMD: add const qualifier

2017-02-19 Thread Erik de Castro Lopo
lvqcl wrote:

> This patch adds const to some variables, to make code slightly easier to  
> read.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] SIMD: remove outdated SSE2 code

2017-02-18 Thread lvqcl

Olivier Tristan  wrote:


Is the SSE 4.1 support detected at runtime ?
i.e you compile with 4.1 support in order to get the intrinsincs by the  
compiler but the actual code >is only called at runtime when 4.1 is  
supported by the computer




Correct (if the compiler isn't too outdated).
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] SIMD: remove outdated SSE2 code

2017-02-18 Thread Olivier Tristan
Is the SSE 4.1 support detected at runtime ?
i.e you compile with 4.1 support in order to get the intrinsincs by the
compiler but the actual code is only called at runtime when 4.1 is
supported by the computer

Thanks !

2017-02-18 17:56 GMT+01:00 lvqcl :

> This patch removes FLAC__lpc_restore_signal_16_intrin_sse2().
>
> It's faster than C code, but not faster than MMX-accelerated
> ASM functions. It's also slower than the new SSE4.1 functions
> that were added by the previous patch.
> So this function wasn't very useful before, and now it's
> even less useful. I don't see a reason to keep it.
> ___
> flac-dev mailing list
> flac-dev@xiph.org
> http://lists.xiph.org/mailman/listinfo/flac-dev
>
>


-- 
Olivier Tristan
Research & Development
www.uvi.net
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 5/5] SIMD: remove outdated SSE2 code

2017-02-18 Thread lvqcl

This patch removes FLAC__lpc_restore_signal_16_intrin_sse2().

It's faster than C code, but not faster than MMX-accelerated
ASM functions. It's also slower than the new SSE4.1 functions
that were added by the previous patch.
So this function wasn't very useful before, and now it's
even less useful. I don't see a reason to keep it.

05_remove_old_intrin_func.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 4/5] SIMD: accelerate decoding of 16-bit FLAC

2017-02-18 Thread lvqcl

This patch adds 2 new functions,
FLAC__lpc_restore_signal_intrin_sse41() and
FLAC__lpc_restore_signal_16_intrin_sse41().

The decoding speed of Subset-compatible 16-bit FLAC files
is slightly increased on SSE4.1-compatible CPUs.

04_add_new_intrin_func.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/5] SIMD: remove extra space

2017-02-18 Thread lvqcl

Most libFLAC code don't have a space between if and a parenthesis,
so the patch removes them from lpc_intrin_sseNN.c files.

02_spaces.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 1/5] SIMD: add const qualifier

2017-02-18 Thread lvqcl
This patch adds const to some variables, to make code slightly easier to  
read.

01_const.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] cpu.h: add defines for clang

2017-02-12 Thread Erik de Castro Lopo
lvqcl wrote:

> I forgot that all avx2 functions are inside "#ifdef FLAC__AVX2_SUPPORTED"
> conditional, so they simply don't exist if FLAC__AVX2_SUPPORTED is not set.
> 
> Anyway, stream_encoder_intrin_avx2-after.txt shows that the code
> contains AVX2 instructions such as vpabsd/vpaddd/vphaddd, so
> this function was compiled properly.

Thanks. Patch applied.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] cpu.h: add defines for clang

2017-02-12 Thread lvqcl

Erik de Castro Lopo wrote:


How reliable a test is that? I do 99.9% of my dev work on a laptop
and whenever I need to benchmark something I need to do so on a
desketop machine because the laptop doesn't give consistent results.


About 1.5 years ago I tested AVX2 speed increase on Haswell (i7-4770)
using -8 encoding preset. The biggest difference between AVX2 enabled
and disabled was 35% (64-bit flac.exe, 24-bit WAV input file).
The smallest difference was 10% (32-bit flac.exe, 16-bit WAV input file).



Disassembly of the object files (before and after) is here:

http://mega-nerd.com/tmp/stream_encoder_intrin_avx2-before.txt
http://mega-nerd.com/tmp/stream_encoder_intrin_avx2-after.txt

This is with clang version 3.8.1 from Debian testing.


I forgot that all avx2 functions are inside "#ifdef FLAC__AVX2_SUPPORTED"
conditional, so they simply don't exist if FLAC__AVX2_SUPPORTED is not set.

Anyway, stream_encoder_intrin_avx2-after.txt shows that the code
contains AVX2 instructions such as vpabsd/vpaddd/vphaddd, so
this function was compiled properly.
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] cpu.h: add defines for clang

2017-02-11 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote:

> What am I looking for? Is posting the before and after versions
> sufficient?

Disassembly of the object files (before and after) is here:

http://mega-nerd.com/tmp/stream_encoder_intrin_avx2-before.txt
http://mega-nerd.com/tmp/stream_encoder_intrin_avx2-after.txt

This is with clang version 3.8.1 from Debian testing.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] cpu.h: add defines for clang

2017-02-11 Thread Erik de Castro Lopo
lvqcl wrote:

> Currently cpu.h lacks FLAC__SSE_TARGET and FLAC__SSEnn_SUPPORTED
> macros for clang. I added them, but I cannot properly test them
> as I can't get compiled flac.exe under Windows (don't know
> how to setup clang under MSYS2).

I can relatively easily install Clang on Linux.

> If somebody has working clang, please test this patch.
> Does it affect en/decoding speed?

How reliable a test is that? I do 99.9% of my dev work on a laptop
and whenever I need to benchmark something I need to do so on a 
desketop machine because the laptop doesn't give consistent results.

> Or at least, dows it affect disassembly of functions
> such as FLAC__precompute_partition_info_sums_intrin_avx2()?

What am I looking for? Is posting the before and after versions
sufficient?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Fix compile with cygwin

2017-02-09 Thread Erik de Castro Lopo
Rosen Penev wrote:

> The underscores are wrong. The comment is also correct.
> 
> Also remove the configure.ac option. Otherwise it tries to compile the
> windows unicode stuff which POSIX(cygwin) does not understand.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Fix compile with cygwin

2017-02-08 Thread Rosen Penev
The underscores are wrong. The comment is also correct.

Also remove the configure.ac option. Otherwise it tries to compile the
windows unicode stuff which POSIX(cygwin) does not understand.
---
 configure.ac | 2 +-
 include/share/compat.h   | 2 +-
 src/libFLAC/stream_decoder.c | 3 ---
 src/libFLAC/stream_encoder.c | 3 ---
 src/share/grabbag/file.c | 8 +---
 5 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index c5b6337..9a1570c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,7 +185,7 @@ AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
 
 os_is_windows=no
 case "$host" in
-   *-*-cygwin|*mingw*)
+   *mingw*)
CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
os_is_windows=yes
;;
diff --git a/include/share/compat.h b/include/share/compat.h
index f74a5c1..2ad40fb 100644
--- a/include/share/compat.h
+++ b/include/share/compat.h
@@ -98,7 +98,7 @@
 #define FLAC__STRNCASECMP strncasecmp
 #endif
 
-#if defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ || defined 
__EMX__
+#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__
 #include  /* for _setmode(), chmod() */
 #include  /* for _O_BINARY */
 #else
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 2e1fdd5..d3b6e03 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -1253,9 +1253,6 @@ FILE *get_binary_stdin_(void)
 */
 #if defined _MSC_VER || defined __MINGW32__
_setmode(_fileno(stdin), _O_BINARY);
-#elif defined __CYGWIN__
-   /* almost certainly not needed for any modern Cygwin, but let's be 
safe... */
-   setmode(_fileno(stdin), _O_BINARY);
 #elif defined __EMX__
setmode(fileno(stdin), O_BINARY);
 #endif
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index 1993ec5..665fe55 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -4540,9 +4540,6 @@ FILE *get_binary_stdout_(void)
 */
 #if defined _MSC_VER || defined __MINGW32__
_setmode(_fileno(stdout), _O_BINARY);
-#elif defined __CYGWIN__
-   /* almost certainly not needed for any modern Cygwin, but let's be 
safe... */
-   setmode(_fileno(stdout), _O_BINARY);
 #elif defined __EMX__
setmode(fileno(stdout), O_BINARY);
 #endif
diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c
index 4cbef9d..3a97292 100644
--- a/src/share/grabbag/file.c
+++ b/src/share/grabbag/file.c
@@ -29,7 +29,7 @@
 #include  /* some flavors of BSD (like OS X) require this to get 
time_t */
 #include  /* for utime() */
 #endif
-#if defined __CYGWIN__ || defined __EMX__
+#if defined __EMX__
 #include  /* for setmode(), O_BINARY */
 #include  /* for _O_BINARY */
 #endif
@@ -164,9 +164,6 @@ FILE *grabbag__file_get_binary_stdin(void)
 */
 #if defined _MSC_VER || defined __MINGW32__
_setmode(_fileno(stdin), _O_BINARY);
-#elif defined __CYGWIN__
-   /* almost certainly not needed for any modern Cygwin, but let's be 
safe... */
-   setmode(_fileno(stdin), _O_BINARY);
 #elif defined __EMX__
setmode(fileno(stdin), O_BINARY);
 #endif
@@ -182,9 +179,6 @@ FILE *grabbag__file_get_binary_stdout(void)
 */
 #if defined _MSC_VER || defined __MINGW32__
_setmode(_fileno(stdout), _O_BINARY);
-#elif defined __CYGWIN__
-   /* almost certainly not needed for any modern Cygwin, but let's be 
safe... */
-   setmode(_fileno(stdout), _O_BINARY);
 #elif defined __EMX__
setmode(fileno(stdout), O_BINARY);
 #endif
-- 
2.8.3

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Clean up CFLAGS detecting code and add AX macro for _FORTIFY_SOURCE

2017-02-06 Thread Erik de Castro Lopo
David Seifert wrote:

> ---

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Clean up CFLAGS detecting code and add AX macro for _FORTIFY_SOURCE

2017-02-05 Thread David Seifert
On Sun, 2017-02-05 at 20:47 +1100, Erik de Castro Lopo wrote:
> David Seifert wrote:
> 
> > -   AC_PROG_SED
> > -   CFLAGS=$(echo "$CFLAGS" | $SED 's/-O2//')
> > -   CFLAGS="-O3 -funroll-loops $CFLAGS"
> > +   CFLAGS="-O3 -funroll-loops"
> 
> Doesn't this mean that `-O2` and `-O3` will end up in CFLAGS? 
> 
> Erik

No, because the block happens only if ${enable_flags_setting} == yes,
and that can only occur if all CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS are
unset. If I do ./configure CFLAGS="-O2", the whole block won't be
triggered (as intended). That block only exists to set defaults for
users running ./configure without any of the aforementioned flags set,
not for users overriding them.

Regards
David
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Clean up CFLAGS detecting code and add AX macro for _FORTIFY_SOURCE

2017-02-05 Thread Erik de Castro Lopo
David Seifert wrote:

> - AC_PROG_SED
> - CFLAGS=$(echo "$CFLAGS" | $SED 's/-O2//')
> - CFLAGS="-O3 -funroll-loops $CFLAGS"
> + CFLAGS="-O3 -funroll-loops"

Doesn't this mean that `-O2` and `-O3` will end up in CFLAGS? 

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Clean up CFLAGS detecting code and add AX macro for _FORTIFY_SOURCE

2017-02-04 Thread David Seifert
---
 configure.ac| 23 ++--
 m4/ax_add_fortify_source.m4 | 53 +
 2 files changed, 55 insertions(+), 21 deletions(-)
 create mode 100644 m4/ax_add_fortify_source.m4

diff --git a/configure.ac b/configure.ac
index 8576cae5..c5b63370 100644
--- a/configure.ac
+++ b/configure.ac
@@ -393,9 +393,7 @@ fi
 dnl If debugging is disabled AND no CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS
 dnl are provided, we can set defaults to our liking
 AS_IF([test "x${ax_enable_debug}" = "xno" && test "x${enable_flags_setting}" = 
"xyes"], [
-   AC_PROG_SED
-   CFLAGS=$(echo "$CFLAGS" | $SED 's/-O2//')
-   CFLAGS="-O3 -funroll-loops $CFLAGS"
+   CFLAGS="-O3 -funroll-loops"
 ])
 
 XIPH_GCC_VERSION
@@ -409,24 +407,7 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
dnl some distributions (such as Gentoo) have _FORTIFY_SOURCE always
dnl enabled. We test for this situation in order to prevent polluting
dnl the console with messages of macro redefinitions.
-   AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CFLAGS])
-   AC_LINK_IFELSE([
-   AC_LANG_SOURCE(
-   [[
-   int main() {
-   #ifndef _FORTIFY_SOURCE
-   return 0;
-   #else
-   this_is_an_error;
-   #endif
-   }
-   ]]
-   )], [
-   AC_MSG_RESULT([yes])
-   XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
-   ], [
-   AC_MSG_RESULT([no])
-   ])
+   AX_ADD_FORTIFY_SOURCE
 
AC_LANG_PUSH([C++])
XIPH_ADD_CXXFLAGS([-Weffc++])
diff --git a/m4/ax_add_fortify_source.m4 b/m4/ax_add_fortify_source.m4
new file mode 100644
index ..d443814b
--- /dev/null
+++ b/m4/ax_add_fortify_source.m4
@@ -0,0 +1,53 @@
+# ===
+#   http://www.gnu.org/software/autoconf-archive/ax_add_fortify_source.html
+# ===
+#
+# SYNOPSIS
+#
+#   AX_ADD_FORTIFY_SOURCE
+#
+# DESCRIPTION
+#
+#   Check whether -D_FORTIFY_SOURCE=2 can be added to CPPFLAGS without macro
+#   redefinition warnings. Some distributions (such as Gentoo Linux) enable
+#   _FORTIFY_SOURCE globally in their compilers, leading to unnecessary
+#   warnings in the form of
+#
+# :0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
+# : note: this is the location of the previous definition
+#
+#   which is a problem if -Werror is enabled. This macro checks whether
+#   _FORTIFY_SOURCE is already defined, and if not, adds -D_FORTIFY_SOURCE=2
+#   to CPPFLAGS.
+#
+# LICENSE
+#
+#   Copyright (c) 2017 David Seifert 
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[
+AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS])
+AC_LINK_IFELSE([
+AC_LANG_SOURCE(
+[[
+int main() {
+#ifndef _FORTIFY_SOURCE
+return 0;
+#else
+this_is_an_error;
+#endif
+}
+]]
+)], [
+AC_MSG_RESULT([yes])
+CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
+], [
+AC_MSG_RESULT([no])
+])
+])
-- 
2.11.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 1/2] for lpc_intrin_sseNN.c

2017-01-31 Thread Erik de Castro Lopo
lvqcl wrote:

> This patch fixes bracket placement, extra space, etc
> in lpc_intrin_sse2.c and lpc_intrin_sse41.c

Both patches applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] cpu.h: add defines for clang

2017-01-25 Thread lvqcl

Currently cpu.h lacks FLAC__SSE_TARGET and FLAC__SSEnn_SUPPORTED
macros for clang. I added them, but I cannot properly test them
as I can't get compiled flac.exe under Windows (don't know
how to setup clang under MSYS2).

If somebody has working clang, please test this patch.
Does it affect en/decoding speed?
Or at least, dows it affect disassembly of functions
such as FLAC__precompute_partition_info_sums_intrin_avx2()?

clang_cpu_support.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] for compat.h

2017-01-23 Thread Erik de Castro Lopo
lvqcl wrote:

> Description: redefine inline as __inline only for C, not for C++.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] for compat.h

2017-01-23 Thread lvqcl

Description: redefine inline as __inline only for C, not for C++.

compat_inline.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 1/2] Do not override CFLAGS, as CFLAGS is a user flag.

2017-01-19 Thread Erik de Castro Lopo
David Seifert wrote:

> * Furthermore, use NDEBUG globally to detect the presence
>   of building with more debug output information.
>   AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays
>   Gnome has also switched to it from its own custom solution.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Fix cppcheck warnings

2017-01-19 Thread Erik de Castro Lopo
Rosen Penev wrote:

>  src/libFLAC/bitreader.c | 4 ++--
>  src/libFLAC/bitwriter.c | 4 ++--
>  src/plugin_xmms/plugin.c| 2 +-
>  src/share/utf8/charset.c| 1 +
>  src/test_libFLAC++/encoders.cpp | 8 
>  src/test_libFLAC/decoders.c | 4 ++--
>  src/test_libFLAC/encoders.c | 8 
>  7 files changed, 16 insertions(+), 15 deletions(-)

Applied. minus the incorrect fix to charset.c.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Fix cppcheck warnings

2017-01-19 Thread Erik de Castro Lopo
Rosen Penev wrote:

> index 432e32d..0c2d1ee 100644
> --- a/src/share/utf8/charset.c
> +++ b/src/share/utf8/charset.c
> @@ -522,6 +522,7 @@ int charset_convert(const char *fromcode, const char 
> *tocode,
>if (to) {
>  newbuf = realloc(tobuf, p - tobuf);
>  *to = newbuf ? newbuf : tobuf;
> +free(newbuf);

That bit is not actually correct. I've corrected that idependently.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Fix cppcheck warnings

2017-01-19 Thread Erik de Castro Lopo
Rosen Penev wrote:

> fedora comes with 1.75 so I used that. I also used some additional
> flags: cppcheck --enable=all --inconclusive --std=posix --force

Thanks! I had wanted to use verison 1.76.1 from Debian in CI, but never
enabled it because it was giving me a false positive even with relatively
standard command line options.

I've now refactored the code so that there is no false positive and
I'm playing around with `--enable=warning` which enables the unsigned/print
warning you patch fixes and a couple of other interesting things.

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Fix cppcheck warnings

2017-01-18 Thread Rosen Penev
fedora comes with 1.75 so I used that. I also used some additional
flags: cppcheck --enable=all --inconclusive --std=posix --force

On Wed, Jan 18, 2017 at 11:36 PM, Erik de Castro Lopo
 wrote:
> Rosen Penev wrote:
>
>>  src/libFLAC/bitreader.c | 4 ++--
>>  src/libFLAC/bitwriter.c | 4 ++--
>>  src/plugin_xmms/plugin.c| 2 +-
>>  src/share/utf8/charset.c| 1 +
>>  src/test_libFLAC++/encoders.cpp | 8 
>>  src/test_libFLAC/decoders.c | 4 ++--
>>  src/test_libFLAC/encoders.c | 8 
>>  7 files changed, 16 insertions(+), 15 deletions(-)
>
> Interesting! What version of cppcheck are you running? With what
> options? I currently run cppcheck over FLAC in CI.
>
> Erik
> --
> --
> Erik de Castro Lopo
> http://www.mega-nerd.com/
> ___
> flac-dev mailing list
> flac-dev@xiph.org
> http://lists.xiph.org/mailman/listinfo/flac-dev
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Fix cppcheck warnings

2017-01-18 Thread Erik de Castro Lopo
Rosen Penev wrote:

>  src/libFLAC/bitreader.c | 4 ++--
>  src/libFLAC/bitwriter.c | 4 ++--
>  src/plugin_xmms/plugin.c| 2 +-
>  src/share/utf8/charset.c| 1 +
>  src/test_libFLAC++/encoders.cpp | 8 
>  src/test_libFLAC/decoders.c | 4 ++--
>  src/test_libFLAC/encoders.c | 8 
>  7 files changed, 16 insertions(+), 15 deletions(-)

Interesting! What version of cppcheck are you running? With what
options? I currently run cppcheck over FLAC in CI.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] fix MSVC 2005/2008 build

2017-01-18 Thread Erik de Castro Lopo
lvqcl wrote:

> Thanks. But I can't see new file share/msvc2005_int.h in
> the current git snapshot.

Yeah, fixed in a later commit. This is why I prefer git patches
over plain diffs :).

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Fix cppcheck warnings

2017-01-18 Thread Rosen Penev
---
 src/libFLAC/bitreader.c | 4 ++--
 src/libFLAC/bitwriter.c | 4 ++--
 src/plugin_xmms/plugin.c| 2 +-
 src/share/utf8/charset.c| 1 +
 src/test_libFLAC++/encoders.cpp | 8 
 src/test_libFLAC/decoders.c | 4 ++--
 src/test_libFLAC/encoders.c | 8 
 7 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c
index 386f420..7554385 100644
--- a/src/libFLAC/bitreader.c
+++ b/src/libFLAC/bitreader.c
@@ -306,7 +306,7 @@ void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE 
*out)
if(i < br->consumed_words || (i == 
br->consumed_words && j < br->consumed_bits))
fprintf(out, ".");
else
-   fprintf(out, "%01u", br->buffer[i] & 
((brword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
+   fprintf(out, "%01d", br->buffer[i] & 
((brword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
fprintf(out, "\n");
}
if(br->bytes > 0) {
@@ -315,7 +315,7 @@ void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE 
*out)
if(i < br->consumed_words || (i == 
br->consumed_words && j < br->consumed_bits))
fprintf(out, ".");
else
-   fprintf(out, "%01u", br->buffer[i] & 
((brword)1 << (br->bytes*8-j-1)) ? 1:0);
+   fprintf(out, "%01d", br->buffer[i] & 
((brword)1 << (br->bytes*8-j-1)) ? 1:0);
fprintf(out, "\n");
}
}
diff --git a/src/libFLAC/bitwriter.c b/src/libFLAC/bitwriter.c
index 8f475d5..bfe79b0 100644
--- a/src/libFLAC/bitwriter.c
+++ b/src/libFLAC/bitwriter.c
@@ -201,13 +201,13 @@ void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE 
*out)
for(i = 0; i < bw->words; i++) {
fprintf(out, "%08X: ", i);
for(j = 0; j < FLAC__BITS_PER_WORD; j++)
-   fprintf(out, "%01u", bw->buffer[i] & ((bwword)1 
<< (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
+   fprintf(out, "%01d", bw->buffer[i] & ((bwword)1 
<< (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
fprintf(out, "\n");
}
if(bw->bits > 0) {
fprintf(out, "%08X: ", i);
for(j = 0; j < bw->bits; j++)
-   fprintf(out, "%01u", bw->accum & ((bwword)1 << 
(bw->bits-j-1)) ? 1:0);
+   fprintf(out, "%01d", bw->accum & ((bwword)1 << 
(bw->bits-j-1)) ? 1:0);
fprintf(out, "\n");
}
}
diff --git a/src/plugin_xmms/plugin.c b/src/plugin_xmms/plugin.c
index d84d53c..94fbae5 100644
--- a/src/plugin_xmms/plugin.c
+++ b/src/plugin_xmms/plugin.c
@@ -324,7 +324,7 @@ void FLAC_XMMS__play_file(char *filename)
}
else {
/*@@@ need some error here like wa2: 
MessageBox(mod_.hMainWindow, "ERROR: plugin can only handle 8/16-bit 
samples\n", "ERROR: plugin can only handle 8/16-bit samples", 0); */
-   fprintf(stderr, "libxmms-flac: can't handle %d bit 
output\n", stream_data_.bits_per_sample);
+   fprintf(stderr, "libxmms-flac: can't handle %u bit 
output\n", stream_data_.bits_per_sample);
safe_decoder_finish_(decoder_);
return;
}
diff --git a/src/share/utf8/charset.c b/src/share/utf8/charset.c
index 432e32d..0c2d1ee 100644
--- a/src/share/utf8/charset.c
+++ b/src/share/utf8/charset.c
@@ -522,6 +522,7 @@ int charset_convert(const char *fromcode, const char 
*tocode,
   if (to) {
 newbuf = realloc(tobuf, p - tobuf);
 *to = newbuf ? newbuf : tobuf;
+free(newbuf);
   }
   else
 free(tobuf);
diff --git a/src/test_libFLAC++/encoders.cpp b/src/test_libFLAC++/encoders.cpp
index 277e129..e328a53 100644
--- a/src/test_libFLAC++/encoders.cpp
+++ b/src/test_libFLAC++/encoders.cpp
@@ -438,7 +438,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
 
printf("testing get_max_lpc_order()... ");
if(encoder->get_max_lpc_order() != 0) {
-   printf("FAILED, expected %u, got %u\n", 0, 
encoder->get_max_lpc_order());
+   printf("FAILED, expected %d, got %u\n", 0, 
encoder->get_max_lpc_order());
return false;
}
printf("OK\n");
@@ -471,21 +471,21 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
 
printf("testing get_min_residual_partition_order()... ");
if(encoder->get_min_residual_partition_order() != 0) {
-   printf("FAILED, expected %u, got %u\n", 0, 
encoder->get_min_residual_partition_order());
+

Re: [flac-dev] [PATCH] fix MSVC 2005/2008 build

2017-01-18 Thread lvqcl

Erik de Castro Lopo wrote:


The definitions of these types are inside #if block with
_MSC_VER < 1600 condition, so these changes affect only MS Visual
Studio compilers with _MSC_VER < 1600 (i.e. MSVS 2005 and 2008).


Thats a really great solution to this problem. Applied!


Thanks. But I can't see new file share/msvc2005_int.h in
the current git snapshot.
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] fix MSVC 2005/2008 build

2017-01-18 Thread Ozkan Sezer
On 1/18/17, Erik de Castro Lopo  wrote:
> lvqcl wrote:
>
>> > These versions of Visual Studio don't have stdint.h and
>> > all [u]intNN_t types. But now these types are everywhere
>> > in FLAC codebase.
>>
>> Here is the patch that fixes the problem:
>> it moves definitions of all [u]intNN_t types from share/compat.h
>> into new file share/msvc2005_int.h and then includes this file
>> into all files (via "Force Includes" option in *.vcproj files).
>>
>> The definitions of these types are inside #if block with
>> _MSC_VER < 1600 condition, so these changes affect only MS Visual
>> Studio compilers with _MSC_VER < 1600 (i.e. MSVS 2005 and 2008).
>
> Thats a really great solution to this problem. Applied!

New file is not in the repo (you possibly forgot to 'git add' )
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] fix MSVC 2005/2008 build

2017-01-18 Thread Erik de Castro Lopo
lvqcl wrote:

> > These versions of Visual Studio don't have stdint.h and
> > all [u]intNN_t types. But now these types are everywhere
> > in FLAC codebase.
> 
> Here is the patch that fixes the problem:
> it moves definitions of all [u]intNN_t types from share/compat.h
> into new file share/msvc2005_int.h and then includes this file
> into all files (via "Force Includes" option in *.vcproj files).
> 
> The definitions of these types are inside #if block with
> _MSC_VER < 1600 condition, so these changes affect only MS Visual
> Studio compilers with _MSC_VER < 1600 (i.e. MSVS 2005 and 2008).

Thats a really great solution to this problem. Applied!

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/5] Allow multiple targets to be disabled

2017-01-18 Thread Hugo Beauzée-Luyssen

On 01/15/2017 03:21 AM, Erik de Castro Lopo wrote:

lvqcl wrote:


I think that FLAC sources should remain compatible with Visual
Studio 2010 (and probably earlier), people still need it.
For example: 

Is it possible to simply exclude win_utf8_io.c from compiling
if target OS is WinRT/non-desktop?


And I defer to others like lvqcl for what we do and do not
support on Windows.

Erik

Then the best solution would be to allow libflac to be built by 
disabling other targets, thus disabling the need for shared convenience 
libraries.
However, as noted in the cover letter, I don't see any way of doing this 
without switching to non recursive Makefile.am Any opinion on that?


In the meantime, I guess it's OK to simply drop patch 5

Regards,
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 2/2] Only compile and run tests when running 'make check'

2017-01-17 Thread Erik de Castro Lopo
David Seifert wrote:

> ---

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] fix getopt.c

2017-01-16 Thread Erik de Castro Lopo
lvqcl wrote:

> This patch fixes 2 problems in getopt.c:
> 
> 1) MSVC 2005 (and probably 2008) can't compile it because
> it doesn't have stdint.h
> 
> 2) nameend and nextchar are pointers and the difference
> between them should be casted to 'size_t' type, not
> 'unsigned int' or 'uint32_t'.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/2] Only compile and run tests when running 'make check'

2017-01-15 Thread David Seifert
---
 src/test_grabbag/cuesheet/Makefile.am | 2 +-
 src/test_grabbag/picture/Makefile.am  | 2 +-
 src/test_libFLAC++/Makefile.am| 2 +-
 src/test_libFLAC/Makefile.am  | 2 +-
 src/test_seeking/Makefile.am  | 2 +-
 src/test_streams/Makefile.am  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/test_grabbag/cuesheet/Makefile.am 
b/src/test_grabbag/cuesheet/Makefile.am
index 96030407..59ae71f4 100644
--- a/src/test_grabbag/cuesheet/Makefile.am
+++ b/src/test_grabbag/cuesheet/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = \
test_cuesheet.vcxproj.filters
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
-noinst_PROGRAMS = test_cuesheet
+check_PROGRAMS = test_cuesheet
 test_cuesheet_SOURCES = \
main.c
 test_cuesheet_LDADD = \
diff --git a/src/test_grabbag/picture/Makefile.am 
b/src/test_grabbag/picture/Makefile.am
index b1a949e5..0ee04a41 100644
--- a/src/test_grabbag/picture/Makefile.am
+++ b/src/test_grabbag/picture/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = \
test_picture.vcxproj.filters
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
-noinst_PROGRAMS = test_picture
+check_PROGRAMS = test_picture
 test_picture_SOURCES = \
main.c
 
diff --git a/src/test_libFLAC++/Makefile.am b/src/test_libFLAC++/Makefile.am
index fec7e81a..31830b29 100644
--- a/src/test_libFLAC++/Makefile.am
+++ b/src/test_libFLAC++/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = \
test_libFLAC++.vcxproj.filters
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
-noinst_PROGRAMS = test_libFLAC++
+check_PROGRAMS = test_libFLAC++
 test_libFLAC___LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la 
\
diff --git a/src/test_libFLAC/Makefile.am b/src/test_libFLAC/Makefile.am
index ee3e1109..22e9453e 100644
--- a/src/test_libFLAC/Makefile.am
+++ b/src/test_libFLAC/Makefile.am
@@ -24,7 +24,7 @@ EXTRA_DIST = \
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include 
-I$(top_srcdir)/src/libFLAC/include
 
-noinst_PROGRAMS = test_libFLAC
+check_PROGRAMS = test_libFLAC
 
 test_libFLAC_LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
diff --git a/src/test_seeking/Makefile.am b/src/test_seeking/Makefile.am
index cb059ed6..b7dd852c 100644
--- a/src/test_seeking/Makefile.am
+++ b/src/test_seeking/Makefile.am
@@ -26,7 +26,7 @@ AM_CFLAGS = @OGG_CFLAGS@
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 
-noinst_PROGRAMS = test_seeking
+check_PROGRAMS = test_seeking
 test_seeking_LDADD = \
$(top_builddir)/src/libFLAC/libFLAC.la
 
diff --git a/src/test_streams/Makefile.am b/src/test_streams/Makefile.am
index c5f5df7f..fd66342c 100644
--- a/src/test_streams/Makefile.am
+++ b/src/test_streams/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = \
test_streams.vcxproj.filters
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
-noinst_PROGRAMS = test_streams
+check_PROGRAMS = test_streams
 test_streams_SOURCES = \
main.c
 
-- 
2.11.0

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 1/2] Do not override CFLAGS, as CFLAGS is a user flag.

2017-01-15 Thread David Seifert
* Furthermore, use NDEBUG globally to detect the presence
  of building with more debug output information.
  AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays
  Gnome has also switched to it from its own custom solution.
---
 configure.ac  |  52 --
 include/FLAC/assert.h |   2 +-
 m4/ax_check_enable_debug.m4   | 124 ++
 src/libFLAC/cpu.c |   2 +-
 src/libFLAC/lpc.c |   4 +-
 src/libFLAC/stream_encoder.c  |  10 ++--
 src/plugin_common/Makefile.am |   6 --
 src/plugin_common/charset.c   |   4 +-
 src/plugin_xmms/http.c|  12 ++--
 src/share/Makefile.am |   6 --
 10 files changed, 176 insertions(+), 46 deletions(-)
 create mode 100644 m4/ax_check_enable_debug.m4

diff --git a/configure.ac b/configure.ac
index a3e0fadb..8576cae5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,13 @@ AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign 1.10 -Wall tar-pax no-dist-gzip dist-xz 
subdir-objects])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+AC_MSG_CHECKING([whether configure should try to set 
CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS])
+AS_IF([test "x${CFLAGS+set}" = "xset" || test "x${CXXFLAGS+set}" = "xset" || 
test "x${CPPFLAGS+set}" = "xset" || test "x${LDFLAGS+set}" = "xset"],
+   [enable_flags_setting=no],
+   [enable_flags_setting=yes]
+)
+AC_MSG_RESULT([${enable_flags_setting}])
+AX_CHECK_ENABLE_DEBUG
 user_cflags=$CFLAGS
 
 #Prefer whatever the current ISO standard is.
@@ -206,14 +213,7 @@ AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 
32-byte boundaries])
 fi
 
-AC_ARG_ENABLE(debug,
-AC_HELP_STRING([--enable-debug], [Turn on debugging]),
-[case "${enableval}" in
-   yes) debug=true ;;
-   no)  debug=false ;;
-   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
-esac],[debug=false])
-AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
+AM_CONDITIONAL([DEBUG], [test "x${ax_enable_debug}" = "xyes" || test 
"x${ax_enable_debug}" = "xinfo"])
 
 AC_ARG_ENABLE(sse,
 AC_HELP_STRING([--disable-sse], [Disable passing of -msse2 to the compiler]),
@@ -390,14 +390,13 @@ AC_DEFINE(FLAC__HAS_NASM)
 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the 
NASM assembler])
 fi
 
-if test "x$debug" = xtrue; then
-   CPPFLAGS="-DDEBUG $CPPFLAGS"
-   CFLAGS="-g $CFLAGS"
-else
-   CPPFLAGS="-DNDEBUG $CPPFLAGS"
-   CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//')
+dnl If debugging is disabled AND no CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS
+dnl are provided, we can set defaults to our liking
+AS_IF([test "x${ax_enable_debug}" = "xno" && test "x${enable_flags_setting}" = 
"xyes"], [
+   AC_PROG_SED
+   CFLAGS=$(echo "$CFLAGS" | $SED 's/-O2//')
CFLAGS="-O3 -funroll-loops $CFLAGS"
-fi
+])
 
 XIPH_GCC_VERSION
 
@@ -406,7 +405,28 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings 
-Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef " # 
-Wcast-qual -Wbad-function-cast -Wwrite-strings -Woverloaded-virtual 
-Wmissing-declarations
 
XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
-   XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
+
+   dnl some distributions (such as Gentoo) have _FORTIFY_SOURCE always
+   dnl enabled. We test for this situation in order to prevent polluting
+   dnl the console with messages of macro redefinitions.
+   AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CFLAGS])
+   AC_LINK_IFELSE([
+   AC_LANG_SOURCE(
+   [[
+   int main() {
+   #ifndef _FORTIFY_SOURCE
+   return 0;
+   #else
+   this_is_an_error;
+   #endif
+   }
+   ]]
+   )], [
+   AC_MSG_RESULT([yes])
+   XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
+   ], [
+   AC_MSG_RESULT([no])
+   ])
 
AC_LANG_PUSH([C++])
XIPH_ADD_CXXFLAGS([-Weffc++])
diff --git a/include/FLAC/assert.h b/include/FLAC/assert.h
index b546fd07..55b34777 100644
--- a/include/FLAC/assert.h
+++ b/include/FLAC/assert.h
@@ -34,7 +34,7 @@
 #define FLAC__ASSERT_H
 
 /* we need this since some compilers (like MSVC) leave assert()s on release 
code (and we don't want to use their ASSERT) */
-#ifdef DEBUG
+#ifndef NDEBUG
 #include 
 #define FLAC__ASSERT(x) assert(x)
 #define FLAC__ASSERT_DECLARATION(x) x
diff --git a/m4/ax_check_enable_debug.m4 b/m4/ax_check_enable_debug.m4
new file mode 100644
index ..f99d75fe
--- /dev/null
+++ b/m4/ax_check_enable_debug.m4
@@ -0,0 +1,124 @@
+# 

Re: [flac-dev] [PATCH 1/4] Do not override CFLAGS, as CFLAGS is a user flag.

2017-01-14 Thread Erik de Castro Lopo
David Seifert wrote:

> * Furthermore, use NDEBUG globally to detect the presence
>   of building with more debug output information.
>   AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays
>   Gnome has also switched to it from its own custom solution.

This patch removes `-funroll-loops` which from memory provides a 
significant boost in encoding/decoding speed.

What's the best way to fix all this stuff but still turning
`-funroll-loops` be default?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/5] Allow multiple targets to be disabled

2017-01-14 Thread Erik de Castro Lopo
lvqcl wrote:

> I think that FLAC sources should remain compatible with Visual
> Studio 2010 (and probably earlier), people still need it.
> For example: 
> 
> Is it possible to simply exclude win_utf8_io.c from compiling
> if target OS is WinRT/non-desktop?

And I defer to others like lvqcl for what we do and do not 
support on Windows.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] add missing string.h include to cpu.c (for memset())

2017-01-14 Thread Erik de Castro Lopo
Ozkan Sezer wrote:

> On 1/13/17, Ozkan Sezer  wrote:
> > Attached patch adds missing string.h include to cpu.c (for memset())
> 
> Simpler patch attached, which just replaces memory.h with string.h
> cpu.c was the only source to use memory.h instead of string.h.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 3/4] Honor user's $(htmldir) and do not override GNU defaults for $(docdir)

2017-01-14 Thread Erik de Castro Lopo
David Seifert wrote:

> * HTML files should be installed to $(htmldir), and $(docdir) should
>   not be changed, as this is a user flag in the GNU conventions.

Applied, but this one required a few extra tweaks to keep "make distcheck"
working. 

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 4/4] When using libtool, use LTLIBICONV instead.

2017-01-14 Thread Erik de Castro Lopo
David Seifert wrote:

> * This is required, as otherwise -Wl,--as-needed could fail.

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 2/4] Make building/installing examples optional

2017-01-14 Thread Erik de Castro Lopo
David Seifert wrote:

> ---
>  Makefile.am  | 6 +-
>  configure.ac | 5 +
>  2 files changed, 10 insertions(+), 1 deletion(-)

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] add missing string.h include to cpu.c (for memset())

2017-01-14 Thread Ozkan Sezer
On 1/13/17, Ozkan Sezer  wrote:
> Attached patch adds missing string.h include to cpu.c (for memset())

Simpler patch attached, which just replaces memory.h with string.h
cpu.c was the only source to use memory.h instead of string.h.

--
O.S.


0001-replace-memory.h-include-with-string.h-in-cpu.c.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/5] Allow multiple targets to be disabled

2017-01-14 Thread lvqcl

Hugo Beauzée-Luyssen wrote:


  configure.ac: Allow the programs to be disabled
  configure.ac: Allow bench to be disabled
  configure.ac: Don't build any tests when they are explicitely disabled
  configure.ac: Allow examples to be disabled
  win_utf8_io: Avoid forbidden functions when building for WinRT/UWP

 configure.ac| 10 ++
 examples/Makefile.am|  2 ++
 microbench/Makefile.am  |  4 
 src/Makefile.am | 10 +++---
 src/flac/Makefile.am| 13 +
 src/metaflac/Makefile.am|  8 ++--
 src/share/win_utf8_io/win_utf8_io.c |  9 +
 src/test_libFLAC++/Makefile.am  |  5 +
 8 files changed, 52 insertions(+), 9 deletions(-)



Ping :)


I think that FLAC sources should remain compatible with Visual
Studio 2010 (and probably earlier), people still need it.
For example: 

Is it possible to simply exclude win_utf8_io.c from compiling
if target OS is WinRT/non-desktop?
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 0/5] Allow multiple targets to be disabled

2017-01-14 Thread Hugo Beauzée-Luyssen
On 01/06/2017 01:53 PM, Hugo Beauzée-Luyssen wrote:
> Hi,
> 
> This patchet allows a few targets to be disabled when unrequired.
> The rational is coming from VLC's contrib buildsystem, so far we use make -C 
> to select only some subparts of the available targets.
> It would be easier and cleaner to use autoconf to do so IMHO.
> 
> There's an additional patch which fixes the build when building for WinRT/UWP 
> platform, upstreamed from VLC. 
> We have a couple more for this platform, but ultimately, I think the proper 
> solution would be to allow only libflac to be built, as most forbidden 
> function calls are in the convenience libraries in flac/shared.
> I tried to switch those from noinst_LTLIBRARIES to EXTRA_LTLIBRARIES but 
> failed miserably at doing so :( I'm thinking it would be way easier to 
> achieve by moving to a non-recursive
> automake configuration, but that's kind of an intrusive change; that being 
> said, I'm willing to do it.
> 
> Please let me know what you think!
> 
> Regards,
> 
> Hugo Beauzée-Luyssen (5):
>   configure.ac: Allow the programs to be disabled
>   configure.ac: Allow bench to be disabled
>   configure.ac: Don't build any tests when they are explicitely disabled
>   configure.ac: Allow examples to be disabled
>   win_utf8_io: Avoid forbidden functions when building for WinRT/UWP
> 
>  configure.ac| 10 ++
>  examples/Makefile.am|  2 ++
>  microbench/Makefile.am  |  4 
>  src/Makefile.am | 10 +++---
>  src/flac/Makefile.am| 13 +
>  src/metaflac/Makefile.am|  8 ++--
>  src/share/win_utf8_io/win_utf8_io.c |  9 +
>  src/test_libFLAC++/Makefile.am  |  5 +
>  8 files changed, 52 insertions(+), 9 deletions(-)
> 

Ping :)

-- 
Hugo Beauzée-Luyssen

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] workaround for DJGPP missing wcswidth()

2017-01-13 Thread Erik de Castro Lopo
Ozkan Sezer wrote:

> Attached patch works around for DJGPP missing wcswidth()
> in flac/utils.c:strlen_console()

Applied, thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 1/4] Do not override CFLAGS, as CFLAGS is a user flag.

2017-01-13 Thread David Seifert
* Furthermore, use NDEBUG globally to detect the presence
  of building with more debug output information.
  AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays
  Gnome has also switched to it from its own custom solution.
---
 configure.ac  |  19 +--
 include/FLAC/assert.h |   2 +-
 m4/ax_check_enable_debug.m4   | 124 ++
 src/libFLAC/cpu.c |   2 +-
 src/libFLAC/lpc.c |   4 +-
 src/libFLAC/stream_encoder.c  |  10 ++--
 src/plugin_common/Makefile.am |   6 --
 src/plugin_common/charset.c   |   4 +-
 src/plugin_xmms/http.c|  12 ++--
 src/share/Makefile.am |   6 --
 10 files changed, 142 insertions(+), 47 deletions(-)
 create mode 100644 m4/ax_check_enable_debug.m4

diff --git a/configure.ac b/configure.ac
index 235d2717..ba97bac0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -205,14 +205,8 @@ AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 
32-byte boundaries])
 fi
 
-AC_ARG_ENABLE(debug,
-AC_HELP_STRING([--enable-debug], [Turn on debugging]),
-[case "${enableval}" in
-   yes) debug=true ;;
-   no)  debug=false ;;
-   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
-esac],[debug=false])
-AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
+AX_CHECK_ENABLE_DEBUG
+AM_CONDITIONAL([DEBUG], [test "x$ax_enable_debug" = "xyes" -o 
"x$ax_enable_debug" = "xinfo"])
 
 AC_ARG_ENABLE(sse,
 AC_HELP_STRING([--disable-sse], [Disable passing of -msse2 to the compiler]),
@@ -384,15 +378,6 @@ AC_DEFINE(FLAC__HAS_NASM)
 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the 
NASM assembler])
 fi
 
-if test "x$debug" = xtrue; then
-   CPPFLAGS="-DDEBUG $CPPFLAGS"
-   CFLAGS="-g $CFLAGS"
-else
-   CPPFLAGS="-DNDEBUG $CPPFLAGS"
-   CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//')
-   CFLAGS="-O3 -funroll-loops $CFLAGS"
-fi
-
 XIPH_GCC_VERSION
 
 if test x$ac_cv_c_compiler_gnu = xyes ; then
diff --git a/include/FLAC/assert.h b/include/FLAC/assert.h
index b546fd07..55b34777 100644
--- a/include/FLAC/assert.h
+++ b/include/FLAC/assert.h
@@ -34,7 +34,7 @@
 #define FLAC__ASSERT_H
 
 /* we need this since some compilers (like MSVC) leave assert()s on release 
code (and we don't want to use their ASSERT) */
-#ifdef DEBUG
+#ifndef NDEBUG
 #include 
 #define FLAC__ASSERT(x) assert(x)
 #define FLAC__ASSERT_DECLARATION(x) x
diff --git a/m4/ax_check_enable_debug.m4 b/m4/ax_check_enable_debug.m4
new file mode 100644
index ..f99d75fe
--- /dev/null
+++ b/m4/ax_check_enable_debug.m4
@@ -0,0 +1,124 @@
+# ===
+#   http://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
+# ===
+#
+# SYNOPSIS
+#
+#   AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no], [ENABLE 
DEBUG VARIABLES ...], [DISABLE DEBUG VARIABLES NDEBUG ...], [IS-RELEASE])
+#
+# DESCRIPTION
+#
+#   Check for the presence of an --enable-debug option to configure, with
+#   the specified default value used when the option is not present.  Return
+#   the value in the variable $ax_enable_debug.
+#
+#   Specifying 'yes' adds '-g -O0' to the compilation flags for all
+#   languages. Specifying 'info' adds '-g' to the compilation flags.
+#   Specifying 'profile' adds '-g -pg' to the compilation flags and '-pg' to
+#   the linking flags. Otherwise, nothing is added.
+#
+#   Define the variables listed in the second argument if debug is enabled,
+#   defaulting to no variables.  Defines the variables listed in the third
+#   argument if debug is disabled, defaulting to NDEBUG.  All lists of
+#   variables should be space-separated.
+#
+#   If debug is not enabled, ensure AC_PROG_* will not add debugging flags.
+#   Should be invoked prior to any AC_PROG_* compiler checks.
+#
+#   IS-RELEASE can be used to change the default to 'no' when making a
+#   release.  Set IS-RELEASE to 'yes' or 'no' as appropriate. By default, it
+#   uses the value of $ax_is_release, so if you are using the AX_IS_RELEASE
+#   macro, there is no need to pass this parameter.
+#
+# AX_IS_RELEASE([git-directory])
+# AX_CHECK_ENABLE_DEBUG()
+#
+# LICENSE
+#
+#   Copyright (c) 2011 Rhys Ulerich 
+#   Copyright (c) 2014, 2015 Philip Withnall 
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+
+#serial 5
+
+AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[
+AC_BEFORE([$0],[AC_PROG_CC])dnl
+AC_BEFORE([$0],[AC_PROG_CXX])dnl
+AC_BEFORE([$0],[AC_PROG_F77])dnl
+AC_BEFORE([$0],[AC_PROG_FC])dnl
+
+AC_MSG_CHECKING(whether to enable debugging)
+
+ax_enable_debug_default=m4_tolower(m4_normalize(ifelse([$1],,[no],[$1])))
+

[flac-dev] [PATCH 3/4] Honor user's $(htmldir) and do not override GNU defaults for $(docdir)

2017-01-13 Thread David Seifert
* HTML files should be installed to $(htmldir), and $(docdir) should
  not be changed, as this is a user flag in the GNU conventions.
---
 doc/Makefile.am |  2 --
 doc/html/Makefile.am| 10 --
 doc/html/images/Makefile.am |  4 ++--
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index fb79e3a7..bc9ae52a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -31,8 +31,6 @@ FLAC.tag:
mkdir -p html/api
 endif
 
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
-
 doc_DATA = \
FLAC.tag
 
diff --git a/doc/html/Makefile.am b/doc/html/Makefile.am
index 813b55f2..ef4a12d8 100644
--- a/doc/html/Makefile.am
+++ b/doc/html/Makefile.am
@@ -18,9 +18,7 @@
 
 SUBDIRS = images
 
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html
-
-doc_DATA = \
+html_DATA = \
changelog.html \
developers.html \
documentation.html \
@@ -46,10 +44,10 @@ if FLaC__HAS_DOXYGEN
 # The install targets don't copy whole directories so we have to
 # handle 'api/' specially:
 install-data-local:
-   $(mkinstalldirs) $(DESTDIR)$(docdir)/api
-   (cd $(builddir)/api && $(INSTALL_DATA) * $(DESTDIR)$(docdir)/api)
+   $(mkinstalldirs) $(DESTDIR)$(htmldir)/api
+   (cd $(builddir)/api && $(INSTALL_DATA) * $(DESTDIR)$(htmldir)/api)
 uninstall-local:
-   rm -rf $(DESTDIR)$(docdir)/api
+   rm -rf $(DESTDIR)$(htmldir)/api
 distclean-local:
-rm -rf api
 endif
diff --git a/doc/html/images/Makefile.am b/doc/html/images/Makefile.am
index 33485f3a..f8f551da 100644
--- a/doc/html/images/Makefile.am
+++ b/doc/html/images/Makefile.am
@@ -16,9 +16,9 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html/images
+logosdir = $(htmldir)/images
 
-doc_DATA = \
+logos_DATA = \
logo.svg \
logo130.gif
 
-- 
2.11.0

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/4] Make building/installing examples optional

2017-01-13 Thread David Seifert
---
 Makefile.am  | 6 +-
 configure.ac | 5 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index a325e3a9..38aea04a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,7 +31,11 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = doc include m4 man src examples test build objs microbench
+SUBDIRS = doc include m4 man src test build objs microbench
+
+if EXAMPLES
+SUBDIRS += examples
+endif
 
 EXTRA_DIST = \
COPYING.FDL \
diff --git a/configure.ac b/configure.ac
index ba97bac0..9eb2c243 100644
--- a/configure.ac
+++ b/configure.ac
@@ -353,6 +353,11 @@ AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],$FLAC__HAS_OGG,[define 
if you have the ogg li
 AC_SUBST(FLAC__HAS_OGG)
 AC_SUBST(OGG_PACKAGE)
 
+dnl Build examples?
+AC_ARG_ENABLE([examples],
+   AS_HELP_STRING([--disable-examples], [Don't build and install 
examples]))
+AM_CONDITIONAL([EXAMPLES], [test "x$enable_examples" != "xno"])
+
 dnl check for i18n(internationalization); these are from libiconv/gettext
 AM_ICONV
 AM_LANGINFO_CODESET
-- 
2.11.0

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] workaround for DJGPP missing wcswidth()

2017-01-13 Thread Ozkan Sezer
Attached patch works around for DJGPP missing wcswidth()
in flac/utils.c:strlen_console()

--
O.S.


0001-flac-utils.c-strlen_console-workaround-for-DJGPP-mis.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] add missing string.h include to cpu.c (for memset())

2017-01-13 Thread Ozkan Sezer
Attached patch adds missing string.h include to cpu.c (for memset())

--
O.S.


0001-add-missing-string.h-include-to-cpu.c-for-memset.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] support nasm coff obj format for djgpp

2017-01-13 Thread Ozkan Sezer
Attached patch adds support nasm coff obj format for djgpp

--
O.S.


0001-support-nasm-coff-obj-format-for-djgpp.patch
Description: Binary data
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] configure.ac: relax linux OS detection

2017-01-13 Thread Erik de Castro Lopo
Peter Korsgaard wrote:

> Not all linux hosts match the *-pc-linux-gnu wildcard, causing build
> failures for older glibc versions where we need to link with -lrt for
> clock_gettime - E.G.:

Applied. Thanks.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] configure.ac: relax linux OS detection

2017-01-09 Thread Peter Korsgaard
Not all linux hosts match the *-pc-linux-gnu wildcard, causing build
failures for older glibc versions where we need to link with -lrt for
clock_gettime - E.G.:

 - arm-unknown-linux-musleabihf
 - powerpc-unknown-linux-gnuspe
 - bfin-linux-linux-uclibc
 ..

Signed-off-by: Peter Korsgaard 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 070ab357..235d2717 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,7 +186,7 @@ esac
 AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
 
 case "$host" in
-   *-pc-linux-gnu)
+   *-linux-*)
sys_linux=true
AC_DEFINE(FLAC__SYS_LINUX)
AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
-- 
2.11.0

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] configure.ac: relax linux OS detection

2017-01-09 Thread Peter Korsgaard
Not all linux hosts match the *-pc-linux-gnu wildcard, causing build
failures for older glibc versions where we need to link with -lrt for
clock_gettime - E.G.:

 - arm-unknown-linux-musleabihf
 - powerpc-unknown-linux-gnuspe
 - bfin-linux-linux-uclibc
 ..

Signed-off-by: Peter Korsgaard 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 070ab357..235d2717 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,7 +186,7 @@ esac
 AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
 
 case "$host" in
-   *-pc-linux-gnu)
+   *-linux-*)
sys_linux=true
AC_DEFINE(FLAC__SYS_LINUX)
AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
-- 
2.11.0

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] win_utf8_io: Avoid forbidden functions when building for WinRT/UWP

2017-01-06 Thread Hugo Beauzée-Luyssen

On 01/06/2017 03:37 PM, lvqcl.mail wrote:

Hugo Beauzée-Luyssen  wrote:


---
 src/share/win_utf8_io/win_utf8_io.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/share/win_utf8_io/win_utf8_io.c
b/src/share/win_utf8_io/win_utf8_io.c
index c61d27f3..1437b41e 100644
--- a/src/share/win_utf8_io/win_utf8_io.c
+++ b/src/share/win_utf8_io/win_utf8_io.c
@@ -34,6 +34,7 @@
 #endif
#include 
+#include 


According to

winapifamily.h is only available since MSVS 2012, so build will fail in
older
versions of Visual Studio (and in some older versions of MinGW).


 #include "share/win_utf8_io.h"
 #include "share/windows_unicode_filenames.h"
@@ -164,11 +165,13 @@ size_t strlen_utf8(const char *str)
 int win_get_console_width(void)
 {
 int width = 80;
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)


Apparently these preprocessor defines are from winapifamily.h
so it won't work in older MSVS and MinGW.


 CONSOLE_SCREEN_BUFFER_INFO csbi;
 HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
 if(hOut != INVALID_HANDLE_VALUE && hOut != NULL)
 if (GetConsoleScreenBufferInfo(hOut, ) != 0)
 width = csbi.dwSize.X;
+#endif
 return width;
 }
@@ -176,6 +179,7 @@ int win_get_console_width(void)
static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
 {
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)


Again, doesn't work with older MSVS and MinGW.


 DWORD out;
 int ret;
@@ -202,6 +206,11 @@ static int wprint_console(FILE *stream, const
wchar_t *text, size_t len)
 if (ret < 0)
 return ret;
 return len;
+#else
+(void)stream;
+OutputDebugStringW(text);
+return len;
+#endif
 }


Why OutputDebugStringW? MSDN says in
:

"Sends a string to the debugger for display. [...] If the application
has no debugger, the system debugger displays the string if the filter
mask allows it. [...] If the application has no debugger and the system
debugger is not active, OutputDebugString does nothing. [...] Applications
should send very minimal debug output and provide a way for the user
to enable or disable its use."
...it doesn't look like a function that simply prints some output from a
program.



You won't have a console per-se in WinRT. The closest thing I can think 
of is an attached debugger's output/console




And what's the goal of this patch? To create flac.exe/metaflac.exe that
can work in WinRT? Or to remove build errors, and flac/metaflac are allowed
to work incorrectly?


Fixing the build for WinRT. So far, building the utf8 convenience 
library is mandatory as it's part of noinst_LTLIBRARIES
The correct fix (as far as I'm concerned, but that's because I'm only 
aiming at building libflac) would be to skip building libraries in 
flac/share, as described in the cover letter.
Building anything else than the libflac/libflac++ is bound to fail 
anyway (you might get an executable, but it won't run)


Regards,
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 5/5] win_utf8_io: Avoid forbidden functions when building for WinRT/UWP

2017-01-06 Thread lvqcl.mail

Hugo Beauzée-Luyssen  wrote:


---
 src/share/win_utf8_io/win_utf8_io.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/share/win_utf8_io/win_utf8_io.c  
b/src/share/win_utf8_io/win_utf8_io.c

index c61d27f3..1437b41e 100644
--- a/src/share/win_utf8_io/win_utf8_io.c
+++ b/src/share/win_utf8_io/win_utf8_io.c
@@ -34,6 +34,7 @@
 #endif
#include 
+#include 


According to  

winapifamily.h is only available since MSVS 2012, so build will fail in  
older

versions of Visual Studio (and in some older versions of MinGW).


 #include "share/win_utf8_io.h"
 #include "share/windows_unicode_filenames.h"
@@ -164,11 +165,13 @@ size_t strlen_utf8(const char *str)
 int win_get_console_width(void)
 {
int width = 80;
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)


Apparently these preprocessor defines are from winapifamily.h
so it won't work in older MSVS and MinGW.


CONSOLE_SCREEN_BUFFER_INFO csbi;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
if(hOut != INVALID_HANDLE_VALUE && hOut != NULL)
if (GetConsoleScreenBufferInfo(hOut, ) != 0)
width = csbi.dwSize.X;
+#endif
return width;
 }
@@ -176,6 +179,7 @@ int win_get_console_width(void)
static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
 {
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)


Again, doesn't work with older MSVS and MinGW.


DWORD out;
int ret;
@@ -202,6 +206,11 @@ static int wprint_console(FILE *stream, const  
wchar_t *text, size_t len)

if (ret < 0)
return ret;
return len;
+#else
+(void)stream;
+OutputDebugStringW(text);
+return len;
+#endif
 }


Why OutputDebugStringW? MSDN says in  
:

"Sends a string to the debugger for display. [...] If the application
has no debugger, the system debugger displays the string if the filter
mask allows it. [...] If the application has no debugger and the system
debugger is not active, OutputDebugString does nothing. [...] Applications
should send very minimal debug output and provide a way for the user
to enable or disable its use."
...it doesn't look like a function that simply prints some output from a  
program.



And what's the goal of this patch? To create flac.exe/metaflac.exe that
can work in WinRT? Or to remove build errors, and flac/metaflac are allowed
to work incorrectly?
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/5] configure.ac: Allow bench to be disabled

2017-01-06 Thread Hugo Beauzée-Luyssen
---
 configure.ac   | 3 +++
 microbench/Makefile.am | 4 
 2 files changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index 94449510..bdeba93a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -362,6 +362,9 @@ AC_SUBST(OGG_PACKAGE)
 AC_ARG_ENABLE([bin], AC_HELP_STRING([--disable-bin], [Do not build the flac 
program]))
 AM_CONDITIONAL([FLaC__HAS_BIN], [test "${enable_bin}" != "no"])
 
+AC_ARG_ENABLE([benchmark], AC_HELP_STRING([--disable-benchmark], [Do not build 
the flac benchmark]))
+AM_CONDITIONAL([FLaC__HAS_BENCHMARK], [test "${enable_benchmark}" != "no"])
+
 dnl check for i18n(internationalization); these are from libiconv/gettext
 AM_ICONV
 AM_LANGINFO_CODESET
diff --git a/microbench/Makefile.am b/microbench/Makefile.am
index 9ab6a040..9c960691 100644
--- a/microbench/Makefile.am
+++ b/microbench/Makefile.am
@@ -33,8 +33,12 @@ AM_CPPFLAGS = -I$(top_srcdir)/include 
-I$(top_srcdir)/src/libFLAC/include
 
 noinst_HEADERS = util.h
 
+if FLaC__HAS_BENCHMARK
+
 noinst_PROGRAMS = benchmark_residual
 
 benchmark_residual_SOURCES = benchmark_residual.c util.c
 
 benchmark_residual_LDADD = @LIB_CLOCK_GETTIME@
+
+endif
-- 
2.11.0

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


  1   2   3   4   5   6   7   8   >