📄 scale_h2_h.asm
字号:
* ========================================================================= *
* NAME *
* scale_h2 -- Horizontal scaling by 2 *
* *
* USAGE *
* This routine has the following C prototype: *
* *
* void scale_h2_cn( *
* const unsigned char *restrict inp, *
* int cols, *
* unsigned char *restrict outp *
* ) *
* *
* *
* The scale_h2 function accepts an input array "inp" that contains *
* "cols" contiguous pixels and produces an output array "outp" of *
* "cols/2" pixels. Simple averaging and rounding are performed. *
* This step may also be viewed as simple bi-linear interpolation. *
* *
* DESCRIPTION *
* The following C code model shows the behaviour of the code. *
* *
* void scale_h2_cn( *
* const unsigned char *restrict inp, *
* int cols, *
* unsigned char *restrict outp *
* ) *
* { *
* int i; *
* *
* for( i = 0; i < (cols >> 1); i++) *
* { *
* outp[i] = (inp[2*i] + inp[(2*i)+1] + 1) >> 1; *
* } *
* } *
* *
* Every two consecutive pixels of the input image are averaged to *
* form an output pixel. *
* *
* TECHNIQUES *
* This code can be used to process either one line, or an arbitrary *
* number of lines as long as they are contiguous in memory. *
* *
* ASSUMPTIONS *
* The input array is aligned on a double-word boundary. The output *
* array is aligned on a double word boundary. The number of input *
* pixels is a multiple of 32. *
* *
* NOTES *
* None *
* *
* SOURCE *
* None *
* *
* MEMORY NOTE *
* No bank conflcits should occurr irrespective of the alignemt of *
* the arrays in memory. *
* *
* INTERRUPT NOTE *
* This code is interrupt tolerant though not interruptible. *
* *
* CYCLES *
* (5*cols)/32 - 5 *
* *
* cols = 640, cycles = 95. *
* *
* ------------------------------------------------------------------------- *
* Copyright (c) 2002 Texas Instruments, Incorporated. *
* All Rights Reserved. *
* ========================================================================= *
.sect ".text:hand"
.include "scale_h2_h.h64"
_scale_h2_asm:
*S-------------------------------------------------------------------------S*
*S TI Proprietary Information: Internal Data S*
*S-------------------------------------------------------------------------S*
*S Swipe6NG datecode: 020206 (12:26:58 AM) [REL]
*S Swipe6NG commandline:
*S swipe6ng -Ma -s -v -l -N -mv6400 prol.sa
*S Target architecture: "C64xx ISA"
*S-------------------------------------------------------------------------S*
*S Total register usage: 6 (a:3 b:3)
* ===================== SYMBOLIC REGISTER ASSIGNMENTS ===================== *
.asg A4, A_inp ; Preferred
.asg B4, B_cols ; Preferred
.asg A6, A_outp ; Preferred
.asg B6, B_inp ; Preferred
.asg B8, B_outp ; Preferred
.asg A0, A_pd ; Preferred
.asg B3, B_return ; Return
.asg B30, B_csr ; CSR
.asg B31, B_no_gie ; NO GIE
* ========================================================================= *
ADD .L2X A_inp, 8, B_inp ;[ 4,0]
|| MVC .S2 CSR, B_csr ; CSR
MVK .S1 3, A_pd ;[ 4,0]
|| ADD .S2X A_outp, 8, B_outp ;[ 3,0]
|| AND .L2 B_csr, -2, B_no_gie ;
;==== Branch occurs
*S-------------------------------------------------------------------------S*
*S TI Proprietary Information: Internal Data S*
*S-------------------------------------------------------------------------S*
*S Swipe6NG datecode: 020206 (12:26:58 AM) [REL]
*S Swipe6NG commandline:
*S swipe6ng -Ma -s -v -2 -mv6400 --Bl scale_h2.cmd
*S Target architecture: "C64xx ISA"
*S-------------------------------------------------------------------------S*
*S
*S Resource MII: 4
*S
*S L1 L1-unit hardware * Bound: 4
*S S1 S1-unit hardware * Bound: 4
*S D1 D1-unit hardware Bound: 3
*S M1 M1-unit hardware * Bound: 4
*S T1 T1-unit LD/ST transport (DAB1) Bound: 3
*S L2 L2-unit hardware * Bound: 4
*S S2 S2-unit hardware * Bound: 4
*S D2 D2-unit hardware Bound: 3
*S M2 M2-unit hardware * Bound: 4
*S T2 T2-unit LD/ST transport (DAB2) Bound: 3
*S M1h M1-unit write port (hi half) * Bound: 4
*S M2h M2-unit write port (hi half) * Bound: 4
*S xoper1 Unshared cross path on 1X Bound: 1
*S xoper2 Unshared cross path on 2X Bound: 1
*S slots Instruction issue slots: 30 * Bound: 4
*S
*S Recurrence MII: 3
*S
*S------------------------- Running Adjust Phase --------------------------S*
*S-------------------------------------------------------------------------S*
*S File : scale_h2.cmd
*S ResMII : 4
*S RecMII : 3
*S MII : 4
*S II : 4
*S No ILP : 0
*S List : 18
*S Length : 16
*S Start : 0
*S Stop : 15
*S Operations : 30
*S Avg. para @ II : 7.500000
*S Calc. Operations : 30
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -