/*
 * Raw_Processor_implC.h
 *
 *  Created on: 09.01.2011
 *      Author: uwe
 */

#ifndef RAW_PROCESSOR_IMPLC_H_
#define RAW_PROCESSOR_IMPLC_H_

#define CROP(inte) ((((inte) > 0x0000FFFF)) ? ((((inte) & 0x80000000) )? 0 : 0xFFFF) : inte    )


#ifdef __cplusplus
extern "C"
{
#endif

struct struct_mul_matrix_function_variable{
	unsigned short 	*comp0;
	unsigned short 	*comp1;
	unsigned short 	*comp2;
	int					start_row;
	int					number_row;
	int					start_col;
	int					number_col;
	int					linestride;
	float				*matrix;
};

struct struct_mul_matrix_function_variable_asm{
    int     		size;
    unsigned short	*comp1;
    unsigned short	*comp2;
    unsigned short	*comp3;
    float		*matrix;
    short		*comp1_del;
    short		*comp2_del;
    short		*comp3_del;
};

typedef struct struct_mul_matrix_function_variable mul_matrix_function_variable;

unsigned short crop(float in);

void mul_matrix_01(const mul_matrix_function_variable *variable);

void mul_matrix_asm(struct struct_mul_matrix_function_variable_asm *variable);

struct struct_demosaic_AHD{
	unsigned short *buffer[20];
	int linestride[20];


	/*
	 * lab_linestride[0] -> v_L
	 * lab_linestride[1] -> v_a
	 * lab_linestride[2] -> v_b
	 * lab_linestride[3] -> h_L
	 * lab_linestride[4] -> h_a
	 * lab_linestride[5] -> h_b
	 */
	int *lab_buffer[6];
	int lab_linestride[6];
	float *lab_lut;
	float *cam_to_XYZ;
	unsigned char *homo_map[2];
	int homo_map_linestride[2];
	unsigned short *componente[3];
	int componente_linestride[3];

	int width;
	int block_size;

};
typedef struct struct_demosaic_AHD variable_demosaic_AHD;

int demosaic_AHD_default_green(variable_demosaic_AHD *variable);

int demosaic_AHD_default_red_blue(variable_demosaic_AHD *variable);

int demosaic_AHD_extended_1_green(variable_demosaic_AHD *variable);

int demosaic_AHD_extended_2_green(variable_demosaic_AHD *variable);

int demosaic_AHD_extended_red_blue(variable_demosaic_AHD *variable);

int demosaic_AHD_default_build_homogeneity_map(variable_demosaic_AHD *variable);

int demosaic_AHD_default_combine_homogenous_pixels(variable_demosaic_AHD *variable);

#ifdef __cplusplus
}
#endif

#endif /* RAW_PROCESSOR_IMPLC_H_ */
