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         adr      r2,PolyPh_filter_coeff
     50         ldr      r1,[r2]
     51         add      r1,r2
     52         ldr      r2,[sp,#0xc]
     53 
     54         sub      r2,r2,#1
     55         mov      r10,#1
     56         str      r2,[sp]
     57 
     58 @ Accumulators r9, r11::> Initialization
     59 
     60 Loop_j:
     61         mov      r9,  #0x20
     62         mov      r11, #0x20
     63         mov      r4,  #0x10
     64 Loop_i:
     65         add      r2,r4,r10
     66         add      r3,r0,r2,lsl #2
     67         sub      r2,r4,r10
     68         ldr      r5,[r3]
     69         ldr      lr,[r1]
     70         add      r12,r0,r2,lsl #2
     71         ldr      r6,[r12,#0x780]
     72         smlal    r2,r9,lr,r5
     73         smlal    r2,r11,lr,r6
     74         ldr      r2,[r1,#4]
     75         ldr      r7,[r12,#0x80]
     76         smlal    r5,r11,r2,r5
     77         smull    r6,r5,r2,r6
     78         sub      r9,r9,r5
     79         ldr      r5,[r1,#8]
     80         ldr      r8,[r3,#0x700]
     81         add      r4,r4,#0x200
     82         smlal    r6,r9,r5,r7
     83         smull    r6,r2,r5,r8
     84         ldr      r5,[r1,#0xc]
     85         sub      r11,r11,r2
     86         smlal    r8,r9,r5,r8
     87         smlal    r7,r11,r5,r7
     88         ldr      r5,[r3,#0x100]
     89         ldr      r2,[r1,#0x10]
     90         ldr      r6,[r12,#0x680]
     91         smlal    lr,r9,r2,r5
     92         smlal    lr,r11,r2,r6
     93         ldr      r2,[r1,#0x14]
     94         ldr      r7,[r12,#0x180]
     95         smlal    r5,r11,r2,r5
     96         smull    r6,r5,r2,r6
     97         ldr      r6,[r1,#0x18]
     98         ldr      r8,[r3,#0x600]
     99         sub      r9,r9,r5
    100         smlal    r5,r9,r6,r7
    101         smull    r2,r5,r6,r8
    102         ldr      r6,[r1,#0x1c]
    103         sub      r11,r11,r5
    104         smlal    r8,r9,r6,r8
    105         ldr      r2,[r1,#0x20]
    106         ldr      r5,[r3,#0x200]
    107         smlal    r7,r11,r6,r7
    108         ldr      r6,[r12,#0x580]
    109         smlal    lr,r9,r2,r5
    110         smlal    lr,r11,r2,r6
    111         ldr      r2,[r1,#0x24]
    112         ldr      r7,[r12,#0x280]
    113         smlal    r5,r11,r2,r5
    114         smull    r6,r5,r2,r6
    115         ldr      r6,[r1,#0x28]
    116         ldr      r8,[r3,#0x500]
    117         sub      r9,r9,r5
    118         smlal    r5,r9,r6,r7
    119         smull    r2,r5,r6,r8
    120         ldr      r6,[r1,#0x2c]
    121         sub      r11,r11,r5
    122 
    123         smlal    r8,r9,r6,r8
    124         smlal    r7,r11,r6,r7
    125         ldr      r5,[r3,#0x300]
    126         ldr      r8,[r1,#0x30]
    127         ldr      r6,[r12,#0x480]
    128         smlal    r7,r9,r8,r5
    129         smlal    r7,r11,r8,r6
    130         ldr      r8,[r1,#0x34]
    131         ldr      r12,[r12,#0x380]
    132         smlal    r5,r11,r8,r5
    133         smull    r6,r5,r8,r6
    134         ldr      r6,[r1,#0x38]
    135 
    136 
    137         ldr      r3,[r3,#0x400]
    138         sub      r9,r9,r5
    139         smlal    r7,r9,r6,r12
    140         smull    r8,r7,r6,r3
    141         cmp      r4,#0x210
    142         sub      r11,r11,r7
    143 
    144         ldr      r2,[r1,#0x3c]
    145         add      r1,r1,#0x40
    146         smlal    r3,r9,r2,r3
    147         smlal    r12,r11,r2,r12
    148 
    149         blt      Loop_i
    150 
    151         mov      r3,r9, asr #6
    152         mov      r4,r3, asr #15
    153         teq      r4,r3, asr #31
    154         ldr      r12,LOW_16BITS
    155         ldr      r2,[sp]
    156         eorne    r3,r12,r3,asr #31
    157         ldr      r4,[sp,#8]
    158         mov      r2,r10,lsl r2
    159         add      r4,r4,r2,lsl #1
    160         strh     r3,[r4]
    161 
    162         mov      r3,r11,asr #6
    163         mov      r4,r3,asr #15
    164         teq      r4,r3,asr #31
    165         eorne    r3,r12,r3,asr #31
    166         ldr      r12,[sp,#0xc]
    167         ldr      r11,[sp,#8]
    168         rsb      r2,r2,r12,lsl #5
    169         add      r2,r11,r2,lsl #1
    170         strh     r3,[r2]
    171 
    172         add      r10,r10,#1
    173         cmp      r10,#0x10
    174         blt      Loop_j
    175 
    176 @ Accumulators r4, r5 Initialization
    177 
    178         mov      r4,#0x20
    179         mov      r5,#0x20
    180         mov      r3,#0x10
    181 PolyPh_filter_loop2:
    182         add      r2,r0,r3,lsl #2
    183         ldr      r12,[r2]
    184         ldr      r8,[r1]
    185         ldr      r6,[r2,#0x80]
    186         smlal    r12,r4,r8,r12
    187         ldr      r12,[r1,#4]
    188         ldr      r7,[r2,#0x40]
    189         smlal    r6,r4,r12,r6
    190 
    191         ldr      r12,[r1,#8]
    192         ldr      r6,[r2,#0x180]
    193         smlal    r7,r5,r12,r7
    194         ldr      r12,[r2,#0x100]
    195         ldr      r7,[r1,#0xc]
    196         ldr      r2,[r2,#0x140]
    197         smlal    r12,r4,r7,r12
    198         ldr      r12,[r1,#0x10]
    199         add      r3,r3,#0x80
    200         smlal    r6,r4,r12,r6
    201         ldr      r6,[r1,#0x14]
    202         cmp      r3,#0x210
    203         smlal    r2,r5,r6,r2
    204         add      r1,r1,#0x18
    205 
    206         blt      PolyPh_filter_loop2
    207         mov      r0,r4,asr #6
    208         mov      r2,r0,asr #15
    209         teq      r2,r0,asr #31
    210         ldrne    r12,LOW_16BITS
    211         ldr      r1,[sp,#8]
    212         eorne    r0,r12,r0,asr #31
    213         strh     r0,[r1,#0]
    214         mov      r0,r5,asr #6
    215         mov      r2,r0,asr #15
    216         teq      r2,r0,asr #31
    217         ldrne    r12,LOW_16BITS
    218         ldr      r2,[sp]
    219         mov      r1,#0x10
    220         eorne    r0,r12,r0,asr #31
    221         ldr      r12,[sp,#8]
    222         mov      r1,r1,lsl r2
    223         add      r1,r12,r1,lsl #1
    224         strh     r0,[r1]
    225         add      sp,sp,#0x10
    226         ldmfd    sp!,{r4-r11,pc}
    227 
    228 PolyPh_filter_coeff:
    229         .word      pqmfSynthWin-PolyPh_filter_coeff
    230 LOW_16BITS:
    231         .word      0x00007fff
    232 
    233