[vlc-devel] [PATCH v2 3/3] codec: add a dav1d AV1 decoder module

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 9 08:18:57 CET 2018


On 08/11/2018 17:31, Tristan Matthews wrote:
> Hi,
>
> On Thu, Nov 8, 2018 at 10:46 AM Steve Lhomme <robux4 at ycbcr.xyz> wrote:
>> From: Adrien Maglo <magsoft at videolan.org>
>>
>> It is using the picture callback API so there's is no copy on output of the decoder.
>>
>> Co-authored-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
>> Co-authored-by: Steve Lhomme <robux4 at ycbcr.xyz>
>> ---
>>   configure.ac              |   5 +
>>   modules/codec/Makefile.am |   8 +
>>   modules/codec/dav1d.c     | 321 ++++++++++++++++++++++++++++++++++++++
>>   3 files changed, 334 insertions(+)
>>   create mode 100644 modules/codec/dav1d.c
>>
>> diff --git a/configure.ac b/configure.ac
>> index fa093bbee3..6e28431d81 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -2622,6 +2622,11 @@ dnl  AOM decoder plugin
>>   dnl
>>   PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
>>
>> +dnl
>> +dnl  Dav1d decoder plugin
>> +dnl
>> +PKG_ENABLE_MODULES_VLC([DAV1D], [], [dav1d], [AV1 decoder (default auto)])
>> +
>>   dnl
>>   dnl libvpx decoder plugin
>>   dnl
>> diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
>> index 4dc2e498d2..760141d1f4 100644
>> --- a/modules/codec/Makefile.am
>> +++ b/modules/codec/Makefile.am
>> @@ -580,6 +580,14 @@ libtwolame_plugin_la_LIBADD = $(TWOLAME_LIBS) $(LIBM)
>>   EXTRA_LTLIBRARIES += libtwolame_plugin.la
>>   codec_LTLIBRARIES += $(LTLIBtwolame)
>>
>> +libdav1d_plugin_la_SOURCES = codec/dav1d.c
>> +libdav1d_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(DAV1D_CFLAGS)
>> +libdav1d_plugin_la_CFLAGS = $(AM_CFLAGS)
>> +libdav1d_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
>> +libdav1d_plugin_la_LIBADD = $(DAV1D_LIBS)
>> +EXTRA_LTLIBRARIES += libdav1d_plugin.la
>> +codec_LTLIBRARIES += $(LTLIBdav1d)
>> +
>>
>>   ### Hardware encoders ###
>>
>> diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
>> new file mode 100644
>> index 0000000000..a563e1a90b
>> --- /dev/null
>> +++ b/modules/codec/dav1d.c
>> @@ -0,0 +1,321 @@
>> +/*****************************************************************************
>> + * dav1d.c: dav1d decoder (AV1) module
>> + *****************************************************************************
>> + * Copyright (C) 2016 VLC authors and VideoLAN
>> + *
>> + * Authors: Adrien Maglo <magsoft at videolan.org>
>> + * Based on aom.c by: Tristan Matthews <tmatth at videolan.org>
>> + *
>> + * This program 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.
>> + *
>> + * This program 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 this program; if not, write to the Free Software Foundation,
>> + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
>> + *****************************************************************************/
>> +
>> +/*****************************************************************************
>> + * Preamble
>> + *****************************************************************************/
>> +#ifdef HAVE_CONFIG_H
>> +# include "config.h"
>> +#endif
>> +
>> +#include <errno.h>
>> +
>> +#include <vlc_common.h>
>> +#include <vlc_plugin.h>
>> +#include <vlc_codec.h>
>> +#include <vlc_timestamp_helper.h>
>> +
>> +#include <dav1d/dav1d.h>
>> +
>> +#include "../packetizer/iso_color_tables.h"
>> +
>> +/****************************************************************************
>> + * Local prototypes
>> + ****************************************************************************/
>> +static int OpenDecoder(vlc_object_t *);
>> +static void CloseDecoder(vlc_object_t *);
>> +
>> +/*****************************************************************************
>> + * Module descriptor
>> + *****************************************************************************/
>> +
>> +#define THREAD_FRAMES_TEXT N_("Frames Threads")
>> +#define THREAD_FRAMES_LONGTEXT N_( "Max number of threads used for frame decoding, default 0=auto" )
>> +#define THREAD_TILES_TEXT N_("Tiles Threads")
>> +#define THREAD_TILES_LONGTEXT N_( "Max number of threads used for tile decoding, default 0=auto" )
>> +
>> +
>> +vlc_module_begin ()
>> +    set_shortname("dav1d")
>> +    set_description(N_("Dav1d video decoder"))
>> +    set_capability("video decoder", 10000)
>> +    set_callbacks(OpenDecoder, CloseDecoder)
>> +    set_category(CAT_INPUT)
>> +    set_subcategory(SUBCAT_INPUT_VCODEC)
>> +
>> +    add_integer("dav1d-thread-frames", 0,
>> +                THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
>> +    add_integer("dav1d-thread-tiles", 0,
>> +                THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
>> +vlc_module_end ()
>> +
>> +#define AOM_ERR(this, ctx, msg) aom_err_msg(VLC_OBJECT(this), ctx, msg ": %s (%s)")
>> +#define AOM_MAX_FRAMES_DEPTH 64
> These are unused.

Indeed, looks like some copy-paste remainings.


More information about the vlc-devel mailing list