aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/scripts/test_ports/vcpkg-ci-libaec/project/main.c
blob: 22df70acb9fa4aa0954eec5eb74595e7b42fe796 (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
#include <stdint.h>
#include <libaec.h>

int main()
{
    int32_t source[] = { 1, 1, 1, 4};
    int source_length = 4;

    unsigned char dest[64];
    int dest_lenth = 64;
    
    struct aec_stream strm;
    strm.bits_per_sample = 32;
    strm.block_size = 16;
    strm.rsi = 128;
    strm.flags = AEC_DATA_SIGNED | AEC_DATA_PREPROCESS;
    strm.next_in = (unsigned char *)source;
    strm.avail_in = source_length * sizeof(int32_t);
    strm.next_out = (unsigned char *)dest;
    strm.avail_out = dest_lenth;
    if (aec_encode_init(&strm) != AEC_OK)
        return 1;
    if (aec_encode(&strm, AEC_FLUSH) != AEC_OK)
        return 1;
    aec_encode_end(&strm);

    return 0;
}