On 7/24/2016 4:17 PM, Luca Barbato wrote:
> Encoding support not added on purpose for now
> ---
>  configure              |   4 ++
>  libavcodec/Makefile    |   1 +
>  libavcodec/allcodecs.c |   1 +
>  libavcodec/libaom.c    |  79 +++++++++++++++++++++++++++
>  libavcodec/libaom.h    |  31 +++++++++++
>  libavcodec/libaomdec.c | 141 
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 257 insertions(+)
>  create mode 100644 libavcodec/libaom.c
>  create mode 100644 libavcodec/libaom.h
>  create mode 100644 libavcodec/libaomdec.c
> 
> diff --git a/configure b/configure
> index f12fa6f..20dddbf 100755
> --- a/configure
> +++ b/configure
> @@ -188,6 +188,7 @@ External library support:
>    --enable-bzlib             bzip2 compression [autodetect]
>    --enable-frei0r            video filtering plugins
>    --enable-gnutls            crypto
> +  --enable-libaom            AV1 video encoding/decoding
>    --enable-libbs2b           Bauer stereophonic-to-binaural DSP
>    --enable-libcdio           audio CD input
>    --enable-libdc1394         IEEE 1394/Firewire camera input
> @@ -1238,6 +1239,7 @@ EXTERNAL_LIBRARY_LIST="
>      bzlib
>      frei0r
>      gnutls
> +    libaom
>      libbs2b
>      libcdio
>      libdc1394
> @@ -2218,6 +2220,7 @@ vc1_parser_select="vc1dsp"
>  mjpeg2jpeg_bsf_select="jpegtables"
>  
>  # external libraries
> +libaom_av1_decoder_deps="libaom"
>  libdcadec_decoder_deps="libdcadec"
>  libfaac_encoder_deps="libfaac"
>  libfaac_encoder_select="audio_frame_queue"
> @@ -4577,6 +4580,7 @@ enabled avisynth          && { check_lib2 
> "avisynth/avisynth_c.h windows.h" Load
>  enabled cuda              && check_lib cuda.h cuInit -lcuda
>  enabled frei0r            && { check_header frei0r.h || die "ERROR: frei0r.h 
> header not found"; }
>  enabled gnutls            && require_pkg_config gnutls gnutls/gnutls.h 
> gnutls_global_init
> +enabled libaom            && require_pkg_config "aom >= 0.1.0" 
> aom/aom_codec.h aom_codec_version
>  enabled libbs2b           && require_pkg_config libbs2b bs2b.h bs2b_open
>  enabled libdcadec         && require libdcadec libdcadec/dca_context.h 
> dcadec_context_create -ldcadec
>  enabled libfaac           && require2 libfaac "stdint.h faac.h" 
> faacEncGetVersion -lfaac
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 8eb7d36..09f9c82 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -653,6 +653,7 @@ OBJS-$(CONFIG_TAK_DEMUXER)             += tak.o
>  OBJS-$(CONFIG_WEBM_MUXER)              += mpeg4audio.o
>  
>  # external codec libraries
> +OBJS-$(CONFIG_LIBAOM_AV1_DECODER)         += libaomdec.o libaom.o
>  OBJS-$(CONFIG_LIBDCADEC_DECODER)          += libdcadec.o dca.o
>  OBJS-$(CONFIG_LIBFAAC_ENCODER)            += libfaac.o
>  OBJS-$(CONFIG_LIBFDK_AAC_DECODER)         += libfdk-aacdec.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index e259de2..e3ccd55 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -458,6 +458,7 @@ void avcodec_register_all(void)
>      REGISTER_ENCDEC (XSUB,              xsub);
>  
>      /* external libraries */
> +    REGISTER_DECODER(LIBAOM_AV1,        libaom_av1);

Why not just libaom, like every other external module? It's a
single codec after all.

>      REGISTER_DECODER(LIBDCADEC,         libdcadec)
>      REGISTER_ENCODER(LIBFAAC,           libfaac);
>      REGISTER_ENCDEC (LIBFDK_AAC,        libfdk_aac);
> diff --git a/libavcodec/libaom.c b/libavcodec/libaom.c
> new file mode 100644
> index 0000000..425251a
> --- /dev/null
> +++ b/libavcodec/libaom.c
> @@ -0,0 +1,79 @@
> +/*
> + * Copyright (c) 2013 Guillaume Martres <smar...@ubuntu.com>
> + *
> + * This file is part of Libav.
> + *
> + * Libav is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * Libav is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with Libav; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +#include <aom/aom_image.h>
> +
> +#include "libaom.h"
> +
> +enum AVPixelFormat ff_aom_imgfmt_to_pixfmt(aom_img_fmt_t img)
> +{
> +    switch (img) {
> +    case AOM_IMG_FMT_RGB24:     return AV_PIX_FMT_RGB24;
> +    case AOM_IMG_FMT_RGB565:    return AV_PIX_FMT_RGB565BE;
> +    case AOM_IMG_FMT_RGB555:    return AV_PIX_FMT_RGB555BE;
> +    case AOM_IMG_FMT_UYVY:      return AV_PIX_FMT_UYVY422;
> +    case AOM_IMG_FMT_YUY2:      return AV_PIX_FMT_YUYV422;
> +    case AOM_IMG_FMT_YVYU:      return AV_PIX_FMT_YVYU422;
> +    case AOM_IMG_FMT_BGR24:     return AV_PIX_FMT_BGR24;
> +    case AOM_IMG_FMT_ARGB:      return AV_PIX_FMT_ARGB;
> +    case AOM_IMG_FMT_ARGB_LE:   return AV_PIX_FMT_BGRA;
> +    case AOM_IMG_FMT_RGB565_LE: return AV_PIX_FMT_RGB565LE;
> +    case AOM_IMG_FMT_RGB555_LE: return AV_PIX_FMT_RGB555LE;
> +    case AOM_IMG_FMT_I420:      return AV_PIX_FMT_YUV420P;
> +    case AOM_IMG_FMT_I422:      return AV_PIX_FMT_YUV422P;
> +    case AOM_IMG_FMT_I444:      return AV_PIX_FMT_YUV444P;
> +    case AOM_IMG_FMT_444A:      return AV_PIX_FMT_YUVA444P;
> +#if AOM_IMAGE_ABI_VERSION >= 3

Remove this and every other similar pre-processor check as they
are not needed. AOM_IMAGE_ABI_VERSION has been 4 since the commit
where aom_image.h was renamed from vpx_image.h

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to