On Mon, Sep 5, 2016 at 2:54 PM, Luca Barbato <[email protected]> wrote:
> ---
>
> Consider that tentative since I have a plane to take, testing welcome :)
>
>  libavcodec/libvpx.c    |  6 ++++++
>  libavcodec/libvpxenc.c | 12 ++++++++++++
>  2 files changed, 18 insertions(+)
>
> diff --git a/libavcodec/libvpx.c b/libavcodec/libvpx.c
> index c65f80d..98cae0b 100644
> --- a/libavcodec/libvpx.c
> +++ b/libavcodec/libvpx.c
> @@ -88,8 +88,14 @@ vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat 
> pix)
>      case AV_PIX_FMT_YUVA444P:     return VPX_IMG_FMT_444A;
>  #if VPX_IMAGE_ABI_VERSION >= 3
>      case AV_PIX_FMT_YUV440P:      return VPX_IMG_FMT_I440;
> +    case AV_PIX_FMT_YUV420P9:
> +    case AV_PIX_FMT_YUV420P10:
>      case AV_PIX_FMT_YUV420P16BE:  return VPX_IMG_FMT_I42016;
> +    case AV_PIX_FMT_YUV422P9:
> +    case AV_PIX_FMT_YUV422P10:
>      case AV_PIX_FMT_YUV422P16BE:  return VPX_IMG_FMT_I42216;
> +    case AV_PIX_FMT_YUV444P9:
> +    case AV_PIX_FMT_YUV444P10:
>      case AV_PIX_FMT_YUV444P16BE:  return VPX_IMG_FMT_I44416;
>  #endif
>      default:                      return VPX_IMG_FMT_NONE;
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index bb4c98f..541be5d 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -35,6 +35,7 @@
>  #include "libavutil/common.h"
>  #include "libavutil/mathematics.h"
>  #include "libavutil/opt.h"
> +#include "libavutil/pixdesc.h"
>
>  /**
>   * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h.
> @@ -561,6 +562,12 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>              rawimg->range = VPX_CR_FULL_RANGE;
>              break;
>          }
> +        {
> +            const AVPixFmtDescriptor *desc = 
> av_pix_fmt_desc_get(frame->format);
> +            if (desc) {
> +                rawimg->bit_depth = av_get_bits_per_pixel(desc);

i'd fail with _BUG if !desc

seems ok if tested

> +            }
> +        }
>  #endif
>          if (frame->pict_type == AV_PICTURE_TYPE_I)
>              flags |= VPX_EFLAG_FORCE_KF;
> @@ -699,6 +706,11 @@ AVCodec ff_libvpx_vp9_encoder = {
>          AV_PIX_FMT_YUV444P,
>          AV_PIX_FMT_YUV440P,
>  #endif
> +#if VPX_IMAGE_ABI_VERSION >= 4
> +        AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P16BE,
> +        AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P16BE,
> +        AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P16BE,
> +#endif
>          AV_PIX_FMT_NONE,
>      },
>      .profiles       = NULL_IF_CONFIG_SMALL(profiles),
> --
> 2.9.2
>
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel



-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to