[Ffmpeg-cvslog] r6507 - trunk/libavcodec/vorbis_enc.c
ods15
subversion
Mon Oct 2 08:09:26 CEST 2006
Author: ods15
Date: Mon Oct 2 08:09:24 2006
New Revision: 6507
Modified:
trunk/libavcodec/vorbis_enc.c
Log:
Original Commit: r103 | ods15 | 2006-10-01 18:00:43 +0200 (Sun, 01 Oct 2006) | 2 lines
slight optimization, don't calculate average twice
Modified: trunk/libavcodec/vorbis_enc.c
==============================================================================
--- trunk/libavcodec/vorbis_enc.c (original)
+++ trunk/libavcodec/vorbis_enc.c Mon Oct 2 08:09:24 2006
@@ -1116,13 +1116,14 @@
int range = 255 / fc->multiplier + 1;
int i;
float tot_average = 0.;
- for (i = 0; i < fc->values; i++) tot_average += get_floor_average(fc, coeffs, i);
+ float averages[fc->values];
+ for (i = 0; i < fc->values; i++) tot_average += averages[i] = get_floor_average(fc, coeffs, i);
tot_average /= fc->values;
tot_average /= venc->quality;
for (i = 0; i < fc->values; i++) {
int position = fc->list[fc->list[i].sort].x;
- float average = get_floor_average(fc, coeffs, i);
+ float average = averages[i];
int j;
average /= pow(average, 0.5) / tot_average * pow(0.8, position/200.); // MAGIC!
More information about the ffmpeg-cvslog
mailing list