[FFmpeg-devel] [PATCH] libvpx: Disable frame dropping as rate control method

Michael Niedermayer michaelni
Sun Jun 6 23:11:15 CEST 2010


On Sun, Jun 06, 2010 at 11:31:26PM +0300, Martin Storsj? wrote:
> Hi,
> 
> libvpx has the feature of dropping frames as a rate control method, 
> enabled by default:
> 
>   * Temporal resampling allows the codec to "drop" frames as a strategy to
>   * meet its target data rate. This can cause temporal discontinuities in
>   * the encoded video, which may appear as stuttering during playback. This
>   * trade-off is often acceptable, but for many applications is not. It can
>   * be disabled in these cases.
> 
> I'm not particularly fond of this feature, I'd much rather get a bitrate 
> slightly too high compared to suddenly getting half the framerate. The 
> attached patch disables this in the libvpx wrapper - is this ok as 
> default, or should it be changeable through some AVCodecContext field?
> 
> // Martin
>  libvpxenc.c |    1 +
>  1 file changed, 1 insertion(+)
> 2e549024a0953c946f20da0379b4f7e1cde99131  0001-libvpx-Disable-frame-dropping-as-rate-control-method.patch
> From 02cf305dde17a792c584d6b645a49bc9f2a240c6 Mon Sep 17 00:00:00 2001
> From: Martin Storsjo <martin at martin.st>
> Date: Sun, 6 Jun 2010 23:27:17 +0300
> Subject: [PATCH] libvpx: Disable frame dropping as rate control method
> 
> ---
>  libavcodec/libvpxenc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index fa393b8..bdbaaf5 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -240,6 +240,7 @@ static av_cold int vp8_init(AVCodecContext *avctx)
>      //convert [1,51] -> [0,63]
>      enccfg.rc_min_quantizer = ((avctx->qmin * 5 + 1) >> 2) - 1;
>      enccfg.rc_max_quantizer = ((avctx->qmax * 5 + 1) >> 2) - 1;
> +    enccfg.rc_dropframe_thresh = 0;

should be set based on AVCodecContext.frame_skip*

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100606/c3e55a97/attachment.pgp>



More information about the ffmpeg-devel mailing list