Updated Opus encoder/decoder libraries to v1.1.x and Opus-Tools to v0.1.6 (2013-01-17).

This commit is contained in:
LoRd_MuldeR 2013-01-17 20:46:07 +01:00
parent 21e1fd7945
commit 491bf5f135
12 changed files with 1043 additions and 914 deletions

View File

@ -23,7 +23,7 @@ a:visited { color: #0000EE; }
<li>Added option to filter the log entries on the "processing" dialog (see context menu)
<li>Added "Up One Level" button to the output folder tab
<li>Updated Qt runtime libraries to v4.8.4 (2012-11-29), compiled with MSVC 11.0
<li>Updated Opus encoder/decoder libraries to v1.1.x and Opus-Tools to v0.1.6 (2012-12-07)
<li>Updated Opus encoder/decoder libraries to v1.1.x and Opus-Tools to v0.1.6 (2013-01-17)
<li>Fixed handling of certain characters when passing meta tags on the command-line
</ul><br>

View File

@ -0,0 +1,129 @@
src/opusdec.c | 24 +++++++++++++++++++++---
src/opusenc.c | 17 +++++++----------
2 files changed, 134 insertions(+), 71 deletions(-)
diff --git a/src/opusdec.c b/src/opusdec.c
index 397ecb5..ade69fc 100644
--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -57,6 +57,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;
@@ -681,6 +684,7 @@ int main(int argc, char **argv)
int dither=1;
shapestate shapemem;
SpeexResamplerState *resampler=NULL;
+ int no_resample = 0;
float gain=1;
int streams=0;
size_t last_spin=0;
@@ -743,6 +747,9 @@ int main(int argc, char **argv)
} else if (strcmp(long_options[option_index].name,"rate")==0)
{
rate=atoi (optarg);
+ } else if (strcmp(long_options[option_index].name,"no-resample")==0)
+ {
+ no_resample=1;
} else if (strcmp(long_options[option_index].name,"gain")==0)
{
manual_gain=atof (optarg);
@@ -824,6 +831,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
@@ -914,7 +931,7 @@ int main(int argc, char **argv)
as described in the OggOpus spec. But for commandline tools
like opusdec it can be desirable to exactly preserve the original
sampling rate and duration, so we have a resampler here.*/
- if (rate != 48000)
+ if ((rate != 48000) && (!no_resample))
{
int err;
resampler = speex_resampler_init(channels, 48000, rate, 5, &err);
@@ -971,10 +988,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*sizeof(short));
+ 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 749760a..2b472b0 100644
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -954,6 +954,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){
@@ -961,20 +962,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 && inopt.total_samples_per_channel<nb_encoded){
- snprintf(sbuf,54,"\r[%c] %02d%% ",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);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -28,9 +28,9 @@
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 7
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 7
#define VER_LAMEXP_BUILD 1224
#define VER_LAMEXP_TYPE Beta
#define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 1226
///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!)

View File

@ -2391,8 +2391,8 @@ void lamexp_fatal_exit(const wchar_t* exitMessage, const wchar_t* errorBoxMessag
}
}
Sleep(30000);
TerminateProcess(GetCurrentProcess(), -1);
TerminateThread(GetCurrentThread(), -1);
Sleep(INFINITE);
}
/*

View File

@ -72,8 +72,8 @@ g_lamexp_tools[] =
{"8b68461f38410421be30cc895e94e63184daa6f2cb20eb110b66b376b48141838a09bc920efeb1c49de79dd0770ce41b", CPU_TYPE_X86_GEN, "oggenc2.i386.exe", 287603},
{"20648f83cc637cada481143d48c437ced8423e9a0aae01dbce860cd97fb1ce4000e314f3a5395d1eafd8e154a8e74d08", CPU_TYPE_X86_SSE, "oggenc2.sse2.exe", 287603},
{"e1da48055a57bae41d6a1a0dc08b86831c121e85c07aa60aae4196997b166a08cfb7265d9f0f289f445ad73bce28d81f", CPU_TYPE_X64_ALL, "oggenc2.x64.exe", 287603},
{"76e99a444e9720c83cca4c38d0aa2670c3bb2b0200b751ad3a71e79148291183b99c9506a51d1222dc115ac6f222f3d2", CPU_TYPE_ALL_ALL, "opusdec.exe", 20121207},
{"9e2896d1663349dd9fa434ab722f5449fb7d46d5af66611225d9b1f5beca0bd08effc59b7adc175525d0f776b2d4fc83", CPU_TYPE_ALL_ALL, "opusenc.exe", 20121207},
{"7cff3801328ecae545d5e8c64bae5fd55fd0dca17117b47910779d06991fd3eb920d72c00599aa05d9709c03983d1d7b", CPU_TYPE_ALL_ALL, "opusdec.exe", 20130117},
{"b427f7f078bd54b97ff73b71244e0060ce59dcfae7d7e4f25c7a653f5b7dc42325b7e7edd9ec3c4cdae2407f47272884", CPU_TYPE_ALL_ALL, "opusenc.exe", 20130117},
{"bdfa8dec142b6327a33af6bb314d7beb924588d1b73f2ef3f46b31fa6046fe2f4e64ca78b025b7eb9290a78320e2aa57", CPU_TYPE_ALL_ALL, "refalac.exe", 56},
{"d041b60de6c5c6e77cbad84440db57bbeb021af59dd0f7bebd3ede047d9e2ddc2a0c14179472687ba91063743d23e337", CPU_TYPE_ALL_ALL, "shorten.exe", 361},
{"81633b4808ff13e25249aac038ed97570aaeea2bbffacf0f3905514064d1b82d141a6b04f63f1a913e4d09b2d892aea0", CPU_TYPE_ALL_ALL, "sox.exe", 1440},