/*******************************************************************
                YUV frame treating interface
 *******************************************************************/

#ifndef FRAME_H
#define FRAME_H

#define UCHAR_CLIP_TABLE_OFFSET 384

typedef struct {
	int height;
	int width;

	unsigned char *y;
	unsigned char *u;
	unsigned char *v;
} FRAME;

typedef struct {
	int chroma_format;
	int progressive;

	int remap;

	int yo; /* y offset */
	
	int yg;

	int rv;

	int gu;
	int gv;

	int bu;

} BGR_CONVERSION_PARAMETER;

#ifdef __cplusplus
extern "C" {
#endif

#ifndef FRAME_C
extern const unsigned char uchar_clip_table[1024];	
extern FRAME *new_frame(int width, int height);
extern void delete_frame(FRAME *p);
extern void yuv_420_to_422(FRAME *p, int progressive);
extern void yuv_422_to_444(FRAME *p);
extern void frame_to_bgr(FRAME *in, unsigned char *out, BGR_CONVERSION_PARAMETER *prm);
#endif
	
#ifdef __cplusplus
}
#endif

#endif