Help - Search - Members - Calendar
Full Version: new Open Source mp3 Encoder from Helix Community
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
Pages: 1, 2, 3, 4, 5
Enig123
rev6 uploaded.

-HF description added and will not take effect when bitrate/channle less than 96k or vbr_scale less than 80, as default.

-F to set lowpass frequency
spoon
Enig123: Does this CLI encoder allow std input / output piping?
Enig123
Sorry. I'm afraid there's no pipe supporting for now.

Can someone give some link thant can indicate how to add such features?
tycho
/Edit: removed irrelevant text.

It should be straigth forward to replace the opening of the wave file with opening the stdin instead. Modify opening of wav file in src\test\tomp3.cpp to something like:
CODE
   /*
    * open the input wave file
    */
   if (strcmp(filename, "-") == 0) {
       handle = fileno(stdin);
       setmode(handle, O_BINARY);
   } else
       handle = open ( filename, O_RDONLY | O_BINARY );
   if ( handle < 0 )
   {
       printf ( "\n CANNOT_OPEN_INPUT_FILE" );
       goto abort;
   }

And similarly for the output file:
CODE
   /*
    * create the MPEG output file
    */
   if (strcmp(fileout, "-") == 0) {
       handout = fileno(stdout);
       setmode(handout, O_BINARY /* | .... ? */);
   } else
      handout =
       open ( fileout, O_RDWR | O_BINARY | O_CREAT | O_TRUNC,
              S_IREAD | S_IWRITE );
   if ( handout < 0 )
   {
       printf ( "\n CANNOT CREATE OUTPUT FILE" );
       goto abort;
   }


Add: You must also modify the CL processing:
CODE
/****** process command line args */
   for ( k = 0, i = 1; i < argc; i++ )
   {
       if ( argv[i][0] != '-' || argv[i][1] == '\0' )  // <-- add this
       {
           if ( k == 0 )
               filename = argv[i];
           if ( k == 1 )
               fileout = argv[i];
           k++;
           continue;
       }
karl_lillevold
Thanks for making these improvements and builds. Is there any chance you might consider contributing your improvements back to the Helix Community?

QUOTE (Enig123 @ Jul 18 2005, 01:09 AM)
rev6 uploaded.

-HF description added and will not take effect when bitrate/channle less than 96k or vbr_scale less than 80, as default.

-F to set lowpass frequency
*
Enig123
Karl,

I've asked CML for this. He's willing to, after some cleaning work.

All these switches are in the sourcecode already, we did no more than just finding it.

Regards,
Raffles
It seems there's a problem encoding PCM 22050khz & 11025khz files.

All other sample rates work ok from 8000khz to 48000khz.

I've tried PCM files with different bitdepths & mono/stereo settings and all is fine
except with those two sample rates, mp3enc just closes with an error.
Enig123
Nyaochi's speed test has been updated (-U2 switch tested)

http://nyaochi.sakura.ne.jp/xoops/

cli with piping has been uploaded.


@Raffles

There's nothing I and CML can do for this bug. After the latest project & source files been released, I hope someone can take a look at it and help with this kown bug.
Shade[ST]
Rev 7 is out : command line piping support added.

http://www.hydrogenaudio.org/forums/index....ndpost&p=314509
tycho
A few quirks:

1. You are trying to get the size of the stdin stream (for showing percentage). Only works for: mp3enc stdin < file.wav, but not for: cat file.wav | mp3enc stdin
In this case you'll divide by zero when computing percentage.

2. Only stdin is supported - not stdout. You should print all text output to stderr, then apply the suggested code above.

Btw: isn't it better with "-" for stdin / stdout as in most other apps (including lame)? The above code I supplied used that.

Add:
3. It is spelled "Usage", not useage. smile.gif
Enig123
tycho,

If you can do something with that, I'll be appriciated. The latest source have been uploaded. The corrected file (maby by you) can be uploaded in the same threat.

At least it can cooporate fine with foobar2000 for now. My friend CML, who did these tweaks, was not very familiar in this area and have done enough for him.
danchr
QUOTE (tycho @ Jul 18 2005, 02:26 PM)
CODE
       handle = fileno(stdin);

*

On most UNIX systems STDIN_FILENO will do the trick. I never developed on Windows, but it's probably defined there as well smile.gif
spoon
QUOTE (tycho @ Jul 19 2005, 09:25 AM)
A few quirks:

1. You are trying to get the size of the stdin stream (for showing percentage). Only works for: mp3enc stdin < file.wav, but not for: cat file.wav | mp3enc stdin
In this case you'll divide by zero when computing percentage.
*


For recording live stream over STDIO it is good to support 0 length files (ie unknown) and just keep writing until data stops.
tycho
@enig123: Sorry, I'm off on vacation, so no more time to play with this now.
@spoon: I simply meant that the display of percentage should be removed when file length is unknown.

About compiling with VC6:

I converted the VC71 proj to VC6 with http://www.codeproject.com/tools/prjconverter.asp You only need to add the main tomp3.cpp, I think.

/Edited wrong info:

Speed: You must install VC6 with SP5, and the VC6 processor pack. VC6 SP6 does not support the processor pack, which supports SSE/SSE2 and 3DNow! instruction sets. With this you'll get the same speed as with VC71.
Enig123
rev8 binary uploaded.

Changelog

1) support stdout now
2) using "-" instead of "stdin" with previous rev7

You can do test with
CODE
mp3enc - - < 001.wav > 001.mp3


Use command like
CODE
- %d -V75 -X -U2

to use with foobar2000.

@tycho
Thank for your VC6 project file (rjamorim will love this smile.gif ).

CML was kind enough to continue his tweaking with this coder. biggrin.gif
nyaochi
QUOTE (Enig123 @ Jul 19 2005, 02:10 PM)
Nyaochi's speed test has been updated (-U2 switch tested)

http://nyaochi.sakura.ne.jp/xoops/

I updated the graph in this thread. Now "gogo 3.13a -b128" and "mp3enc -V75 -X2 -U2" are tied blink.gif
guruboolez
I couldn't resist, and after some hesitations, I started the 96 kbps with the first pool dedicated to MP3. I did it on a different computer with poorer components (AC'97). Notation will therefore be less severe (poorer hardware -> less audible problems).
The choice of settings for each encoder was difficult. I tried to obtain an average bitrate comprise between 96 kbps (CBR) and 100 kbps. The tolerence is much restrictive than the ±1O% fixed for my 80 kbps test. iTunes and Fh.IIS 'Audition' are nevertheless out of range for the second group of samples (104 kbps for iTunes / 102 for Fh.IIS), but the deviation is still inferior than 10% of the targeted bitrate (96 kbps).



tested encoders

Fraunhofer, in Adobe Audition v1.5
group1 (classical) - VBR Q20 - Current: best quality - default: Joint Stereo + Intensity Stereo + 14440 Hz lowpass
group2 (various) - VBR Q30 - Current: best quality - default: Joint Stereo + Intensity Stereo + 14780 Hz lowpass

Fraunhofer, in Windows Media Player 10 (ACM PRO version, 3.3.2.44) © 2004 Fraunhofer IIS
CBR: -b128

Apple iTunes 4.9.0.19
VBR: 96 kbps Highest (default settings)

LAME 3.97 alpha 11
ABR: --abr 101

Real mp3enc V5.0 rev.6
VBR: -V20




calculated bitrate (short samples library)

CODE

• Fh.IIS 'Audition'
- classical (185 samples) = 96 kbps
- various (35 samples) = 102 kbps

• Fh.IIS 'ACM encoder'
- classical (185 samples) = 96 kbps
- various (35 samples) = 96 kbps

• iTunes
- classical (185 samples) = 100 kbps
- various (35 samples) = 104 kbps

• LAME
- classical (185 samples) = 98 kbps
- various (35 samples) = 100 kbps

• REAL
- classical (185 samples) = 100 kbps
- various (35 samples) = 100 kbps





hardware and software settings
• Compaq Presario 2100 series; AC'97 'soundcard'; poor line_out
• Philips SBC HP910 headphones
• ABC/HR software (ff123)
• files decoded with foobar2000: resampling at 48 KHz & ReplayGain track mode enabled; offset corrected for LAME and Fh.IIS ACM encodings.




tested samples
• 40 samples, including
- 15 samples of 'various music'
- 25 samples of 'classical music'
(the selection is exactly the same than for my 80 kbps listening test pools.




RESULTS


CODE

Fh.IIS Fh.IIS iTunes LAME Real
Audit. ACM PRO v.49017 3.97a11 5.0 rev.6

A02_metamorphose 3.5 2.0 1.0 3.2 2.7
E06_MODERN_CHAMB 4.2 2.0 2.3 4.2 2.5
E15_MODERN_CHAMB 2.5 2.0 4.0 5.0 2.3
E22_MODERN_ORCHE 3.4 2.0 3.8 4.2 2.8
E26_MODERN_ORCHE 2.0 1.5 3.5 4.0 3.0
E31_PERIOD_CHAMB 4.5 1.3 3.0 4.0 2.0
E40_PERIOD_CHAMB 1.8 3.0 1.5 4.0 3.5
E51_PERIOD_ORCHE 3.0 2.5 1.0 4.2 1.5
E53_PERIOD_ORCHE 2.7 2.0 1.7 3.2 2.9
S03_BOW_Cello_C 2.3 2.5 2.0 4.0 3.0
S08_BOW_Violin_B 3.5 2.0 3.0 4.2 3.5
S12_KEYBOARD_Har 2.8 2.0 2.2 2.5 1.5
S17_KEYBOARD_Org 2.0 1.5 2.5 3.7 2.5
S27_KEYBOARD_Pia 2.5 2.0 3.0 4.5 2.0
S38_PINCH_Guitar 2.0 2.5 4.0 4.3 3.5
S50_WIND_Flute_B 2.5 2.0 3.5 3.0 4.5
S54_WIND_Trombon 3.3 1.8 1.5 3.6 2.5
V02_CHORUS_Child 1.2 1.7 2.0 3.5 2.5
V07_CHORUS_Mixed 2.8 2.0 1.7 4.2 1.5
V10_DUET_Males_A 2.0 2.4 2.8 3.5 3.2
V15_PLAINCHANT_M 2.0 2.5 3.0 3.4 2.3
V19_SOLOIST_Fema 2.0 1.8 3.1 4.5 2.6
V20_SOLOIST_Fema 3.2 2.0 1.5 3.5 2.7
V24_SOLOIST_Male 3.0 2.5 2.0 3.0 2.8
V27_SOLOIST_Male 2.8 2.5 2.5 3.5 2.3

25 CLASSICAL: MEAN 2.70 2.08 2.48 3.80 2.64


41_30sec 2.3 2.0 1.0 3.0 3.0
ATrain 2.5 2.0 1.3 3.5 2.5
DaFunk 3.2 2.0 1.8 3.5 1.5
death2 2.8 2.0 1.0 2.5 2.7
EnolaGay 2.8 2.2 2.6 2.8 2.4
experiencia 3.2 2.2 3.4 3.6 2.7
getiton 2.8 1.5 2.7 3.5 2.0
kraftwerk 1.5 1.5 2.5 1.5 3.5
LifeShatters 3.5 2.5 1.5 4.0 2.0
NewYorkCity 3.5 2.2 1.5 3.5 3.0
OrdinaryWorld 3.7 2.5 2.5 4.0 1.5
Quizas 2.4 2.0 1.3 3.8 2.6
rosemary 2.5 2.0 1.5 4.0 3.5
SinceAlways 2.5 2.2 3.0 2.7 2.0
trust 3.5 2.0 1.0 4.2 1.5

15 VARIOUS SAMPLE: MEAN 2.85 2.05 1.91 3.34 2.43


40 SAMPLES: MEAN 2.76 2.07 2.27 3.63 2.56

Fh.IIS Fh.IIS iTunes LAME Real
Audit. ACM PRO v.49017 3.97a11 5.0 rev.6


CODE

FRIEDMAN version 1.24 (Jan 17, 2002) http://ff123.net/
Tukey HSD analysis

Number of listeners: 40
Critical significance: 0.05
Tukey's HSD: 0.423

Means:

LAME Fh.Aud Real iTunes Fh.acm
3.62 2.76 2.56 2.27 2.07

-------------------------- Difference Matrix --------------------------

Fh.Aud Real iTunes Fh.acm
LAME 0.870* 1.062* 1.357* 1.555*
Fh.Aud 0.193 0.488* 0.685*
Real 0.295 0.492*
iTunes 0.197
-----------------------------------------------------------------------

LAME is better than Fh.Aud, Real, iTunes, Fh.acm
Fh.Aud is better than iTunes, Fh.acm
Real is better than Fh.acm


<<< PLOTS >>>


CONCLUSIONS


• Fh.IIS 'ACM': this encoding suffers from a severe lowpass (~12KHz), the worse from all encodings tested here. For that reason, I hesitated to feature this encoder. It's very hard for me to compare different encodings when such difference in lowpass exists. This encoder is therefore the easiest to detect; comparison with reference and even with other encodings is immediately shoking. Lowpass could bring one advantage: it often limits the amount of audible distortion. But here, the ACM encoder is really far from being free of artifacts and distortions. The encoder was convincing once or twice (E40, beginning of Death2), but disappointing most of time. Once the test finished, I noticed that this encoder obtained with regularity 2.0 as notation. In one word, this encoder was maybe handicap by the excessive lowpass, and may produce better results with ~14...~15 KHz lowpass (similar value than other encoders tested here).


• Fh.IIS 'Audition': As tester, I'd say that this encoder had the most annoying VBR mode. It was impossible for me to find a unique setting in order to obtain 96...100 kbps for both groups. CBR was not a solution: lowpass would be a big handicap (~11KHz vs ~14,5KHz). That's why I decided to use two different settings: Q20 for 'various' and Q30 for 'classical'.
Average results are similar for both groups, but it's important to note the variations within the classical group. VBR encoding is often difficult at low bitrate, and rarely provide constant quality (purpose of variable bitrate). Illustration here... With the second group, results are more constant and this encoder clearly appears as one of the best MP3 encoder (with LAME).


• iTunes: highest bitrate and poorer quality... at least with the second group of sample. Quality is unlistenable to my ears, with very annoying distortions. The poor quality is maybe a consequence of the generous lowpass, probably excessive for this bitrate. Result are better with classical (encoding difficulty is also lower...).


• LAME 3.97a11: The best for both groups, and high results with classical music. It simply means that quality reached by LAME at 96 kbps is suitable on poor/average listening conditions (with some exceptions of course: bad notations on kraftwerk, SinceAlways or harpsichord), especially with classical. Another point: LAME is the only encoder which automatically resample to 32 KHz. The choice is a very pertinent one in my opinion.


• Real mp3enc V5.0 rev.6: mixed feelings for this encoder. Quality is not comparable to LAME's performance, similar but slightly inferior to Fh.IIS 'Audition' (in any case prohibitive) and also superior to iTunes of Fh.IIS 'ACM'. But if we take into consideration the encoding speed, the performances are much more enjoying. This encoder is 4 or 5 time faster than LAME, and I'm pretty sure that the quality could easily be improved by resampling the output to 32 KHz (any user could do it with foobar2000 for instance, but I recall that my test consists of testing various MP3 encoding solutions with default settings).




This MP3 pool was interesting.
- First, it reveals that Fraunhofer encoders are far from being superior to LAME at bitrate < 100 kbps. In fact, LAME is obviously better with most samples I've tested here.
- Second: iTunes reveals another time severe flaws. I know that Roberto still regrets bad choice made for his MP3 test (iTunes was tested with lower bitrate than other contenders). But here, even with few additional kbps iTunes MP3 appears as a poor encoding solution, especially with 'various music'. Obviously, iTunes MP3 doesn't need to be handicapped by wrong setting to finish last...
- Third: ultra-fast encodings doesn't necessary ruin the encoding quality. REAL (ex-XING) illustrate it. Acceptable quality is possible, even with VBR at low bitrate, even with Turbo enabled.


EDIT: many thanks to Enig123 for his work smile.gif
rjamorim
QUOTE (guruboolez @ Jul 19 2005, 12:09 PM)
- Third: ultra-fast encodings doesn't necessary ruin the encoding quality. REAL (ex-XING) illustrate it. Acceptable quality is possible, even with VBR at low bitrate, even with Turbo enabled.
*


Great. Another proof that Xing isn't as bad as people used to depict it.

Thanks for the test, Guruboolez
Enig123
I'm quite curious how far this encoder can go in the mid-high bitrate range. Especially with the hidden -HF2 -Fxxxx combination, which make it possible to encode high frequency signal (>16KHz), I wonder if it can do good to the sound quality or not.
Enig123
rev9 uploaded

many small tweaks
add -EC switch to display more information
Squeller
QUOTE (Enig123 @ Jul 19 2005, 11:30 PM)
rev9 uploaded

Enig, thanks for your effort, but would you please

a) offer urls here
b) leave the file names as they were, you name the binary "hmp3.exe" now and "mp3enc.exe" before... THX
john33
QUOTE (Squeller @ Jul 20 2005, 03:31 PM)
QUOTE (Enig123 @ Jul 19 2005, 11:30 PM)
rev9 uploaded

Enig, thanks for your effort, but would you please

a) offer urls here
b) leave the file names as they were, you name the binary "hmp3.exe" now and "mp3enc.exe" before... THX
*


It was me that changed the name of the executable simply so that it was distinguised from the 'cml' binary. If you wish to rename it, go ahead, it won't affect anything.
Enig123
There's a CML compiled binary in the rev9 bundle, which can be downloaded from http://www.hydrogenaudio.org/forums/index....showtopic=35540 .
DarkAvenger
I (easily) managed to compile the c(++) code in Linux and the bin works in a quick test. But is there an easy way to get the asm files converted to nasm style?
level
Enig123,

Many thanks for your work, this codec seems very interesting.
I found something that believe is important, and it is that the encoder eliminates some samples in the end of the file.
I noticed this problem with normal music; after I made a pure tone of 1 Khz with Cool Edit Pro (exactly 20.000 seconds) with not phase difference in both channels. After I encoded the file in -V150 -X2 setting.

I decoded the resultant mp3 file with Foobar2000 v0.8.3; and in CoolEdit Pro I eliminated the null samples in the beginning; the file didn't contain null samples in the end. The resultant decoded wav file has now 19.724 seconds.

I did the same procedure described previously but now with Winamp 5.092; the resultant decoded wav file has now 19.724 seconds; the same result that with Foobar.

Considering that Foobar and Winamp are excellent players, and, in addition, the results are the same, I believe that is a problem of the encoder, that probably may be eliminated. Lamentably, I cannot because I am not a programmer, but perhaps another person here may do it.

Regards,
Synaptic Line Noise
QUOTE (DarkAvenger @ Jul 20 2005, 01:12 PM)
I (easily) managed to compile the c(++) code in Linux and the bin works in a quick test. But is there an easy way to get the asm files converted to nasm style?
*


intel2gas, 1.3.3, A converter between the NASM and GAS asm format (Intel/AT&T)
http://freshmeat.net/projects/intel2gas/

homepage:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/
Enig123
CML's rev10

Length bug fixed, thank level


Comment: At first, I only wan't to make a compile of this encoder. Later on, it becomes work of a lot of tweaks, bug fixes and adding of new features.

So don't blame me much if I make you confused by frequent updates. I just want to help. It's another choice of available mp3 encoder with good speed. So you guys just enjoy encoding. You don't have to keep pace with all the minor updats because there's no quality improvement.
level
QUOTE (Enig123 @ Jul 20 2005, 09:39 PM)
CML's rev10
1). Length bug fixed, thank level

Yes, this works now; thanks to you smile.gif .
DarkAvenger
QUOTE (Synaptic Line Noise @ Jul 21 2005, 04:25 AM)
QUOTE (DarkAvenger @ Jul 20 2005, 01:12 PM)
I (easily) managed to compile the c(++) code in Linux and the bin works in a quick test. But is there an easy way to get the asm files converted to nasm style?
*


intel2gas, 1.3.3, A converter between the NASM and GAS asm format (Intel/AT&T)
http://freshmeat.net/projects/intel2gas/

homepage:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/
*



Maybe I haven't been too clear. I don't intend to use the inline assembler of gcc. Merely I want to use NASM, which is able to understand intel syntax. The problem is the assembler files are written for MASM (intel syntax, as well). It seems MASM uses (slightly?) different style than NASM, but as I am not a big assembler coder, I don't exactly know how to convert the files.

Converting the asm files to NASM would make the code a lot more portable (*hint* *hint*).
john33
QUOTE (DarkAvenger @ Jul 21 2005, 07:40 AM)
QUOTE (Synaptic Line Noise @ Jul 21 2005, 04:25 AM)
QUOTE (DarkAvenger @ Jul 20 2005, 01:12 PM)
I (easily) managed to compile the c(++) code in Linux and the bin works in a quick test. But is there an easy way to get the asm files converted to nasm style?
*


intel2gas, 1.3.3, A converter between the NASM and GAS asm format (Intel/AT&T)
http://freshmeat.net/projects/intel2gas/

homepage:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/
*



Maybe I haven't been too clear. I don't intend to use the inline assembler of gcc. Merely I want to use NASM, which is able to understand intel syntax. The problem is the assembler files are written for MASM (intel syntax, as well). It seems MASM uses (slightly?) different style than NASM, but as I am not a big assembler coder, I don't exactly know how to convert the files.

Converting the asm files to NASM would make the code a lot more portable (*hint* *hint*).
*


intel2gas actually works both ways, but it will only compile under **nix. There isn't a win32 binary that I could find.
john33
I believe I have found the answer to the problem regarding the encoding of 11025Hz and 22050Hz samples. The problem is in the default setting on line #204 of tomp3.cpp:
CODE
//    mpeg_select = 0;
    mpeg_select = 1;    // default to mpeg1
    XingHeadFlag = 0;

/****** process command line args */
By changing the default, as above, all sample rates seem to encode quite happily, with upsampling working as I believe was intended.
Enig123
QUOTE (john33 @ Jul 22 2005, 04:34 AM)
[/code] By changing the default, as above, all sample rates seem to encode quite happily, with upsampling working as I believe was intended.
*


Is there a way not to upsample, just output 22050/11025 Hz mp3?
danchr
With the patch below, the code compiles fine on Mac OS X using 'gcc -O3 -lstdc++ -o ../hmp3-mac -Ipub **/*.c **/*.cpp'. Didn't actually test it, though biggrin.gif

CODE
diff -Naur --exclude hmp3-mac ../helix_mp3enc_cml10/src/test/tomp3.cpp ./src/test/tomp3.cpp
--- ../helix_mp3enc_cml10/src/test/tomp3.cpp    2005-07-21 21:23:08.000000000 +0000
+++ ./src/test/tomp3.cpp    2005-07-22 03:31:22.000000000 +0000
@@ -487,7 +487,9 @@
 if(strcmp(filename,"-")==0)
 {
     handle=stdin;
+#ifdef _WIN32
     setmode( fileno( handle ), O_BINARY );
+#endif
 }
 else
     handle = fopen ( filename, "rb" );
@@ -547,7 +549,9 @@
 if(strcmp(fileout,"-")==0)
 {
     handout=stdout;
+#ifdef _WIN32
     setmode( fileno( handout ), O_BINARY );
+#endif
 }
 else
     handout = fopen ( fileout, "w+b" );
Synaptic Line Noise
I've been googling around for something you can use.

http://www.blah.ch/att2intel/
Converts ASM code in AT&T syntax (GNU Assembler) to Intel syntax (TASM, NASM & Co.).


http://membres.lycos.fr/placr/a2i.html
A2I is an utility which can translate assembly files in AT&T syntax (.S files produces by gcc for example) to NASM syntax. Dos binaries available.

http://www.bumba.net/~hmaon/a2i/
Att2Intl will convert gcc's AT&T syntax assembly output (.s) into Intel syntax (.asm), intended for compilation with NASM or Tasm.

m2nasm: A perl script that handles some of the tedious parts of masm to nasm translation. Remember to always check the output.

internet archive, newest version:
http://web.archive.org/web/20030216031517/...lf99/m2nasm.txt

# Masm to nasm translation attempt smile.gif
# still at an early stage...
# 28/06/2002, written by Alexandros Frantzis
# alf82@freemail.gr
# usage: m2nasm.pl < input_file > output_file

I haven't used any of these, hope one of them works,


Further, the first bitrate it the overall average bitrate, whereas the second bitrate is the current bitrate, correct?
Enig123
It should mean
CODE
frames: 1281,  bytes in: 5902848( 47%),  bytes out: 990509,  br 243.81 236.95

and the first br is current bitrate, second is averaged bitrate.
john33
QUOTE (Enig123 @ Jul 22 2005, 01:19 AM)
QUOTE (john33 @ Jul 22 2005, 04:34 AM)
By changing the default, as above, all sample rates seem to encode quite happily, with upsampling working as I believe was intended.
*


Is there a way not to upsample, just output 22050/11025 Hz mp3?
*


For low sample rates, it would appear that upsampling is the way the encoder is written to function.

In the file mp3enc.cpp, function MP3_audio_encode_init, lines 2691 - 2737, the encoding sample rate is determined according to 'mpeg' output type. Sample rate output below 16000Hz is not supported and input is upsampled. If the default switch is left as 0, then the 11025 input is upsampled to 22050 and is passed to the function L3_audio_encode_vbr_MPEG2. The 11025 and 22050 inputs fail in this function within the principal loop contained therein. It also fails at CBR with these sample rates.

By setting the default switch to 1 (mpeg 1 layer III), the 11025 and 22050 samples are upsampled to 44100 and processed correctly.

This is, therefore, a way of circumventing the problem, but does not resolve it.
john33
I have established that the point at which the program falls over when using the the 0 default, referred to above is in the 'window' junction in sbt.c, sbt.asm and xsbt.asm.

To illustrate, in sbt.c:
CODE
void
window ( const float vbuf[] )
{
   int i, j, k;
   const float *si, *bx;
   const float *coef;
   float sum1, sum2;

/*-- output to dct ping-pong buf b --*/
   si = vbuf + 16;
   bx = vbuf + 15;

   k = 0;
   coef = wincoef;

/*-- first 1 --*/
   sum1 = 0.0f;
   for ( j = 0; j < 512; j += 64 )
   {
fprintf(stderr, "\nHere - window - before j");
       sum1 += ( *coef++ ) * si[j];
fprintf(stderr, "\nHere - window - j = %d", j);
   }
   si++;
   b[k++] = sum1;

/*-- 16 --*/
I added the fprintfs, they're not in the code!! wink.gif

When the program is executed, the data loops through here once and on the second time through, the expression between the two fprintfs causes the crash. I fear to progress any further in this is beyond me!! wink.gif
DarkAvenger
@Synaptic Line Noise

intel2gas doesn't like the files. m2nasm doesn't do anything here and I didn't try the others as they don't state they could to opposite direction (which I need).

I found this though:

http://www.programmersheaven.com/zone5/cat461/1349.htm

WINE can't hanlde this. (16bit exe?) So could someone alse try this? And then maybe run intel2gas over the result?
Enig123
Yeah. CML have fixed the 22050 samplerate bug.

Now the latest version CML (r11 for now) be put on top of
http://www.hydrogenaudio.org/forums/index....t=0#entry313298


NOTE: This encoder only support mpeg-1&2, not 2.5, so it will never output mp3 with 11025 samplerate (22050 instead).
john33
QUOTE (Enig123 @ Jul 23 2005, 05:10 AM)
Yeah. CML have fixed the 22050 samplerate bug.

Now the latest version CML (r11 for now) be put on top of
http://www.hydrogenaudio.org/forums/index....t=0#entry313298


NOTE: This encoder only support mpeg-1&2, not 2.5, so it will never output mp3 with 11025 samplerate (22050 instead).
*

Hmmm, the bug is obvious when you look in the right place, huh?!?!? wink.gif
Enig123
QUOTE (john33 @ Jul 23 2005, 06:03 PM)
Hmmm, the bug is obvious when you look in the right place, huh?!?!? wink.gif


Nope, there's really a crash bug with 22050 samplerate. After being fixed, this encoder can output mp3 with 22050 samplerate now, which belongs to mpeg-2.

You can check the sourcecode to verify this. There's a place typing "200" as "2100" in the original code.
john33
QUOTE (Enig123 @ Jul 23 2005, 10:09 AM)
There's a place typing "200" as "2100" in the original code.
*

That's what I was referring to. wink.gif
dirkvl
As a newbie here, first let me congratulate everyone with the effort put in this coder.
It's been a ball watching everyone contribute.

Frequency analysis (cooledit) seems to show lowpass at approx 16 khz.
Can anyone confirm this as a general outcome ?
Is there an option in the code to change lowpass to something around 19-20 khz ?

Dirk.
Madrigal
QUOTE (dirkvl @ Jul 23 2005, 03:43 PM)
Is there an option in the code to change lowpass to something around 19-20 khz?
See post #51 in this thread. It would appear that the -F switch now does this.

Regards,
Madrigal
Enig123
QUOTE (dirkvl @ Jul 24 2005, 04:43 AM)
Frequency analysis (cooledit) seems to show lowpass at approx 16 khz.
Can anyone confirm this as a general outcome ?
Is there an option in the code to change lowpass to something around 19-20 khz ?

Dirk.
*


Yeah. With -B >= 96 and -V >= 80, you can use -HF -F19000 or -HF2 -F19000 to achieve 19000 Hz lowpass.
dirkvl
Thanx guys. This setting just made my day.

Dirk.
Synaptic Line Noise
I've added this post as a separate post here.

With this encoder, it's not very clear which number is what, in the progress text.

Please patch the program. I now know what what it's saying, but everytime I look at it still takes awhile to read it.
CODE
frames   1281 bytes in  5902848( 47%)  bytes out   990509 br 243.81 236.95

This looks like "1281 bytes in" "5902848( 47%) bytes out "

Please add a LAME style progress text.

CODE
   Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
  150/302    (50%)|    0:05/    0:10|    0:05/    0:10|   0.7506x|    0:05
-------------------------------------00:03-------------------------------------
  kbps        LR    MS  %     long  %
  64.0       27.3  72.7       100.0


Especially since now we are just making cosmetic/interface changes.
Also in the latest ICL9 compile, doing a
"hmp3enc -help | more" command doesn't work anymore.
Similar to here:
http://www.hydrogenaudio.org/forums/lofive...php/t30160.html
john33
How does:
CODE
 Frame/Bytes Processed |Bytes Written|Current Bitrate|Average Bitrate
---------------------------------------------------------------------
 14184/65319788  (100%)|   7080630   |   31.85kbps   |   152.89kbps

Compression Ratio 9.23:1
Elapsed time =    8.046secs       Time per frame =    0.567msecs
grab you?
ak
QUOTE (Synaptic Line Noise @ Jul 25 2005, 09:14 PM)
"hmp3enc -help | more" command doesn't work anymore.

If it sends it to stderr, you can usually do it like this:
> hmp3enc -help 2>&1 | more
kindofblue
n00b alert: I'm kind of lost in all this code. Can someone post a good commandline for VBR ~80kbps and ~128kbps?

thanks in advance
kindofblue
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.