libtheoraenc: fix granularity of video quality
authorMaximilian Seesslen <mes@seesslen.net>
Fri, 4 Jan 2013 15:56:00 +0000 (16:56 +0100)
committerMartin Storsjö <martin@martin.st>
Mon, 14 Jan 2013 18:47:27 +0000 (20:47 +0200)
The floating point version of av_clip has to be used when
converting the quality level.

Signed-off-by: Maximilian Seesslen <mes@seesslen.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/libtheoraenc.c

index f20fabb..3990692 100644 (file)
@@ -207,7 +207,7 @@ static av_cold int encode_init(AVCodecContext* avc_context)
                 * 0 <= p <=63
                 * an int value
          */
-        t_info.quality        = av_clip(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;
+        t_info.quality        = av_clipf(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;
         t_info.target_bitrate = 0;
     } else {
         t_info.target_bitrate = avc_context->bit_rate;