[FFmpeg-devel] [PATCH 2/2] avcodec/vorbisenc: Apply dynamic frame lengths

Moritz Barsnick barsnick at gmx.net
Thu Jul 13 16:50:13 EEST 2017


On Wed, Jul 12, 2017 at 16:18:20 -0600, Tyler Jones wrote:
> -    int window_len = 1 << (venc->log2_blocksize[1] - 1);
> -    float n = (float)(1 << venc->log2_blocksize[1]) / 4.0;
> +    int prev_size, curr_size, next_size, bound;
> +    float scale = 1. / (float) (1 << venc->log2_blocksize[blockflags[1]] - 2);

The "1." is a double, which promotes the calculation to a double
precision operation, which is most likely not intended. Please restrict
it to a float operation by using "1.0f". (I realize the original code
had the same issue.)

Moritz


More information about the ffmpeg-devel mailing list