Updated Opus encoder/decoder libraries v1.1.3-Git and Opus-Tools to v0.1.9-Git (2016-10-16).

This commit is contained in:
LoRd_MuldeR 2016-10-16 17:03:05 +02:00
parent 161050f01a
commit cf8f9163bc
9 changed files with 187 additions and 6 deletions

View File

@ -0,0 +1,181 @@
src/opusdec.c | 24 +++++++++++++++++++++---
src/opusenc.c | 18 ++++++++----------
win32/config.h | 10 +++++++++-
win32/genversion.bat | 1 +
win32/version.h | 12 +++++++++++-
5 files changed, 50 insertions(+), 15 deletions(-)
diff --git a/src/opusdec.c b/src/opusdec.c
index d085f04..92027fe 100644
--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -53,6 +53,7 @@
# include <io.h>
# include <fcntl.h>
# define I64FORMAT "I64d"
+# define ftello64(_x) _ftelli64((_x))
#else
# define I64FORMAT "lld"
# define fopen_utf8(_x,_y) fopen((_x),(_y))
@@ -658,6 +659,7 @@ int main(int argc, char **argv)
{"force-wav", no_argument, NULL, 0},
{"packet-loss", required_argument, NULL, 0},
{"save-range", required_argument, NULL, 0},
+ {"no-resample", no_argument, NULL, 0},
{0, 0, 0, 0}
};
ogg_sync_state oy;
@@ -667,6 +669,7 @@ int main(int argc, char **argv)
int close_in=0;
int eos=0;
ogg_int64_t audio_size=0;
+ ogg_int64_t input_size=0;
double last_coded_seconds=0;
float loss_percent=-1;
float manual_gain=0;
@@ -683,6 +686,7 @@ int main(int argc, char **argv)
int fp=0;
shapestate shapemem;
SpeexResamplerState *resampler=NULL;
+ int no_resample = 0;
float gain=1;
int streams=0;
size_t last_spin=0;
@@ -747,7 +751,10 @@ int main(int argc, char **argv)
forcewav=1;
} else if (strcmp(long_options[option_index].name,"rate")==0)
{
- rate=atoi (optarg);
+ rate=((no_resample) ? 48000 : atoi(optarg));
+ } else if (strcmp(long_options[option_index].name,"no-resample")==0)
+ {
+ no_resample=1; rate=48000;
} else if (strcmp(long_options[option_index].name,"gain")==0)
{
manual_gain=atof (optarg);
@@ -833,6 +840,16 @@ int main(int argc, char **argv)
close_in=1;
}
+ /*detect input size*/
+ if(fin != stdin)
+ {
+ struct _stat64 info;
+ if(_fstati64(_fileno(fin), &info) == 0)
+ {
+ input_size = info.st_size;
+ }
+ }
+
/* .opus files use the Ogg container to provide framing and timekeeping.
* http://tools.ietf.org/html/draft-terriberry-oggopus
* The easiest way to decode the Ogg container is to use libogg, so
@@ -1011,10 +1028,11 @@ int main(int argc, char **argv)
/*Display a progress spinner while decoding.*/
static const char spinner[]="|/-\\";
double coded_seconds = (double)audio_size/(channels*rate*(fp?4:2));
+ double percent = (input_size>0) ? ((double)ftello64(fin))/((double)input_size) : 0.0;
if(coded_seconds>=last_coded_seconds+1){
- fprintf(stderr,"\r[%c] %02d:%02d:%02d", spinner[last_spin&3],
+ fprintf(stderr,"\r[%c] %02d:%02d:%02d (%.f%%)", spinner[last_spin&3],
(int)(coded_seconds/3600),(int)(coded_seconds/60)%60,
- (int)(coded_seconds)%60);
+ (int)(coded_seconds)%60, percent*100.0);
fflush(stderr);
last_spin++;
last_coded_seconds=coded_seconds;
diff --git a/src/opusenc.c b/src/opusenc.c
index 5f89d8a..52a080c 100644
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -41,6 +41,7 @@
#include <time.h>
#endif
#include <math.h>
+#include <time.h>
#ifdef _MSC_VER
#define snprintf _snprintf
@@ -1031,6 +1032,7 @@ int main(int argc, char **argv)
double estbitrate;
double coded_seconds=nb_encoded/(double)coding_rate;
double wall_time=(stop_time-start_time)+1e-6;
+ double percent = 0.0;
char sbuf[55];
static const char spinner[]="|/-\\";
if(!with_hard_cbr){
@@ -1038,20 +1040,16 @@ int main(int argc, char **argv)
estbitrate=(total_bytes*8.0/coded_seconds)*tweight+
bitrate*(1.-tweight);
}else estbitrate=nbBytes*8*((double)coding_rate/frame_size);
+ if(inopt.total_samples_per_channel>0){
+ percent = ((double)nb_encoded) / ((double)inopt.total_samples_per_channel);
+ }
fprintf(stderr,"\r");
for(i=0;i<last_spin_len;i++)fprintf(stderr," ");
- if(inopt.total_samples_per_channel>0 && nb_encoded<inopt.total_samples_per_channel){
- snprintf(sbuf,54,"\r[%c] %2d%% ",spinner[last_spin&3],
- (int)floor(nb_encoded/(double)(inopt.total_samples_per_channel+inopt.skip)*100.));
- }else{
- snprintf(sbuf,54,"\r[%c] ",spinner[last_spin&3]);
- }
- last_spin_len=strlen(sbuf);
- snprintf(sbuf+last_spin_len,54-last_spin_len,
- "%02d:%02d:%02d.%02d %4.3gx realtime, %5.4gkbit/s",
+ snprintf(sbuf,54,"\r[%c] %02d:%02d:%02d.%02d (%.f%%) %4.3gx realtime, %5.4gkbit/s",
+ spinner[last_spin&3],
(int)(coded_seconds/3600),(int)(coded_seconds/60)%60,
(int)(coded_seconds)%60,(int)(coded_seconds*100)%100,
- coded_seconds/wall_time,
+ percent*100.0,coded_seconds/wall_time,
estbitrate/1000.);
fprintf(stderr,"%s",sbuf);
fflush(stderr);
diff --git a/win32/config.h b/win32/config.h
index 5a1e250..1090a9f 100644
--- a/win32/config.h
+++ b/win32/config.h
@@ -10,7 +10,15 @@
#define USE_ALLOCA 1
#define FLOATING_POINT 1
#define SPX_RESAMPLE_EXPORT
-#define __SSE__
+
+/* Enable SSE functions, if compiled with SSE/SSE2 (note that AMD64 implies SSE2) */
+#if defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))
+#define __SSE__ 1
+#endif
+
+#if defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2))
+#define __SSE2__ 1
+#endif
#define RANDOM_PREFIX foo
diff --git a/win32/genversion.bat b/win32/genversion.bat
index 44ba29c..e94e8ea 100644
--- a/win32/genversion.bat
+++ b/win32/genversion.bat
@@ -1,4 +1,5 @@
@echo off
+goto:eof
for /f %%v in ('git describe --tags --match "v*" --always') do set version=%%v
diff --git a/win32/version.h b/win32/version.h
index 3c8a521..c05f50f 100644
--- a/win32/version.h
+++ b/win32/version.h
@@ -1 +1,11 @@
-#define PACKAGE_VERSION "v0.1.9-dev"
+#define __PACKAGE_VERSION "v0.1.9-git"
+
+#if defined(__AVX__) && __AVX__
+#define PACKAGE_VERSION __PACKAGE_VERSION " AVX1 [" __DATE__ "]"
+#else
+#if defined(__SSE__) && __SSE__
+#define PACKAGE_VERSION __PACKAGE_VERSION " SSE2 [" __DATE__ "]"
+#else
+#define PACKAGE_VERSION __PACKAGE_VERSION " IA32 [" __DATE__ "]"
+#endif
+#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -96,12 +96,12 @@ g_lamexp_tools[] =
{"245181321625445ac42fce31d64bf03872e77e2d0dd3c19d6c17ca2771354f096a6040827dd6d00ffd7342c7dd26168e", CPU_TYPE_X86_GEN, "oggenc2.i386.exe", 288135603, "2015"},
{"512b8efcd1003a0f67220a450d6ea4466194e8fd49fc090a69b15a858db11499acbf98f984530cd5d37b4b6abdd1c6d8", CPU_TYPE_X86_SSX, "oggenc2.sse2.exe", 288135603, "2015"},
{"a07ef67cba5a00d335d07372baf76d4d0573b425afce71a19c1e04eaabbe3f55e60bdd40af5e428224c91df1823eda08", CPU_TYPE_X64_ALL, "oggenc2.x64.exe", 288135603, "2015"},
{"a031b91fe6d532f6bb08bb2cab7e9dc48eae4bf81b1aaf9014e71897c2d171934ae4057c208ebacfc652dacd6e41b474", CPU_TYPE_ALL_GEN, "opusdec.i386.exe", 20160911, "v1.1.3"},
{"ea8a668e82a5733e267a6a1fc2aec269a49b9a93c44d0760c77b5c44eb313d6e989b171399687c27f25e510fd26e861c", CPU_TYPE_ALL_SSE, "opusdec.sse2.exe", 20160911, "v1.1.3"},
{"3aa54ba9135c231194a35ace0aa0d87267b243c2e8c99ecae025a9eb4704d14970840783bb1a27713aa606a6188a4fd8", CPU_TYPE_ALL_AVX, "opusdec.avx.exe", 20160911, "v1.1.3"},
{"a2bb8fe42c7764eafe7e4cda660f781bdb3c0556426bb38b294aa8bf11c6da560018762908a15546d3b31a877b70f815", CPU_TYPE_ALL_GEN, "opusenc.i386.exe", 20160911, "v1.1.3"},
{"0ae947277095be18d741ad4a328633a7d52cdd4112841a22313227cf57ee780a9e95fdc0a2af9014630e7dd9f01a1ea1", CPU_TYPE_ALL_SSE, "opusenc.sse2.exe", 20160911, "v1.1.3"},
{"57376b6b037771260da5a46e23fd9de76294dc25c5a0078f1d46268b4df046cfa42b04cb370b7be7e6f3cfaed3679f85", CPU_TYPE_ALL_AVX, "opusenc.avx.exe", 20160911, "v1.1.3"},
{"19a899d806202b90c195accbf83c78f88874d3881e8bbb1dffb820ee2b15fa2cf8ed8f36827c60738eb3cf47c97796cf", CPU_TYPE_ALL_GEN, "opusdec.i386.exe", 20161016, "v1.1.3"},
{"2ab18d9f0cb7ab97d499c7d0efde0926d97cca86fbc6426e27d2232858132dda1324bcd97198a9327c1046ef5f5af8d2", CPU_TYPE_ALL_SSE, "opusdec.sse2.exe", 20161016, "v1.1.3"},
{"b8d35eedea15945f6b889d54d8999d44c25c6be0e279ee5ed4b8c64b1bace224313a8d8055ea932c6cbfbfc3a88eb9ae", CPU_TYPE_ALL_AVX, "opusdec.avx.exe", 20161016, "v1.1.3"},
{"81e8c725043cf8b52b699c5939447b762216274527e49149827c5723a84d24dad099cc00cf8a7ad33ac4a4f14f173fe9", CPU_TYPE_ALL_GEN, "opusenc.i386.exe", 20161016, "v1.1.3"},
{"af37f33dcec556714820c7d5ad0ef0e51664542dbe80de70bfb4b9da6f982a25233380c6b56bb545c89c9c61777aae5d", CPU_TYPE_ALL_SSE, "opusenc.sse2.exe", 20161016, "v1.1.3"},
{"45c93ff42003a029cf570287f5d83c022d4b704822ae083825d77a2089978412798fc217f685215b5722608f7b2fac7c", CPU_TYPE_ALL_AVX, "opusenc.avx.exe", 20161016, "v1.1.3"},
{"37745174e146fedbc62671ab86ffddd3edfc9aa0ebfcfd4bff3331a95b6dda50621478c63f7a0ddf9a365e916758b6d4", CPU_TYPE_X86_ALL, "refalac.i386.exe", 161, ""},
{"b368f0490cefb80b6ff7eaaf8d6e29f253442375caf11a9405b5b21580ee3a9739fa3f406f69de5ef344fa038b1cbe72", CPU_TYPE_X64_ALL, "refalac.x64.exe", 161, ""},
{"d041b60de6c5c6e77cbad84440db57bbeb021af59dd0f7bebd3ede047d9e2ddc2a0c14179472687ba91063743d23e337", CPU_TYPE_ALL_ALL, "shorten.exe", 361, ""},