Home | History | Annotate | Download | only in asm
      1 @ ------------------------------------------------------------------
      2 @ Copyright (C) 1998-2009 PacketVideo
      3 @
      4 @ Licensed under the Apache License, Version 2.0 (the "License");
      5 @ you may not use this file except in compliance with the License.
      6 @ You may obtain a copy of the License at
      7 @
      8 @      http://www.apache.org/licenses/LICENSE-2.0
      9 @
     10 @ Unless required by applicable law or agreed to in writing, software
     11 @ distributed under the License is distributed on an "AS IS" BASIS,
     12 @ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13 @ express or implied.
     14 @ See the License for the specific language governing permissions
     15 @ and limitations under the License.
     16 @ -------------------------------------------------------------------
     17 
     18 @
     19 @
     20 @   Filename: pvmp3_polyphase_filter_window.s
     21 @
     22 @------------------------------------------------------------------------------
     23 @ REVISION HISTORY
     24 @
     25 @
     26 @ Who:                                   Date: MM/DD/YYYY
     27 @ Description:
     28 @
     29 @------------------------------------------------------------------------------
     30 
     31 .arm
     32 
     33 .align 4
     34 
     35 .text
     36 
     37 .extern pqmfSynthWin
     38 
     39 
     40 
     41 @------------------------------------------------------------------------------
     42 
     43 .global pvmp3_polyphase_filter_window
     44 
     45 pvmp3_polyphase_filter_window:
     46         stmfd    sp!,{r0-r2,r4-r11,lr}
     47 
     48         sub      sp,sp,#4
     49         ldr      r2,[sp,#0xc]
     50         ldr      r1,PolyPh_filter_coeff
     51 
     52         sub      r2,r2,#1
     53         mov      r10,#1
     54         str      r2,[sp]
     55 
     56 @ Accumulators r9, r11::> Initialization
     57 
     58 Loop_j:
     59         mov      r9,  #0x20
     60         mov      r11, #0x20
     61         mov      r4,  #0x10
     62 Loop_i:
     63         add      r2,r4,r10
     64         add      r3,r0,r2,lsl #2
     65         sub      r2,r4,r10
     66         ldr      r5,[r3]
     67         ldr      lr,[r1]
     68         add      r12,r0,r2,lsl #2
     69         ldr      r6,[r12,#0x780]
     70         smlal    r2,r9,lr,r5
     71         smlal    r2,r11,lr,r6
     72         ldr      r2,[r1,#4]
     73         ldr      r7,[r12,#0x80]
     74         smlal    r5,r11,r2,r5
     75         smull    r6,r5,r2,r6
     76         sub      r9,r9,r5
     77         ldr      r5,[r1,#8]
     78         ldr      r8,[r3,#0x700]
     79         add      r4,r4,#0x200
     80         smlal    r6,r9,r5,r7
     81         smull    r6,r2,r5,r8
     82         ldr      r5,[r1,#0xc]
     83         sub      r11,r11,r2
     84         smlal    r8,r9,r5,r8
     85         smlal    r7,r11,r5,r7
     86         ldr      r5,[r3,#0x100]
     87         ldr      r2,[r1,#0x10]
     88         ldr      r6,[r12,#0x680]
     89         smlal    lr,r9,r2,r5
     90         smlal    lr,r11,r2,r6
     91         ldr      r2,[r1,#0x14]
     92         ldr      r7,[r12,#0x180]
     93         smlal    r5,r11,r2,r5
     94         smull    r6,r5,r2,r6
     95         ldr      r6,[r1,#0x18]
     96         ldr      r8,[r3,#0x600]
     97         sub      r9,r9,r5
     98         smlal    r5,r9,r6,r7
     99         smull    r2,r5,r6,r8
    100         ldr      r6,[r1,#0x1c]
    101         sub      r11,r11,r5
    102         smlal    r8,r9,r6,r8
    103         ldr      r2,[r1,#0x20]
    104         ldr      r5,[r3,#0x200]
    105         smlal    r7,r11,r6,r7
    106         ldr      r6,[r12,#0x580]
    107         smlal    lr,r9,r2,r5
    108         smlal    lr,r11,r2,r6
    109         ldr      r2,[r1,#0x24]
    110         ldr      r7,[r12,#0x280]
    111         smlal    r5,r11,r2,r5
    112         smull    r6,r5,r2,r6
    113         ldr      r6,[r1,#0x28]
    114         ldr      r8,[r3,#0x500]
    115         sub      r9,r9,r5
    116         smlal    r5,r9,r6,r7
    117         smull    r2,r5,r6,r8
    118         ldr      r6,[r1,#0x2c]
    119         sub      r11,r11,r5
    120 
    121         smlal    r8,r9,r6,r8
    122         smlal    r7,r11,r6,r7
    123         ldr      r5,[r3,#0x300]
    124         ldr      r8,[r1,#0x30]
    125         ldr      r6,[r12,#0x480]
    126         smlal    r7,r9,r8,r5
    127         smlal    r7,r11,r8,r6
    128         ldr      r8,[r1,#0x34]
    129         ldr      r12,[r12,#0x380]
    130         smlal    r5,r11,r8,r5
    131         smull    r6,r5,r8,r6
    132         ldr      r6,[r1,#0x38]
    133 
    134 
    135         ldr      r3,[r3,#0x400]
    136         sub      r9,r9,r5
    137         smlal    r7,r9,r6,r12
    138         smull    r8,r7,r6,r3
    139         cmp      r4,#0x210
    140         sub      r11,r11,r7
    141 
    142         ldr      r2,[r1,#0x3c]
    143         add      r1,r1,#0x40
    144         smlal    r3,r9,r2,r3
    145         smlal    r12,r11,r2,r12
    146 
    147         blt      Loop_i
    148 
    149         mov      r3,r9, asr #6
    150         mov      r4,r3, asr #15
    151         teq      r4,r3, asr #31
    152         ldr      r12,LOW_16BITS
    153         ldr      r2,[sp]
    154         eorne    r3,r12,r3,asr #31
    155         ldr      r4,[sp,#8]
    156         mov      r2,r10,lsl r2
    157         add      r4,r4,r2,lsl #1
    158         strh     r3,[r4]
    159 
    160         mov      r3,r11,asr #6
    161         mov      r4,r3,asr #15
    162         teq      r4,r3,asr #31
    163         eorne    r3,r12,r3,asr #31
    164         ldr      r12,[sp,#0xc]
    165         ldr      r11,[sp,#8]
    166         rsb      r2,r2,r12,lsl #5
    167         add      r2,r11,r2,lsl #1
    168         strh     r3,[r2]
    169 
    170         add      r10,r10,#1
    171         cmp      r10,#0x10
    172         blt      Loop_j
    173 
    174 @ Accumulators r4, r5 Initialization
    175 
    176         mov      r4,#0x20
    177         mov      r5,#0x20
    178         mov      r3,#0x10
    179 PolyPh_filter_loop2:
    180         add      r2,r0,r3,lsl #2
    181         ldr      r12,[r2]
    182         ldr      r8,[r1]
    183         ldr      r6,[r2,#0x80]
    184         smlal    r12,r4,r8,r12
    185         ldr      r12,[r1,#4]
    186         ldr      r7,[r2,#0x40]
    187         smlal    r6,r4,r12,r6
    188 
    189         ldr      r12,[r1,#8]
    190         ldr      r6,[r2,#0x180]
    191         smlal    r7,r5,r12,r7
    192         ldr      r12,[r2,#0x100]
    193         ldr      r7,[r1,#0xc]
    194         ldr      r2,[r2,#0x140]
    195         smlal    r12,r4,r7,r12
    196         ldr      r12,[r1,#0x10]
    197         add      r3,r3,#0x80
    198         smlal    r6,r4,r12,r6
    199         ldr      r6,[r1,#0x14]
    200         cmp      r3,#0x210
    201         smlal    r2,r5,r6,r2
    202         add      r1,r1,#0x18
    203 
    204         blt      PolyPh_filter_loop2
    205         mov      r0,r4,asr #6
    206         mov      r2,r0,asr #15
    207         teq      r2,r0,asr #31
    208         ldrne    r12,LOW_16BITS
    209         ldr      r1,[sp,#8]
    210         eorne    r0,r12,r0,asr #31
    211         strh     r0,[r1,#0]
    212         mov      r0,r5,asr #6
    213         mov      r2,r0,asr #15
    214         teq      r2,r0,asr #31
    215         ldrne    r12,LOW_16BITS
    216         ldr      r2,[sp]
    217         mov      r1,#0x10
    218         eorne    r0,r12,r0,asr #31
    219         ldr      r12,[sp,#8]
    220         mov      r1,r1,lsl r2
    221         add      r1,r12,r1,lsl #1
    222         strh     r0,[r1]
    223         add      sp,sp,#0x10
    224         ldmfd    sp!,{r4-r11,pc}
    225 
    226 PolyPh_filter_coeff:
    227         .word      pqmfSynthWin
    228 LOW_16BITS:
    229         .word      0x00007fff
    230 
    231