[FFmpeg-devel] [PATCH] fixed granularity of video quality when encoding with theora codec

Clément Bœsch ubitux at gmail.com
Fri Jan 4 16:25:40 CET 2013


On Fri, Jan 04, 2013 at 04:18:11PM +0100, Maximilian Seesslen wrote:
> A floating point version of av_clip has to be used when converting the quality level.
> 
> Signed-off-by: Maximilian Seesslen <mes at seesslen.net>
> ---
>  libavcodec/libtheoraenc.c |    2 +-
>  libavutil/common.h        |   14 ++++++++++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
> index 1419723..350ac67 100644
> --- a/libavcodec/libtheoraenc.c
> +++ b/libavcodec/libtheoraenc.c
> @@ -212,7 +212,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_fclip(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;

We have av_clipf() already.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130104/4a1595f5/attachment.asc>


More information about the ffmpeg-devel mailing list