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

📄 open.asm

📁 ADI BF DSP的几种常用的图象滤波汇编优化后的代码
💻 ASM
字号:
/*******************************************************************************
Copyright(c) 2000 - 2002 Analog Devices. All Rights Reserved.
Developed by Joint Development Software Application Team, IPDC, Bangalore, India
for Blackfin DSPs  ( Micro Signal Architecture 1.0 specification).

By using this module you agree to the terms of the Analog Devices License
Agreement for DSP Software. 
********************************************************************************
Module name     : open.asm
Label name      : __open
Version         :   1.3
Change History  :

                Version     Date          Author        Comments
                1.3         11/18/2002    Swarnalatha   Tested with VDSP++ 3.0
                                                        compiler 6.2.2 on 
                                                        ADSP-21535 Rev.0.2
                1.2         11/13/2002    Swarnalatha   Tested with VDSP++ 3.0
                                                        on ADSP-21535 Rev. 0.2
                1.1         01/28/2002    Raghavendra   Modified to match 
                                                        silicon cycle count
                1.0         06/29/2001    Raghavendra   Original 

Description     : This function performs open operation  on the input binary 
                  image. This is performed  by doing erosion  followed by 
                  dilation. Temporary results after erosion operation is  stored
                  in stack and later used as input for dilation operation.

Assumptions     : 1. Number of columns of input image is even  AND  aligned to 
                     word or half word boundary 
                  2. Input image and structured elements are in different Banks.
                  3. Same structured elements are used for both erosion and 
                     dilation operation and structured elements are stored as below

                                       | h00  h01  h02 |
                                       | h10  h11  h12 |
                                       | h20  h21  h22 |
            
Prototype       : void open(unsigned char* in, int row, int col, short * SE, 
                            unsigned char *out );
               
                   in   ->  It is pointer to the input image.
                   row  ->  It is number of rows of input image.
                   col  ->  It is number of columns of input image.
                   SE   ->  It is pointer to 3x3 structured element.
                   out  ->  It is pointer the output buffer.

Registers used : R0-R7, P0-P5.

Performance :  
              Code size  : 70 bytes
             Cycle count : 1276 cycles for 8x8 image
*******************************************************************************/
.section   L1_code;
.global    __open;
.align     8;
    
__open:
    [--SP]=(R7:4,P5:3);
                            // Push R7:4 and P5:3 
    R3=R1.L *R2.L(IS)||P5=[SP+40];
                            // Get row*col and address of structured element 
    P3=R3;                  // get offset to decrement stack.
    R7=R1;                  // No. of rows
    R6=R2<<0|| P4=[SP+44];  // Address of output array
    [--SP]=RETS;            // store return address
    SP-=P3;                 // decrement stack pointer to store temp. result
    R4=SP;                       
    SP+=-20;                // decrement stack pointer to pass arguments
    [SP+12]=P5;             // arguments to erosion function
    [SP+16]=R4;
    CALL __erosion;
    R0=R4;                  // Arguments to dilation function
    R1=R7<<0||[SP+12]=P5;
    R2=R6<<0||[SP+16]=P4;        
    CALL __dilation;
    SP+=20;                 // Increment the stack pointer to proper position
    SP=SP+P3;
    RETS=[SP++];            // pop RETS reg.
    (R7:4,P5:3)=[SP++];     // Pop R7:4 and P5:3
    RTS;    
    NOP;                    // To avoid one stall if LINK or UNLINK happens to 
                            // be the  next instruction in the memory.

⌨️ 快捷键说明

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