[FFmpeg-devel] [RFC v2 3/3] daaladec: Implement a native Daala decoder

James Almer jamrial at gmail.com
Tue Dec 29 16:48:16 CET 2015


On 12/28/2015 11:12 PM, Rostislav Pehlivanov wrote:
> diff --git a/libavcodec/daalatab.h b/libavcodec/daalatab.h
> new file mode 100644
> index 0000000..6a4eb34
> --- /dev/null
> +++ b/libavcodec/daalatab.h
> @@ -0,0 +1,85 @@
> +/*
> + * Daala video decoder
> + *
> + * Copyright (C) 2015 Rostislav Pehlivanov <atomnuker at gmail.com>
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg 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.
> + *
> + * FFmpeg 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 FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#ifndef AVCODEC_DAALATAB_H
> +#define AVCODEC_DAALATAB_H
> +
> +#include "daala.h"
> +
> +typedef uint8_t daala_u8_doublet[2];
> +
> +typedef struct DaalaBandLayout {
> +    const daala_u8_doublet *const tab;
> +    const int tab_size;
> +    const int *layout_offset;
> +    const int layout_offset_size;
> +    const int *band_offset;
> +    const int band_offset_size;
> +} DaalaBandLayout;
> +
> +struct DaalaPixFmts {
> +    enum AVPixelFormat fmt;
> +    int planes, depth, depth_mode;
> +    int dec[DAALA_MAX_PLANES][2];
> +};
> +
> +extern const struct DaalaPixFmts daala_valid_formats[];
> +extern const int daala_valid_formats_num;
> +
> +const inline struct DaalaPixFmts *daala_find_p_format(enum AVPixelFormat fmt)

This should be static inline const. Otherwise the compiler expects a prototype.

> +{
> +    int i;
> +    for (i = 0; i < daala_valid_formats_num ; i++)
> +        if (daala_valid_formats[i].fmt == fmt)
> +            return &daala_valid_formats[i];
> +    return NULL;
> +}



More information about the ffmpeg-devel mailing list