Unnecessary calculations
"George Kotorlis" <[email protected]>
| Newsgroups | gmane.comp.audio.mp3.lame |
|---|---|
| Organization | ThinkMeta Software UG |
| Message-ID | <[email protected]> |
Hi,
while analyzing the LAME code I've found that the encoder makes some
unnecessary calculations:
1. In "lame_encode_mp3_frame" the variable "FLOAT tot_ener[2][4]" is useful
only in joint-stereo mode but the values are always calculated. And, if in
joint-stereo mode, tot_ener[][0] and tot_ener[][1] are never used.
Code from encoder.c:
if (cfg->mode == JOINT_STEREO) {
ms_ener_ratio[gr] = tot_ener[gr][2] + tot_ener[gr][3];
if (ms_ener_ratio[gr] > 0)
ms_ener_ratio[gr] = tot_ener[gr][3] / ms_ener_ratio[gr];
}
2. In several functions of quantize.c the member
"QntStateVar_t::masking_lower" is set in a nested gr/ch loop. Since the
member is only used in psymodel.c the only useful assignment is done in the
very last iteration. All prior assignments are overwritten.
This leads to the question about what's so special about the _right_ channel
for the next psy model step...
Another issue with this member is that it is reset after every encoded frame
to 1.0 if the signal is analyzed and plotted...
George
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/