*/
/**
- * @file libavcodec/vorbis_enc.c
+ * @file
* Native Vorbis encoder.
* @author Oded Shimon <ods15@ods15.dyndns.org>
*/
float average = averages[i];
int j;
- average *= pow(tot_average / average, 0.5) * pow(1.25, position/200.); // MAGIC!
+ average = sqrt(tot_average * average) * pow(1.25f, position*0.005f); // MAGIC!
for (j = 0; j < range - 1; j++)
if (ff_vorbis_floor1_inverse_db_table[j * fc->multiplier] > average)
break;
float * offset = venc->samples + channel*window_len*2 + window_len;
j = channel;
for (i = 0; i < samples; i++, j += venc->channels)
- offset[i] = -audio[j] / 32768. / n * win[window_len - i - 1]; //FIXME find out why the sign has to be fliped
+ offset[i] = audio[j] / 32768. / n * win[window_len - i - 1];
}
} else {
for (channel = 0; channel < venc->channels; channel++)
float *offset = venc->saved + channel * window_len;
j = channel;
for (i = 0; i < samples; i++, j += venc->channels)
- offset[i] = -audio[j] / 32768. / n * win[i]; //FIXME find out why the sign has to be fliped
+ offset[i] = audio[j] / 32768. / n * win[i];
}
venc->have_saved = 1;
} else {
if (avccontext->flags & CODEC_FLAG_QSCALE)
venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;
else
- venc->quality = 1.;
+ venc->quality = 0.03;
venc->quality *= venc->quality;
avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);
AVCodec vorbis_encoder = {
"vorbis",
- CODEC_TYPE_AUDIO,
+ AVMEDIA_TYPE_AUDIO,
CODEC_ID_VORBIS,
sizeof(vorbis_enc_context),
vorbis_encode_init,
vorbis_encode_frame,
vorbis_encode_close,
- .capabilities= CODEC_CAP_DELAY,
+ .capabilities= CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
};