10c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
278e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// Copyright (C) 2007-2008 ARM Limited
378e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;//
478e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// Licensed under the Apache License, Version 2.0 (the "License");
578e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// you may not use this file except in compliance with the License.
678e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// You may obtain a copy of the License at
778e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;//
878e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;//      http://www.apache.org/licenses/LICENSE-2.0
978e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;//
1078e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// Unless required by applicable law or agreed to in writing, software
1178e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// distributed under the License is distributed on an "AS IS" BASIS,
1278e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1378e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// See the License for the specific language governing permissions and
1478e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;// limitations under the License.
1578e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;//
1678e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar;//
170c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
180c1bc742181ded4930842b46e9507372f0b1b963James Dong;// File Name:  omxVCM4P10_FilterDeblockingChroma_HorEdge_I_s.s
190c1bc742181ded4930842b46e9507372f0b1b963James Dong;// OpenMAX DL: v1.0.2
200c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Revision:   12290
210c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Date:       Wednesday, April 9, 2008
220c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
230c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
240c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
250c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
260c1bc742181ded4930842b46e9507372f0b1b963James Dong
270c1bc742181ded4930842b46e9507372f0b1b963James Dong
280c1bc742181ded4930842b46e9507372f0b1b963James Dong        INCLUDE omxtypes_s.h
290c1bc742181ded4930842b46e9507372f0b1b963James Dong        INCLUDE armCOMM_s.h
300c1bc742181ded4930842b46e9507372f0b1b963James Dong
310c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_VARIANTS CortexA8
320c1bc742181ded4930842b46e9507372f0b1b963James Dong
330c1bc742181ded4930842b46e9507372f0b1b963James Dong        IF CortexA8
340c1bc742181ded4930842b46e9507372f0b1b963James Dong
350c1bc742181ded4930842b46e9507372f0b1b963James Dong        IMPORT  armVCM4P10_DeblockingChromabSGE4_unsafe
360c1bc742181ded4930842b46e9507372f0b1b963James Dong        IMPORT  armVCM4P10_DeblockingChromabSLT4_unsafe
370c1bc742181ded4930842b46e9507372f0b1b963James Dong
380c1bc742181ded4930842b46e9507372f0b1b963James DongLOOP_COUNT  EQU 0x40000000
390c1bc742181ded4930842b46e9507372f0b1b963James DongMASK_3      EQU 0x03030303
400c1bc742181ded4930842b46e9507372f0b1b963James DongMASK_4      EQU 0x04040404
410c1bc742181ded4930842b46e9507372f0b1b963James Dong
420c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Function arguments
430c1bc742181ded4930842b46e9507372f0b1b963James Dong
440c1bc742181ded4930842b46e9507372f0b1b963James DongpSrcDst     RN 0
450c1bc742181ded4930842b46e9507372f0b1b963James DongsrcdstStep  RN 1
460c1bc742181ded4930842b46e9507372f0b1b963James DongpAlpha      RN 2
470c1bc742181ded4930842b46e9507372f0b1b963James DongpBeta       RN 3
480c1bc742181ded4930842b46e9507372f0b1b963James Dong
490c1bc742181ded4930842b46e9507372f0b1b963James DongpThresholds RN 5
500c1bc742181ded4930842b46e9507372f0b1b963James DongpBS         RN 4
510c1bc742181ded4930842b46e9507372f0b1b963James DongbS3210      RN 6
520c1bc742181ded4930842b46e9507372f0b1b963James Dong
530c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Loop
540c1bc742181ded4930842b46e9507372f0b1b963James Dong
550c1bc742181ded4930842b46e9507372f0b1b963James DongXY          RN 7
560c1bc742181ded4930842b46e9507372f0b1b963James Dong
570c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Pixels
580c1bc742181ded4930842b46e9507372f0b1b963James DongdP_0        DN D4.U8
590c1bc742181ded4930842b46e9507372f0b1b963James DongdP_1        DN D5.U8
600c1bc742181ded4930842b46e9507372f0b1b963James DongdP_2        DN D6.U8
610c1bc742181ded4930842b46e9507372f0b1b963James DongdQ_0        DN D8.U8
620c1bc742181ded4930842b46e9507372f0b1b963James DongdQ_1        DN D9.U8
630c1bc742181ded4930842b46e9507372f0b1b963James DongdQ_2        DN D10.U8
640c1bc742181ded4930842b46e9507372f0b1b963James Dong
650c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Filtering Decision
660c1bc742181ded4930842b46e9507372f0b1b963James DongdAlpha      DN D0.U8
670c1bc742181ded4930842b46e9507372f0b1b963James DongdBeta       DN D2.U8
680c1bc742181ded4930842b46e9507372f0b1b963James Dong
690c1bc742181ded4930842b46e9507372f0b1b963James DongdFilt       DN D16.U8
700c1bc742181ded4930842b46e9507372f0b1b963James DongdAqflg      DN D12.U8
710c1bc742181ded4930842b46e9507372f0b1b963James DongdApflg      DN D17.U8
720c1bc742181ded4930842b46e9507372f0b1b963James Dong
730c1bc742181ded4930842b46e9507372f0b1b963James DongdAp0q0      DN D13.U8
740c1bc742181ded4930842b46e9507372f0b1b963James DongdAp1p0      DN D12.U8
750c1bc742181ded4930842b46e9507372f0b1b963James DongdAq1q0      DN D18.U8
760c1bc742181ded4930842b46e9507372f0b1b963James DongdAp2p0      DN D19.U8
770c1bc742181ded4930842b46e9507372f0b1b963James DongdAq2q0      DN D17.U8
780c1bc742181ded4930842b46e9507372f0b1b963James Dong
790c1bc742181ded4930842b46e9507372f0b1b963James DongqBS3210     QN Q13.U16
800c1bc742181ded4930842b46e9507372f0b1b963James DongdBS3210     DN D26
810c1bc742181ded4930842b46e9507372f0b1b963James DongdMask_bs    DN D27
820c1bc742181ded4930842b46e9507372f0b1b963James DongdFilt_bs    DN D26.U16
830c1bc742181ded4930842b46e9507372f0b1b963James Dong
840c1bc742181ded4930842b46e9507372f0b1b963James Dong;// bSLT4
850c1bc742181ded4930842b46e9507372f0b1b963James DongdMask_0     DN D14.U8
860c1bc742181ded4930842b46e9507372f0b1b963James DongdMask_1     DN D15.U8
870c1bc742181ded4930842b46e9507372f0b1b963James DongdMask_4     DN D1.U16
880c1bc742181ded4930842b46e9507372f0b1b963James Dong
890c1bc742181ded4930842b46e9507372f0b1b963James DongMask_4      RN 8
900c1bc742181ded4930842b46e9507372f0b1b963James DongMask_3      RN 9
910c1bc742181ded4930842b46e9507372f0b1b963James Dong
920c1bc742181ded4930842b46e9507372f0b1b963James DongdTemp       DN D19.U8
930c1bc742181ded4930842b46e9507372f0b1b963James Dong
940c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Result
950c1bc742181ded4930842b46e9507372f0b1b963James DongdP_0t       DN D13.U8
960c1bc742181ded4930842b46e9507372f0b1b963James DongdQ_0t       DN D31.U8
970c1bc742181ded4930842b46e9507372f0b1b963James Dong
980c1bc742181ded4930842b46e9507372f0b1b963James DongdP_0n       DN D29.U8
990c1bc742181ded4930842b46e9507372f0b1b963James DongdQ_0n       DN D24.U8
1000c1bc742181ded4930842b46e9507372f0b1b963James Dong
1010c1bc742181ded4930842b46e9507372f0b1b963James Dong
1020c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Function header
1030c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_START omxVCM4P10_FilterDeblockingChroma_HorEdge_I, r9, d15
1040c1bc742181ded4930842b46e9507372f0b1b963James Dong
1050c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;//Arguments on the stack
1060c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_ARG   ppThresholds, 4
1070c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_ARG   ppBS, 4
1080c1bc742181ded4930842b46e9507372f0b1b963James Dong
1090c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// d0-dAlpha_0
1100c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// d2-dBeta_0
1110c1bc742181ded4930842b46e9507372f0b1b963James Dong
1120c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;load alpha1,beta1 somewhere to avoid more loads
1130c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        {dAlpha[]}, [pAlpha]!
1140c1bc742181ded4930842b46e9507372f0b1b963James Dong        SUB         pSrcDst, pSrcDst, srcdstStep, LSL #1 ;?
1150c1bc742181ded4930842b46e9507372f0b1b963James Dong        SUB         pSrcDst, pSrcDst, srcdstStep
1160c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        {dBeta[]}, [pBeta]!
1170c1bc742181ded4930842b46e9507372f0b1b963James Dong
1180c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_LDR       pBS, ppBS
1190c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_LDR       pThresholds, ppThresholds
1200c1bc742181ded4930842b46e9507372f0b1b963James Dong
1210c1bc742181ded4930842b46e9507372f0b1b963James Dong        LDR         Mask_3, =MASK_3
1220c1bc742181ded4930842b46e9507372f0b1b963James Dong        LDR         Mask_4, =MASK_4
1230c1bc742181ded4930842b46e9507372f0b1b963James Dong
1240c1bc742181ded4930842b46e9507372f0b1b963James Dong        VMOV        dMask_0, #0
1250c1bc742181ded4930842b46e9507372f0b1b963James Dong        VMOV        dMask_1, #1
1260c1bc742181ded4930842b46e9507372f0b1b963James Dong        VMOV        dMask_4, #4
1270c1bc742181ded4930842b46e9507372f0b1b963James Dong
1280c1bc742181ded4930842b46e9507372f0b1b963James Dong        LDR         XY, =LOOP_COUNT
1290c1bc742181ded4930842b46e9507372f0b1b963James Dong
1300c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// p0-p3 - d4-d7
1310c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// q0-q3 - d8-d11
1320c1bc742181ded4930842b46e9507372f0b1b963James DongLoopY
1330c1bc742181ded4930842b46e9507372f0b1b963James Dong        LDR         bS3210, [pBS], #8
1340c1bc742181ded4930842b46e9507372f0b1b963James Dong
1350c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        dP_2, [pSrcDst], srcdstStep
1360c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;1
1370c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        dP_1, [pSrcDst], srcdstStep
1380c1bc742181ded4930842b46e9507372f0b1b963James Dong        CMP         bS3210, #0
1390c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        dP_0, [pSrcDst], srcdstStep
1400c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;1
1410c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        dQ_0, [pSrcDst], srcdstStep
1420c1bc742181ded4930842b46e9507372f0b1b963James Dong        VABD        dAp2p0, dP_2, dP_0
1430c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        dQ_1, [pSrcDst], srcdstStep
1440c1bc742181ded4930842b46e9507372f0b1b963James Dong        VABD        dAp0q0, dP_0, dQ_0
1450c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        dQ_2, [pSrcDst], srcdstStep
1460c1bc742181ded4930842b46e9507372f0b1b963James Dong        BEQ         NoFilterBS0
1470c1bc742181ded4930842b46e9507372f0b1b963James Dong
1480c1bc742181ded4930842b46e9507372f0b1b963James Dong        VABD        dAp1p0, dP_1, dP_0
1490c1bc742181ded4930842b46e9507372f0b1b963James Dong        VABD        dAq1q0, dQ_1, dQ_0
1500c1bc742181ded4930842b46e9507372f0b1b963James Dong
1510c1bc742181ded4930842b46e9507372f0b1b963James Dong        VCGT        dFilt, dAlpha, dAp0q0
1520c1bc742181ded4930842b46e9507372f0b1b963James Dong        VMOV.U32    dBS3210[0], bS3210
1530c1bc742181ded4930842b46e9507372f0b1b963James Dong        VMAX        dAp1p0, dAq1q0, dAp1p0
1540c1bc742181ded4930842b46e9507372f0b1b963James Dong        VMOVL       qBS3210, dBS3210.U8
1550c1bc742181ded4930842b46e9507372f0b1b963James Dong        VABD        dAq2q0, dQ_2, dQ_0
1560c1bc742181ded4930842b46e9507372f0b1b963James Dong        VCGT        dMask_bs.S16, dBS3210.S16, #0
1570c1bc742181ded4930842b46e9507372f0b1b963James Dong
1580c1bc742181ded4930842b46e9507372f0b1b963James Dong        VCGT        dAp1p0, dBeta, dAp1p0
1590c1bc742181ded4930842b46e9507372f0b1b963James Dong        VCGT        dAp2p0, dBeta, dAp2p0
1600c1bc742181ded4930842b46e9507372f0b1b963James Dong
1610c1bc742181ded4930842b46e9507372f0b1b963James Dong        VAND        dFilt, dMask_bs.U8
1620c1bc742181ded4930842b46e9507372f0b1b963James Dong
1630c1bc742181ded4930842b46e9507372f0b1b963James Dong        TST         bS3210, Mask_3
1640c1bc742181ded4930842b46e9507372f0b1b963James Dong
1650c1bc742181ded4930842b46e9507372f0b1b963James Dong        VCGT        dAq2q0, dBeta, dAq2q0
1660c1bc742181ded4930842b46e9507372f0b1b963James Dong        VAND        dFilt, dFilt, dAp1p0
1670c1bc742181ded4930842b46e9507372f0b1b963James Dong
1680c1bc742181ded4930842b46e9507372f0b1b963James Dong        VAND        dAqflg, dFilt, dAq2q0
1690c1bc742181ded4930842b46e9507372f0b1b963James Dong        VAND        dApflg, dFilt, dAp2p0
1700c1bc742181ded4930842b46e9507372f0b1b963James Dong
1710c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// bS < 4 Filtering
1720c1bc742181ded4930842b46e9507372f0b1b963James Dong        BLNE        armVCM4P10_DeblockingChromabSLT4_unsafe
1730c1bc742181ded4930842b46e9507372f0b1b963James Dong
1740c1bc742181ded4930842b46e9507372f0b1b963James Dong        TST         bS3210, Mask_4
1750c1bc742181ded4930842b46e9507372f0b1b963James Dong
1760c1bc742181ded4930842b46e9507372f0b1b963James Dong        SUB         pSrcDst, pSrcDst, srcdstStep, LSL #2
1770c1bc742181ded4930842b46e9507372f0b1b963James Dong        VTST        dFilt_bs, dFilt_bs, dMask_4
1780c1bc742181ded4930842b46e9507372f0b1b963James Dong
1790c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// bS == 4 Filtering
1800c1bc742181ded4930842b46e9507372f0b1b963James Dong        BLNE        armVCM4P10_DeblockingChromabSGE4_unsafe
1810c1bc742181ded4930842b46e9507372f0b1b963James Dong
1820c1bc742181ded4930842b46e9507372f0b1b963James Dong        VBIT        dP_0n, dP_0t, dFilt_bs
1830c1bc742181ded4930842b46e9507372f0b1b963James Dong        VBIT        dQ_0n, dQ_0t, dFilt_bs
1840c1bc742181ded4930842b46e9507372f0b1b963James Dong
1850c1bc742181ded4930842b46e9507372f0b1b963James Dong        VBIF        dP_0n, dP_0, dFilt
1860c1bc742181ded4930842b46e9507372f0b1b963James Dong        VBIF        dQ_0n, dQ_0, dFilt
1870c1bc742181ded4930842b46e9507372f0b1b963James Dong
1880c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Result Storage
1890c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1        dP_0n, [pSrcDst], srcdstStep
1900c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADDS        XY, XY, XY
1910c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1        dQ_0n, [pSrcDst], srcdstStep
1920c1bc742181ded4930842b46e9507372f0b1b963James Dong
1930c1bc742181ded4930842b46e9507372f0b1b963James Dong        BNE         LoopY
1940c1bc742181ded4930842b46e9507372f0b1b963James Dong
1950c1bc742181ded4930842b46e9507372f0b1b963James Dong        MOV         r0, #OMX_Sts_NoErr
1960c1bc742181ded4930842b46e9507372f0b1b963James Dong
1970c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_EXIT
1980c1bc742181ded4930842b46e9507372f0b1b963James Dong
1990c1bc742181ded4930842b46e9507372f0b1b963James DongNoFilterBS0
2000c1bc742181ded4930842b46e9507372f0b1b963James Dong
2010c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        {dAlpha[]}, [pAlpha]
2020c1bc742181ded4930842b46e9507372f0b1b963James Dong        SUB         pSrcDst, pSrcDst, srcdstStep, LSL #1
2030c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADDS        XY, XY, XY
2040c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1        {dBeta[]}, [pBeta]
2050c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD         pThresholds, pThresholds, #4
2060c1bc742181ded4930842b46e9507372f0b1b963James Dong        BNE         LoopY
2070c1bc742181ded4930842b46e9507372f0b1b963James Dong
2080c1bc742181ded4930842b46e9507372f0b1b963James Dong        MOV         r0, #OMX_Sts_NoErr
2090c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_END
2100c1bc742181ded4930842b46e9507372f0b1b963James Dong
2110c1bc742181ded4930842b46e9507372f0b1b963James Dong        ENDIF
2120c1bc742181ded4930842b46e9507372f0b1b963James Dong
2130c1bc742181ded4930842b46e9507372f0b1b963James Dong
2140c1bc742181ded4930842b46e9507372f0b1b963James Dong        END
2150c1bc742181ded4930842b46e9507372f0b1b963James Dong
2160c1bc742181ded4930842b46e9507372f0b1b963James Dong
217