[FFmpeg-devel] Patch for High color and High bit-depth support

James Zern jzern at google.com
Sat Apr 18 22:06:52 CEST 2015


On Thu, Apr 16, 2015 at 6:19 PM, Debargha Mukherjee <debargha at google.com> wrote:
> Resolutions inline...
>
> From d84e140ed83bdc3889720e4a6af330198176b839 Mon Sep 17 00:00:00 2001
> From: Deb Mukherjee <debargha at google.com>
> Date: Wed, 25 Mar 2015 17:10:16 -0700
> Subject: [PATCH] Support for VP9 high-color/high-bit-depth encoding
>
> Patch to support VP9 encoding with new profiles 1-3.
> Profile 1 (8-bit 422/444) should work with default libvpx
> configuration.
> However you will need to configure libvpx with
> --enable-vp9-highbitdepth before building and linking
> with ffmpeg for profile 2 (10-/12-bit 420) and profile 3
> (10-/12-bit 422/444) encoding.
>
> You may use the appropriate profile option on the
> command line:
> -profile:v 1 for 422/444 8-bit encoding
> -profile:v 2 for 420 10-/12- bit encoding
> -profile:v 3 for 422/444 10-/12-bit encoding
> If you do not use the -profile:v option, it will be deduced
> from the source format.
> ---
>  libavcodec/libvpx.c    | 47 +++++++++++++++++++++++++++-
>  libavcodec/libvpxenc.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 129 insertions(+), 3 deletions(-)
>

lgtm.

> diff --git a/libavcodec/libvpx.c b/libavcodec/libvpx.c
> index 5d29893..b432fe9 100644
> --- a/libavcodec/libvpx.c
> +++ b/libavcodec/libvpx.c
> @@ -19,12 +19,57 @@
>   */
>
>  #include <vpx/vpx_codec.h>
> -
>  #include "libvpx.h"
> +#include "config.h"
> +
> +#if CONFIG_LIBVPX_VP9_ENCODER
> +#include <vpx/vpx_encoder.h>
> +#include <vpx/vp8cx.h>
> +#endif
> +
> +static const enum AVPixelFormat vp9_pix_fmts_def[] = {
> +    AV_PIX_FMT_YUV420P,
> +    AV_PIX_FMT_NONE
> +};
> +
> +#if CONFIG_LIBVPX_VP9_ENCODER
> +static const enum AVPixelFormat vp9_pix_fmts_highcol[] = {
> +    AV_PIX_FMT_YUV420P,
> +    AV_PIX_FMT_YUV422P,
> +    AV_PIX_FMT_YUV444P,
> +    AV_PIX_FMT_NONE
> +};
> +
> +static const enum AVPixelFormat vp9_pix_fmts_highbd[] = {
>

This one is only used when VPX_CODEC_CAP_HIGHBITDEPTH is defined, but I think
that's available in most cases with vp9 so should be all right.


More information about the ffmpeg-devel mailing list