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

📄 local_mem.h

📁 基于Linux的ffmepg decoder
💻 H
字号:
#ifndef __LOCAL_MEM_H
	#define __LOCAL_MEM_H
	#include "mp4vdec.h"
	#include "mp4.h"
	#ifdef FIE8120
		#define LOCAL_BASE			0x00000
	#else
		#define LOCAL_BASE			0x10000
	#endif
	#define MP4_OFF			(LOCAL_BASE + 0x10000)
	#define DMA_OFF			(MP4_OFF + 0x400)

/****************  bank 1	(2K bytes)*****************************************/
	#if (OUTPUT_FMT == OUTPUT_FMT_YUV)
		#define RGB_PIXEL_SIZE	1
	#elif (OUTPUT_FMT == OUTPUT_FMT_RGB888)
		#define RGB_PIXEL_SIZE	4
		#define RGB_DMA_INC	DMA_INCS_128
	#else
		#define RGB_PIXEL_SIZE	2
		#define RGB_DMA_INC	DMA_INCS_64
	#endif
	// ping-pong interpolation buffer: 4000 ~ 4300
	#define INTER_Y_OFF_0		(LOCAL_BASE + 0x4000)	//	000 -- 100, Leng = 4 * SIZE_Y
	#define INTER_U_OFF_0 		(INTER_Y_OFF_0 + SIZE_Y)//	100 -- 140, Leng = SIZE_U
	#define INTER_V_OFF_0 		(INTER_U_OFF_0 + SIZE_U)//	140 -- 180, Leng = SIZE_V

	#define INTER_Y_OFF_1		(INTER_V_OFF_0 + SIZE_V)//	180 -- 280, Leng = 4 * SIZE_Y
	#define INTER_U_OFF_1 		(INTER_Y_OFF_1 + SIZE_Y)//	280 -- 2C0, Leng = SIZE_U
	#define INTER_V_OFF_1 		(INTER_U_OFF_1 + SIZE_U)//	2C0 -- 300, Leng = SIZE_V
	#define INTER_Y_STEP		(SIZE_Y + SIZE_U + SIZE_V)

	// ping-pong RGB buffer: 4300 ~ 4700 or 4300 ~ 4B00
	#define BUFFER_RGB_OFF_0	(LOCAL_BASE + 0x4300)	//other: 300 -- 700, Leng = 256 pixel * 2 B * 2 (ping-pong)
												//888:   300 -- B00, Leng = 256 pixel * 4 B * 2 (ping-pong)
	#define BUFFER_RGB_OFF_1	(BUFFER_RGB_OFF_0 + SIZE_Y * RGB_PIXEL_SIZE)

	// custom_intra_matrix: 7C00~7D00, 4 * 64
	#define CUSTOM_INTRA_MATRIX_OFF	(LOCAL_BASE + 0x7C00)
//	#define Table_Custom_Intra_Matrix		((uint32_t *) (AHBBASE_LOCAL + CUSTOM_INTRA_MATRIX_OFF))
	// custom_inter_matrix: 7D00~7F00, 4 * 64
	#define CUSTOM_INTER_MATRIX_OFF	(LOCAL_BASE + 0x7D00)
//	#define Table_Custom_Inter_Matrix		((uint32_t *) (AHBBASE_LOCAL + CUSTOM_INTER_MATRIX_OFF))
/****************  bank 0	*****************************************/
	// 000 ~ 300, Leng = (2 * 64) * 6 (blocks)		// must 0x100 bundary
	#define QCOEFF_OFF_0		(LOCAL_BASE + 0x000)
	// 300 ~ 600, Leng = (2 * 64) * 6 (blocks)		// must 0x100 bundary
	#define QCOEFF_OFF_1		(LOCAL_BASE + 0x300)
	// 600 ~ 900, Leng = (2 * 64) * 6 (blocks)		// must 0x100 bundary
	#define QCOEFF_OFF_2		(LOCAL_BASE + 0x600)

	// 900 ~ A00, Length = 256
	#define RUN_LEVEL_OFF		(LOCAL_BASE + 0x900)

	// 000 ~ 100, Leng = (4 * 4) * 16(structures)
//	#define DMA_cmd_local_nframe	((uint32_t *) (AHBBASE_LOCAL + QCOEFF_OFF_0))
	#define DMA_CMD_N_OFF	(QCOEFF_OFF_0)

	// A00 ~ C00, Leng = (4 * 4) * 32(structures)
	#define DMA_CMD_OFF_0	(LOCAL_BASE + 0xA00)
	// C00 ~ E00, Leng = (4 * 4) * 32(structures)
	#define DMA_CMD_OFF_1	(LOCAL_BASE + 0xC00)

	// E00 ~ 1000, Leng = (2 * 16) * 16(mbs)		// must 0x200 bundary
	#define PREDICTOR0_OFF		(LOCAL_BASE + 0xE00)
	#define PREDICTOR4_OFF		(LOCAL_BASE + 0xE80)
	#define PREDICTOR8_OFF	 	(LOCAL_BASE + 0xF00)

	// 1000 ~1400, Leng = (2W) * 128(2048/16 mb) 	// must 0x400 bundary
	#define ME_CMD_Q_OFF		(LOCAL_BASE + 0x1000)
//	#define ME_command_queue0	((uint32_t *) (AHBBASE_LOCAL + ME_CMD_Q_OFF))
	// 1400 ~1600, Leng = (4) * 64(commands count) 	// must 0x200 bundary
	#define PMV_BUFFER_OFF	(LOCAL_BASE + 0x1400)
/****************  bank 2/3	*****************************************/
	// 8000 ~ 8C00, Leng = C00h = (8 * 8) (bytes/block) * (8 * 6)(blocks)
	#define REF_Y_OFF_0		(LOCAL_BASE + 0x8000)
	#define REF_Y0_OFF_0		REF_Y_OFF_0
	#define REF_Y1_OFF_0		(REF_Y0_OFF_0 + 2 * PIXEL_U)
	#define REF_Y2_OFF_0		(REF_Y0_OFF_0 + 16 * SIZE_U)
	#define REF_Y3_OFF_0		(REF_Y2_OFF_0 + 2 * PIXEL_U)
	#define REF_U_OFF_0		(REF_Y0_OFF_0 + 32 * SIZE_U)
	#define REF_V_OFF_0		(REF_U_OFF_0 + 2 * PIXEL_U)

	#define REF_Y_OFF_1		(REF_Y_OFF_0 + 4 * PIXEL_U)
	#define REF_Y0_OFF_1		REF_Y_OFF_1
	#define REF_Y1_OFF_1		(REF_Y0_OFF_1 + 2 * PIXEL_U)
	#define REF_Y2_OFF_1		(REF_Y0_OFF_1 + 16 * SIZE_U)
	#define REF_Y3_OFF_1		(REF_Y2_OFF_1 + 2 * PIXEL_U)
	#define REF_U_OFF_1		(REF_Y0_OFF_1 + 32 * SIZE_U)
	#define REF_V_OFF_1		(REF_U_OFF_1 + 2 * PIXEL_U)

	// 8C00 ~
	#define TABLE_OUTPUT_OFF	(LOCAL_BASE + 0x8C00)
//	#define Table_Output		((uint32_t *) (AHBBASE_LOCAL + TABLE_OUTPUT_OFF))

	#ifdef LOCAL_MEM_GLOBAL
		#define LOCAL_MEM_EXT
	#else
		#define LOCAL_MEM_EXT extern
	#endif
#endif

⌨️ 快捷键说明

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