You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When encoding a 32khz WAV at a bitrate of 48kbps, shine generates a frame header of FF FB 3A C4 instead of the expected FF FB 38 C4; the padding bit is incorrectly being set.
It seems to narrow down to non-associativity of the floating-point calculation of avg_slots_per_frame in layer3.c. The calculation with samplerate=32000 and bitr=48 gives a double of 215.999999999999972... which consequently truncates incorrectly to 215.
Setting whole_slots_per_frame by first truncating to a float before converting to an int:
seems to work now and various other WAV files still convert properly. May not be the best solution however as floating point errors may still occur elsewhere.
The text was updated successfully, but these errors were encountered:
When encoding a 32khz WAV at a bitrate of 48kbps, shine generates a frame header of
FF FB 3A C4
instead of the expectedFF FB 38 C4
; the padding bit is incorrectly being set.It seems to narrow down to non-associativity of the floating-point calculation of
avg_slots_per_frame
inlayer3.c
. The calculation withsamplerate=32000
andbitr=48
gives a double of 215.999999999999972... which consequently truncates incorrectly to 215.Setting
whole_slots_per_frame
by first truncating to a float before converting to an int:config->mpeg.whole_slots_per_frame = (int)(float)avg_slots_per_frame;
seems to work now and various other WAV files still convert properly. May not be the best solution however as floating point errors may still occur elsewhere.
The text was updated successfully, but these errors were encountered: