Commit acca56d9 authored by Vignesh Venkatasubramanian's avatar Vignesh Venkatasubramanian Committed by James Zern

libvpx: Enable vp9 alpha encoding

Chrome canary now supports decoding of VP9 streams with alpha
channel [1]. Add support to ffmpeg for creating such files.

[1] https://codereview.chromium.org/2096813002/Reviewed-by: 's avatarJames Zern <jzern@google.com>
Signed-off-by: 's avatarVignesh Venkatasubramanian <vigneshv@google.com>
parent 7af44ce2
...@@ -29,12 +29,14 @@ ...@@ -29,12 +29,14 @@
static const enum AVPixelFormat vp9_pix_fmts_def[] = { static const enum AVPixelFormat vp9_pix_fmts_def[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_NONE AV_PIX_FMT_NONE
}; };
#if CONFIG_LIBVPX_VP9_ENCODER #if CONFIG_LIBVPX_VP9_ENCODER
static const enum AVPixelFormat vp9_pix_fmts_highcol[] = { static const enum AVPixelFormat vp9_pix_fmts_highcol[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P,
...@@ -46,6 +48,7 @@ static const enum AVPixelFormat vp9_pix_fmts_highcol[] = { ...@@ -46,6 +48,7 @@ static const enum AVPixelFormat vp9_pix_fmts_highcol[] = {
static const enum AVPixelFormat vp9_pix_fmts_highbd[] = { static const enum AVPixelFormat vp9_pix_fmts_highbd[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P,
......
...@@ -284,6 +284,7 @@ static int set_pix_fmt(AVCodecContext *avctx, vpx_codec_caps_t codec_caps, ...@@ -284,6 +284,7 @@ static int set_pix_fmt(AVCodecContext *avctx, vpx_codec_caps_t codec_caps,
#endif #endif
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUVA420P:
enccfg->g_profile = 0; enccfg->g_profile = 0;
*img_fmt = VPX_IMG_FMT_I420; *img_fmt = VPX_IMG_FMT_I420;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment