#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <time.h>
#if (!defined WIN32 && !defined _WIN32) || defined(__MINGW32__)
#include <unistd.h>
#else
#include <process.h>
#define getpid …
#endif
#include "opus_multistream.h"
#include "opus.h"
#include "../src/opus_private.h"
#include "test_opus_common.h"
#define MAX_PACKET …
#define SAMPLES …
#define SSAMPLES …
#define MAX_FRAME_SAMP …
#define PI …
#define RAND_SAMPLE(a) …
void generate_music(short *buf, opus_int32 len)
{ … }
#if 0
static int save_ctr = 0;
static void int_to_char(opus_uint32 i, unsigned char ch[4])
{
ch[0] = i>>24;
ch[1] = (i>>16)&0xFF;
ch[2] = (i>>8)&0xFF;
ch[3] = i&0xFF;
}
static OPUS_INLINE void save_packet(unsigned char* p, int len, opus_uint32 rng)
{
FILE *fout;
unsigned char int_field[4];
char name[256];
snprintf(name,255,"test_opus_encode.%llu.%d.bit",(unsigned long long)iseed,save_ctr);
fprintf(stdout,"writing %d byte packet to %s\n",len,name);
fout=fopen(name, "wb+");
if(fout==NULL)test_failed();
int_to_char(len, int_field);
fwrite(int_field, 1, 4, fout);
int_to_char(rng, int_field);
fwrite(int_field, 1, 4, fout);
fwrite(p, 1, len, fout);
fclose(fout);
save_ctr++;
}
#endif
int get_frame_size_enum(int frame_size, int sampling_rate)
{ … }
int test_encode(OpusEncoder *enc, int channels, int frame_size, OpusDecoder *dec)
{ … }
void fuzz_encoder_settings(const int num_encoders, const int num_setting_changes)
{ … }
int run_test1(int no_fuzz)
{ … }
void print_usage(char* _argv[])
{ … }
int main(int _argc, char **_argv)
{ … }