⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imgproc.h

📁 最新MTK手机软件源码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *    imgproc.h
 *
 * Project:
 * --------
 *   Maui_Software
 *
 * Description:
 * ------------
 *   Header file of image processor
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/
#ifndef IMGPROC_H
#define IMGPROC_H

#if (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
#include "reg_base.h"
#define IMGPROC_BASE                (IMGPROC_base)

#define IMGPROC_IMAGE_CON           IMGPROC_BASE+0x0
#define IMGPROC_CON                 IMGPROC_BASE+0x4
#define IMGPROC_INTREN              IMGPROC_BASE+0x8
#define IMGPROC_INTR                IMGPROC_BASE+0xC
#define IMGPROC_HUE11               IMGPROC_BASE+0x100
#define IMGPROC_HUE12               IMGPROC_BASE+0x104
#define IMGPROC_HUE21               IMGPROC_BASE+0x108
#define IMGPROC_HUE22               IMGPROC_BASE+0x10c
#define IMGPROC_SAT                 IMGPROC_BASE+0x110
#define IMGPROC_BRIADJ1             IMGPROC_BASE+0x120
#define IMGPROC_BRIADJ2             IMGPROC_BASE+0x124
#define IMGPROC_CONADJ              IMGPROC_BASE+0x128
#define IMGPROC_COLORIZEU           IMGPROC_BASE+0x130
#define IMGPROC_COLORIZEV           IMGPROC_BASE+0x134
#define IMGPROC_MASK11              IMGPROC_BASE+0x140
#define IMGPROC_MASK12              IMGPROC_BASE+0x144
#define IMGPROC_MASK13              IMGPROC_BASE+0x148
#define IMGPROC_MASK21              IMGPROC_BASE+0x14c
#define IMGPROC_MASK22              IMGPROC_BASE+0x150
#define IMGPROC_MASK23              IMGPROC_BASE+0x154
#define IMGPROC_MASK31              IMGPROC_BASE+0x158
#define IMGPROC_MASK32              IMGPROC_BASE+0x15c
#define IMGPROC_MASK33              IMGPROC_BASE+0x160
#define IMGPROC_SCALE               IMGPROC_BASE+0x164
#define IMGPROC_GAMMA_OFF0          IMGPROC_BASE+0x170
#define IMGPROC_GAMMA_OFF1          IMGPROC_BASE+0x174
#define IMGPROC_GAMMA_OFF2          IMGPROC_BASE+0x178
#define IMGPROC_GAMMA_OFF3          IMGPROC_BASE+0x17c
#define IMGPROC_GAMMA_OFF4          IMGPROC_BASE+0x180
#define IMGPROC_GAMMA_OFF5          IMGPROC_BASE+0x184
#define IMGPROC_GAMMA_OFF6          IMGPROC_BASE+0x188
#define IMGPROC_GAMMA_OFF7          IMGPROC_BASE+0x18c
#define IMGPROC_GAMMA_SLP0          IMGPROC_BASE+0x190
#define IMGPROC_GAMMA_SLP1          IMGPROC_BASE+0x194
#define IMGPROC_GAMMA_SLP2          IMGPROC_BASE+0x198
#define IMGPROC_GAMMA_SLP3          IMGPROC_BASE+0x19c
#define IMGPROC_GAMMA_SLP4          IMGPROC_BASE+0x1a0
#define IMGPROC_GAMMA_SLP5          IMGPROC_BASE+0x1a4
#define IMGPROC_GAMMA_SLP6          IMGPROC_BASE+0x1a8
#define IMGPROC_GAMMA_SLP7          IMGPROC_BASE+0x1ac
#define IMGPROC_GAMMA_CON           IMGPROC_BASE+0x1b0
#define IMGPROC_COLOR1R_OFFX        IMGPROC_BASE+0x200
#define IMGPROC_COLOR2R_OFFX        IMGPROC_BASE+0x204
#define IMGPROC_COLOR1G_OFFX        IMGPROC_BASE+0x208
#define IMGPROC_COLOR2G_OFFX        IMGPROC_BASE+0x20c
#define IMGPROC_COLOR1B_OFFX        IMGPROC_BASE+0x210
#define IMGPROC_COLOR2B_OFFX        IMGPROC_BASE+0x214
#define IMGPROC_COLOR1R_OFFY        IMGPROC_BASE+0x220
#define IMGPROC_COLOR2R_OFFY        IMGPROC_BASE+0x224
#define IMGPROC_COLOR1G_OFFY        IMGPROC_BASE+0x228
#define IMGPROC_COLOR2G_OFFY        IMGPROC_BASE+0x22c
#define IMGPROC_COLOR1B_OFFY        IMGPROC_BASE+0x230
#define IMGPROC_COLOR2B_OFFY        IMGPROC_BASE+0x234
#define IMGPROC_COLOR0R_SLP         IMGPROC_BASE+0x240
#define IMGPROC_COLOR1R_SLP         IMGPROC_BASE+0x244
#define IMGPROC_COLOR2R_SLP         IMGPROC_BASE+0x248
#define IMGPROC_COLOR0G_SLP         IMGPROC_BASE+0x250
#define IMGPROC_COLOR1G_SLP         IMGPROC_BASE+0x254
#define IMGPROC_COLOR2G_SLP         IMGPROC_BASE+0x258
#define IMGPROC_COLOR0B_SLP         IMGPROC_BASE+0x260
#define IMGPROC_COLOR1B_SLP         IMGPROC_BASE+0x264
#define IMGPROC_COLOR2B_SLP         IMGPROC_BASE+0x268
#define IMGPROC_MASK_CON            IMGPROC_BASE+0x300
#define IMGPROC_IMGWIDTH            IMGPROC_BASE+0x304
#define IMGPROC_IMGHEIGHT           IMGPROC_BASE+0x308
#define IMGPROC_START_SRC           IMGPROC_BASE+0x30c
#define IMGPROC_START_DST           IMGPROC_BASE+0x310
#define IMGPROC_DUMMYPXL            IMGPROC_BASE+0x314

#define IMGPROC_IMAGE_CON_EN        0x8000	// encode mode, RGB->YUV, JPEG encoder
#define IMGPROC_IMAGE_CON_IE	      0x4000	// image effect mode, RGB->RGB, stand along image
#define IMGPROC_IMAGE_CON_MPEG_EN   0x3000	// MPEG encode mode, YUV->YUV,RGB, different dimension
#define IMGPROC_IMAGE_CON_CA        0x2000	// capture mode, YUV->YUV,RGB, the same image dimension
#define IMGPROC_IMAGE_CON_DE        0x1000	// decode mode, YUV->RGV
#define IMGPROC_IMAGE_CON_MASK      0x0F00
#define IMGPROC_IMAGE_CON_GMA       0x0040
#define IMGPROC_IMAGE_CON_CLR       0x0020
#define IMGPROC_IMAGE_CON_INV       0x0010
#define IMGPROC_IMAGE_CON_CBA       0x0008
#define IMGPROC_IMAGE_CON_HSA       0x0007

#define IMGPROC_CON_START				0x1	// start the image filtering process
#define IMGPROC_CON_STOP				0x2	// stop the image filtering process
#define IMGPROC_CON_INIT				0x10	// reset some coefficients including hue, saturation, brightness and contrast

#define IMGPROC_INTR_INT				0x1 // interrupt is asserted

// definitions
#define INTERN
#define API
#define IMGPROC_EVENT		((kal_uint32)0x00000001)

// error code
#define NO_ERROR			0


//macro
#define ENABLE_EFFECT(e)            DRV_Reg(IMGPROC_IMAGE_CON) &= 0xff00;   \
                                    DRV_Reg(IMGPROC_IMAGE_CON) |= e
#define FILTER_EFFECT(e)       		DRV_Reg(IMGPROC_IMAGE_CON) &= 0xf000;   \
                                    DRV_Reg(IMGPROC_IMAGE_CON) |= (e)
#define IMGPROC_RESET()					DRV_WriteReg(IMGPROC_CON, 0);\
												DRV_WriteReg(IMGPROC_CON, IMGPROC_CON_INIT)
#define IMGPROC_START_FILTER()		DRV_WriteReg(IMGPROC_CON, 0);\
												DRV_WriteReg(IMGPROC_CON, IMGPROC_CON_START)
#define IMGPROC_STOP_FILTER()			DRV_WriteReg(IMGPROC_CON, 0);\
												DRV_WriteReg(IMGPROC_CON, IMGPROC_CON_STOP)
#define GAMMA_INC()						DRV_Reg(IMGPROC_GAMMA_CON) = 1;
#define GAMMA_DEC()						DRV_Reg(IMGPROC_GAMMA_CON) = 0;
#define IMGPROEC_ENABLE_INT()			DRV_WriteReg(IMGPROC_INTREN, 1)
#define IMGPROC_DISABLE_INT()			DRV_WriteReg(IMGPROC_INTREN, 0)


// structures and enums
typedef void (*IMGPROC_CALLBACK)();

typedef enum{
	IMGPORC_ENCODE = 0x8000,		// RGB->YUV
	IMGPROC_EFFECT = 0x4000,		// RGB->RGB (Memory effect, GIF decoder)
	IMGPROC_MPEG_ENCODE = 0x3000,	// YUV->YUV, RGB (MPEG4 encoder)
	IMGPROC_CAPTURE = 0x2000,		// YUV->YUV (JPEG encoder)
	IMGPROC_DECODE = 0x1000,		// YUV->RGB (preview, JPEG decoder, MPEG4 dedocer)
	IMGPROC_BYPASS = 0
}IMGPROC_MODE_ENUM;

typedef enum{
	IMGPROC_INIT,
	IMGPROC_READY,
	IMGPROC_BUSY
}IMGPROC_STATE_ENUM;

typedef enum{
	IMGPROC_PIXEL,
	IMGPROC_FILTER
}IMGPROC_TYPE_ENUM ;

typedef enum{
	IMGPROC_HSA_NONE = 0,
	IMGPROC_HSA_GRAY = 1,
	IMGPROC_HSA_COLORIZE = 2,
	IMGPROC_HSA_HUE = 5,
	IMGPROC_HSA_SAT = 6,
	IMGPROC_HSA_HUE_SAT = 7
}IMGPROC_HSA_ENUM ;


typedef enum{
 FILTER_NONE = 			0,
 FILTER_LP	=				0x500,
 FILTER_HP	=				0x600,
 FILTER_HP_SCAL =			0x700,
 FILTER_BLUR =				0x900,
 FILTER_BLUR_MORE =		0xa00,
 FILTER_UNSHAP =			0xb00,
 FILTER_MAX =				0xc00,
 FILTER_MED =				0xd00,
 FILTER_MIN =				0xe00
}IMGPROC_FILTER_ENUM;

// remove bit-filted declaration
typedef struct{
	IMGPROC_HSA_ENUM hsa;// hue and saturation adjustment
	kal_uint8 cba;// contrast and brightness adjustment enable
	kal_uint8 inv;// color invert enable
	kal_uint8 clr;// color adjustment enable
	kal_uint8 gma;// gamma correction enable
}IMGPROC_PIXEL_EFFECT_STURCT;

 typedef struct{
	MMDI_SCENERIO_ID owner;// scenerio ID

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -