summaryrefslogtreecommitdiff
path: root/tools/audio/sampleconv/src/codec/codec.h
blob: 5ebaae855a794219680f8e3e70f9f184074499c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
 * SPDX-FileCopyrightText: Copyright (C) 2024 ZeldaRET
 * SPDX-License-Identifier: MPL-2.0
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#ifndef CODEC_H_
#define CODEC_H_

#include <stdint.h>

#include "../container/container.h"

#include "vadpcm.h"
#include "uncompressed.h"

typedef struct enc_dec_opts {
    // Matching
    bool matching;

    // VADPCM options
    bool truncate;
    uint32_t min_loop_length;
    table_design_spec design;
} enc_dec_opts;

typedef struct codec_spec {
    const char *name;
    sample_data_type type;
    int frame_size;
    bool compressed;
    int (*decode)(container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts);
    int (*encode)(container_data *ctnr, const struct codec_spec *codec, const struct enc_dec_opts *opts);
} codec_spec;

#endif