/*****************************************************************************

Copyright (c) 2006 Analog Devices, Inc.	All	Rights Reserved. 

This software is proprietary and confidential to Analog	Devices, Inc. 
and	its	licensors.

*****************************************************************************

$RCSfile: JPEGImageEdgeDetection.h,v $
$Revision: 1.1 $
$Date: 2007/05/22 18:37:55 $

Project:	BlackfinSDK (JPEG Image Edge Detection)
Title:		System Defines for JPEG Image Edge Detection
Author(s):	bmk
Revised	by:	

Description:
			Defines for Edge Detection algorithm(s) used by this application
			
			Edge Detection Algorithm(s) used:
			SOBEL Method

References:
			None

*****************************************************************************
Tab	Setting:			4

Target Processor:		ADSP-BF5xx
Target Tools Revision:	ADSP VisualDSP++ v4.5
******************************************************************************

Modification History:
====================
$Log: JPEGImageEdgeDetection.h,v $
Revision 1.1  2007/05/22 18:37:55  gstephan
Creating VDSP 5.00 release folder.  Created from the head copy of
VDSP 4.50 release folder.

Revision 1.3  2006/11/03 07:11:21  bmk
SDK 2.0  files - Initial Entry

Revision 1.1  2006/07/25 08:09:08  bmk
initial entry


*****************************************************************************/

#ifndef	__JPEGIMAGEEDGEDETECTION_H__
#define	__JPEGIMAGEEDGEDETECTION_H__

#include <adi_itu656.h>			// ITU 656 Video utility definitions

/***************************************************************************** 
Edge Detection Algorithim defines
******************************************************************************
Sobel Method:
-------------
Process	incomming video	active fields (luma	values)	only
Each line is split in to 6 blocks and each active field	is split in	to 4 blocks
i.e., 
NTSC active	field(even or odd) will	be split in	to 54 blocks (120 * 27 pixels per block)
PAL	active field(even or odd) will be split	in to 48 blocks (120 * 36 pixels per block)
		
*****************************************************************************/

// Active video data in each line is spilt to # blocks
#define	SOBEL_ACTIVE_VIDEO_BLOCKS	6

// Active field spilt to # number of blocks
#define	SOBEL_PAL_FIELD_BLOCKS		8
#define	SOBEL_NTSC_FIELD_BLOCKS		9

// Offset for Sobel Algorithm (sobel.h)
// always first and last row in a Sobel out buffer is invalid
// always first and last column in each Sobel out buffer row is invalid
#define	SOBEL_OFFSET				2

// Sobel buffer column size (for valid data only)
#define	SOBEL_COLUMN_SIZE			(ITU_PIXEL_PER_LINE / SOBEL_ACTIVE_VIDEO_BLOCKS)

// Sobel Row size
#define	SOBEL_PAL_ROW_SIZE			(PAL_ACTIVE_FLINES / SOBEL_PAL_FIELD_BLOCKS)
#define	SOBEL_NTSC_ROW_SIZE			(NTSC_ACTIVE_FLINES / SOBEL_NTSC_FIELD_BLOCKS)

// Sobel buffer size (maximum size)
#define	SOBEL_BUF_SIZE				((SOBEL_COLUMN_SIZE+SOBEL_OFFSET) * (SOBEL_PAL_ROW_SIZE+SOBEL_OFFSET))

/***************
Globals
**************/
// Sobel parameters
// Active field spilt to # number of blocks
extern u8	SobelFieldBlocks;
// Number of Sobel blocks per active field
extern u32	SobelBlockCount;
// Sobel block - row size
extern u32	SobelRowSize;

#endif // __JPEGIMAGEEDGEDETECTION_H__

/*****/
