[FFmpeg-devel] [PATCH] Change libvpx-vpx default to crf=32.

James Zern jzern at google.com
Wed Sep 4 19:46:25 EEST 2019


Hi,

On Wed, Aug 28, 2019 at 2:26 PM Elliott Karpilovsky
<elliottk-at-google.com at ffmpeg.org> wrote:
>
> Current default is 200kbps, which produces inconsistent
> results (too high for low-res, too low for hi-res). Use
> CRF instead, which will adapt. Affects vp8/vp9. Also
> have VP8 use a default bitrate of 256kbps.
> ---
>  libavcodec/libvpxenc.c | 71 +++++++++++++++++++++++++++++++++++-------
>  libavcodec/version.h   |  2 +-
>  2 files changed, 61 insertions(+), 12 deletions(-)
>

Some cosmetics, seems to work as expected with tip of tree and v1.4.0.

> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index feb52ea0dd..42504ab95e 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -510,6 +510,63 @@ static void set_color_range(AVCodecContext *avctx)
>  #endif
>  #endif
>
> +/**
> + * Set the target bitrate to VPX library default. Also set CRF to 32 if needed.
> + */
> +static void set_vp8_defaults(AVCodecContext *avctx,
> +                             struct vpx_codec_enc_cfg *enccfg) {

Indent should be 4 and the brace for a function on a new line [1].

> [...]
> +
> +/**
> + * Called when the bitrate is not set. It sets appropriate default values for
> + * bit-rate and CRF.

'bitrate' is more common in this file.

> [...]
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index e70ebc0c70..cda6dbae47 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -29,7 +29,7 @@
>
>  #define LIBAVCODEC_VERSION_MAJOR  58
>  #define LIBAVCODEC_VERSION_MINOR  55
> -#define LIBAVCODEC_VERSION_MICRO 101
> +#define LIBAVCODEC_VERSION_MICRO 102
>

This no longer applies cleanly.

[1] http://ffmpeg.org/developer.html#Code-formatting-conventions


More information about the ffmpeg-devel mailing list