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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/***************************************************************************
avcomp.h
Audio/video compression and decompression helpers.
Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
Visit http://mamedev.org for licensing and usage restrictions.
***************************************************************************/
#ifndef __AVCOMP_H__
#include "osdcore.h"
/***************************************************************************
CONSTANTS
***************************************************************************/
/* errors */
enum _avcomp_error
{
AVCERR_NONE = 0,
AVCERR_INVALID_DATA,
AVCERR_VIDEO_TOO_LARGE,
AVCERR_AUDIO_TOO_LARGE,
AVCERR_OUT_OF_MEMORY,
AVCERR_COMPRESSION_ERROR
};
typedef enum _avcomp_error avcomp_error;
/* default decompression parameters */
#define AVCOMP_DECODE_META (1 << 0)
#define AVCOMP_DECODE_VIDEO (1 << 1)
#define AVCOMP_DECODE_AUDIO(x) (1 << (2 + (x)))
#define AVCOMP_DECODE_DEFAULT (~0)
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
typedef struct _avcomp_state avcomp_state;
/***************************************************************************
PROTOTYPES
***************************************************************************/
avcomp_state *avcomp_init(UINT32 maxwidth, UINT32 maxheight, UINT32 maxchannels);
void avcomp_free(avcomp_state *state);
void avcomp_decompress_config(avcomp_state *state, UINT32 decodemask, UINT8 *videobuffer, UINT32 videostride, UINT32 videoxor, UINT32 audioxor);
avcomp_error avcomp_encode_data(avcomp_state *state, const UINT8 *source, UINT8 *dest, UINT32 *complength);
avcomp_error avcomp_decode_data(avcomp_state *state, const UINT8 *source, UINT32 complength, UINT8 *dest);
#endif
|