Re: Resurrecting/Preserving the Helix MP3 encoder
Reply #528 – 2024-05-19 10:16:28
My best guess right now is that there's some kind of memory corruption going on. Float is twice as big as short, so the encoder falling apart in various places (mostly when accessing lookup tables) might indicate that resampling is trampling over memory somewhere. C be like that. Lame is a completely different (and more readable, IMO) code base and I don't expect to find something there that applies to the Helix MP3 encoder. It's theoretically possible to replace the resampler, but one needs to be careful about licensing. The Helix MP3 Encoder has a very exotic open-source license, which *is* recognized as Free Software license, but it makes it quite a bit more complicated to figure out what other code can be legally mixed in. edit: Some more digging in, when resampling 44100 to 32000, the resampler can produce vastly "out of bounds" values... just ploppin in a 'printf("u: %f v: %f\n", u, v);' into Csrc::src_filter_dual_case4 shows that output values can be completely out of whack...u: -10339643495273183456589268008304640.000000 v: -0.000000 u: 407311519258318227550806361505792.000000 v: 0.000000 u: 9921843064804505112641775729639424.000000 v: 0.000000 u: 1551401312512909985066881267007488.000000 v: 0.000000 u: 35341039057689407428212771715547136.000000 v: 0.000000 u: -85764139298480145538534354483937280.000000 v: -0.000000 u: 682444216638130611362993002619338752.000000 v: 0.000000 u: 358179272327912044724473916228108288.000000 v: 0.000000 u: -165015089812987648412178647898652672.000000 v: -0.000000 u: 75186501211684328081405592394006528.000000 v: 0.000000 u: -16369631476501701137608916066107392.000000 v: -0.000000 u: 42112486892657766126052288080379904.000000 v: 0.000000 u: -6317488413892193681442495566708736.000000 v: -0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: -0.000000 v: -0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: -nan u: -nan v: 0.000024 u: -nan v: -0.000036 u: 0.000000 v: -0.000000 u: -0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 u: 0.000000 v: 0.000000 (and yeah, my insane C debugging skills mostly are printf-based... ewww...)