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

📄 decimate.asm

📁 Using the ADSP-BF561 Blackfin Processor as a TFT-LCD Controller
💻 ASM
字号:
/*****************************************************************************
**																			**
**	 Project Name: 	LCD											**	
**																			**
******************************************************************************

(C) Copyright 2005 - Analog Devices, Inc.  All rights reserved.

File Name:		Decimate.asm

Date Modified:	5/1/05		CL		Rev 1.0

Software:       VisualDSP++3.5

Hardware:		ADSP-BF561 EZ-KIT Lite

Special Connections:  None

Purpose:		This file decimates the number of pixels from the original
			image (720*480 active pixels) to the LCD panel's 
			resolution (240*320).
				
******************************************************************************/


#include <defBF561.h>

.global _Decimate_h;

.section program;

_Decimate_h:

	[--sp] = rets;
	[--sp] = r7;
	[--sp] = r6;
	[--sp] = r5;
	[--sp] = r4;
	[--sp] = p3;
	[--sp] = p5;
	[--sp] = p4;
	
	//R0 holds first parameter passed into function -- sFrame0
	//R5 = start location to process field 1 data = 20*1716 + 276 bytes = 34596
	//R6 = start location to process field 2 data = 277*1716 +276 bytes = 475608
	
	R5 = 24300(z); 		//Field 1 offset position.
	R6.L = 0x19a0;		//Field 2 offset position.
	R6.H = 0x7;
	I0 = 0; I1 = 0;		//Set I0 to I1 to zero for proper position of BYTEOP1P calculation
	L2 = 0; L3 = 0; 
	R5 = R0 + R5;		//Calculate source address with field 1 offset.
	P5 = R1;
	I2 = R5;
	P0 = R5;			//Source buffer for calculations starting with Cb components.	
	P3 = 120(z);		//Inner loop count.
	I2 += 4;			//Source buffer for calculations starting with Cr components (+6 bytes).
	P2 = 320(z);		//Outer loop count.
	I2 += 2;
	
	//Calculate source addr w/field 2 offset. 
	R6 = 0(z); 
	P4 = 1716; M2 = 1716;
	P1 = 276; M3 = 276;
	
	lsetup(outer_loop_b, outer_loop_e) LC0 = P2;
	outer_loop_b:
	 
		lsetup(inner_loop_b, inner_loop_e) LC1 = P3;
		inner_loop_b:	
			MNOP || R0 = [P0++] || R1.L = W[I2++];
			MNOP || R2 = [P0++] || R1.H = W[I2++];
			R2 = BYTEOP1P(R1:0, R3:2) || R4 = [P0++] || R3.L = W[I2++];
			R0 = R0 >> 24 || R3.H = W[I2++] || B[P5++] = R2;
			R4 = R2 >> 16 || R5 = B[P5++](Z);
		    R2 = R2 >> 8  || R5.L = W[I2++]; 
			R2 = BYTEOP1P(R1:0, R3:2) || R5.L = W[I2++] || B[P5--] = R4;
			R3 = BYTEOP1P(R1:0, R3:2)(r) || R5.L = W[I2] || B[P5++] = R2;
			P5 += 3; 
			R1 = R1 >> 24 || B[P5--] = R3;	
			R4 = R3 >> 16 || R5 = B[P5--](Z); 
			R3 = R3 >> 8 || B[P5++] = R4;	
			R3 = BYTEOP1P(R1:0, R3:2)(r);
			B[P5++] = R3;				
		inner_loop_e:   P5 += 1;
		
			P0 = P0 + P1;
			I2 += M3;		
			R6 += 1;
			CC = R6 == 3;
			IF !CC JUMP outer_loop_e;
			R6 = 0(z);
			P0 -= P4;
			I2 -= M2;
			ssync;
			
	outer_loop_e:	nop;
	
			
	p4 = [sp++];
	p5 = [sp++];
	p3 = [sp++];
	r4 = [sp++];	
	r5 = [sp++];
	r6 = [sp++];
	r7 = [sp++];
	rets = [sp++];
	
	ssync;

_Decimate_h.END: rts;




⌨️ 快捷键说明

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