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

Maximilian Seesslen mes at seesslen.net
Fri Jan 4 17:01:29 CET 2013


Am Freitag, 4. Januar 2013, 16:25:40 schrieb Clément Bœsch:
> 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.
> 
> [...]
Oh, i must have been blind.
Fixed patch attached.

Best regards,
   Max

--
Max S.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fixed-granularity-of-video-quality-when-encoding-wit.patch
Type: text/x-patch
Size: 1121 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130104/502307eb/attachment.bin>


More information about the ffmpeg-devel mailing list