omxVCM4P10_PredictIntra_4x4_s.s revision 0c1bc742181ded4930842b46e9507372f0b1b963
10c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
20c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
30c1bc742181ded4930842b46e9507372f0b1b963James Dong;// File Name:  omxVCM4P10_PredictIntra_4x4_s.s
40c1bc742181ded4930842b46e9507372f0b1b963James Dong;// OpenMAX DL: v1.0.2
50c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Revision:   12290
60c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Date:       Wednesday, April 9, 2008
70c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
80c1bc742181ded4930842b46e9507372f0b1b963James Dong;// (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
90c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
100c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
110c1bc742181ded4930842b46e9507372f0b1b963James Dong;//
120c1bc742181ded4930842b46e9507372f0b1b963James Dong
130c1bc742181ded4930842b46e9507372f0b1b963James Dong
140c1bc742181ded4930842b46e9507372f0b1b963James Dong        INCLUDE omxtypes_s.h
150c1bc742181ded4930842b46e9507372f0b1b963James Dong        INCLUDE armCOMM_s.h
160c1bc742181ded4930842b46e9507372f0b1b963James Dong
170c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Define the processor variants supported by this file
180c1bc742181ded4930842b46e9507372f0b1b963James Dong
190c1bc742181ded4930842b46e9507372f0b1b963James Dong         M_VARIANTS CortexA8
200c1bc742181ded4930842b46e9507372f0b1b963James Dong
210c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------------------------------
220c1bc742181ded4930842b46e9507372f0b1b963James Dong;// This table for implementing switch case of C in asm by
230c1bc742181ded4930842b46e9507372f0b1b963James Dong;// the mehtod of two levels of indexing.
240c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------------------------------
250c1bc742181ded4930842b46e9507372f0b1b963James Dong
260c1bc742181ded4930842b46e9507372f0b1b963James Dong    M_TABLE armVCM4P10_pSwitchTable4x4
270c1bc742181ded4930842b46e9507372f0b1b963James Dong    DCD  OMX_VC_4x4_VERT,     OMX_VC_4x4_HOR
280c1bc742181ded4930842b46e9507372f0b1b963James Dong    DCD  OMX_VC_4x4_DC,       OMX_VC_4x4_DIAG_DL
290c1bc742181ded4930842b46e9507372f0b1b963James Dong    DCD  OMX_VC_4x4_DIAG_DR,  OMX_VC_4x4_VR
300c1bc742181ded4930842b46e9507372f0b1b963James Dong    DCD  OMX_VC_4x4_HD,       OMX_VC_4x4_VL
310c1bc742181ded4930842b46e9507372f0b1b963James Dong    DCD  OMX_VC_4x4_HU
320c1bc742181ded4930842b46e9507372f0b1b963James Dong
330c1bc742181ded4930842b46e9507372f0b1b963James Dong
340c1bc742181ded4930842b46e9507372f0b1b963James Dong        IF CortexA8
350c1bc742181ded4930842b46e9507372f0b1b963James Dong
360c1bc742181ded4930842b46e9507372f0b1b963James Dong;//--------------------------------------------
370c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Scratch variable
380c1bc742181ded4930842b46e9507372f0b1b963James Dong;//--------------------------------------------
390c1bc742181ded4930842b46e9507372f0b1b963James Dongreturn          RN 0
400c1bc742181ded4930842b46e9507372f0b1b963James DongpTable          RN 8
410c1bc742181ded4930842b46e9507372f0b1b963James Dongpc              RN 15
420c1bc742181ded4930842b46e9507372f0b1b963James Dong
430c1bc742181ded4930842b46e9507372f0b1b963James Dong;//--------------------------------------------
440c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Declare input registers
450c1bc742181ded4930842b46e9507372f0b1b963James Dong;//--------------------------------------------
460c1bc742181ded4930842b46e9507372f0b1b963James DongpSrcLeft        RN 0    ;// input pointer
470c1bc742181ded4930842b46e9507372f0b1b963James DongpSrcAbove       RN 1    ;// input pointer
480c1bc742181ded4930842b46e9507372f0b1b963James DongpSrcAboveLeft   RN 2    ;// input pointer
490c1bc742181ded4930842b46e9507372f0b1b963James DongpDst            RN 3    ;// output pointer
500c1bc742181ded4930842b46e9507372f0b1b963James DongleftStep        RN 4    ;// input variable
510c1bc742181ded4930842b46e9507372f0b1b963James DongdstStep         RN 5    ;// input variable
520c1bc742181ded4930842b46e9507372f0b1b963James DongpredMode        RN 6    ;// input variable
530c1bc742181ded4930842b46e9507372f0b1b963James Dongavailability    RN 7    ;// input variable
540c1bc742181ded4930842b46e9507372f0b1b963James DongpDst1           RN 1
550c1bc742181ded4930842b46e9507372f0b1b963James DongpDst2           RN 4
560c1bc742181ded4930842b46e9507372f0b1b963James DongpDst3           RN 6
570c1bc742181ded4930842b46e9507372f0b1b963James Dong
580c1bc742181ded4930842b46e9507372f0b1b963James DongpSrcTmp         RN 9
590c1bc742181ded4930842b46e9507372f0b1b963James DongsrcStep         RN 10
600c1bc742181ded4930842b46e9507372f0b1b963James DongpDstTmp         RN 11
610c1bc742181ded4930842b46e9507372f0b1b963James Dongdstep           RN 12
620c1bc742181ded4930842b46e9507372f0b1b963James Dong
630c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------
640c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Neon registers
650c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------
660c1bc742181ded4930842b46e9507372f0b1b963James Dong
670c1bc742181ded4930842b46e9507372f0b1b963James Dong;// OMX_VC_CHROMA_VERT
680c1bc742181ded4930842b46e9507372f0b1b963James DongdAboveU32       DN  D0.U32
690c1bc742181ded4930842b46e9507372f0b1b963James Dong
700c1bc742181ded4930842b46e9507372f0b1b963James Dong;// OMX_VC_CHROMA_HOR
710c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal0       DN  D0.8
720c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal1       DN  D1.8
730c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal2       DN  D2.8
740c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal3       DN  D3.8
750c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal0U32    DN  D0.U32
760c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal1U32    DN  D1.U32
770c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal2U32    DN  D2.U32
780c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal3U32    DN  D3.U32
790c1bc742181ded4930842b46e9507372f0b1b963James Dong
800c1bc742181ded4930842b46e9507372f0b1b963James Dong;// OMX_VC_4x4_DC
810c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftVal        DN  D0.U8
820c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftValU32     DN  D0.U32
830c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveLeftU16  DN  D1.U16
840c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveLeftU32  DN  D1.U32
850c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveLeftU64  DN  D1.U64
860c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveLeftU8 DN  D1.U8
870c1bc742181ded4930842b46e9507372f0b1b963James DongdSum            DN  D0.U8
880c1bc742181ded4930842b46e9507372f0b1b963James Dong
890c1bc742181ded4930842b46e9507372f0b1b963James DongdSumLeftValU16  DN  D1.U16
900c1bc742181ded4930842b46e9507372f0b1b963James DongdSumLeftValU32  DN  D1.U32
910c1bc742181ded4930842b46e9507372f0b1b963James DongdSumLeftValU64  DN  D1.U64
920c1bc742181ded4930842b46e9507372f0b1b963James DongdSumLeftValU8   DN  D1.U8
930c1bc742181ded4930842b46e9507372f0b1b963James Dong
940c1bc742181ded4930842b46e9507372f0b1b963James DongdAboveVal       DN  D0.U8
950c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveValU16  DN  D1.U16
960c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveValU32  DN  D1.U32
970c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveValU64  DN  D1.U64
980c1bc742181ded4930842b46e9507372f0b1b963James DongdSumAboveValU8   DN  D1.U8
990c1bc742181ded4930842b46e9507372f0b1b963James DongdConst128U8     DN  D0.U8
1000c1bc742181ded4930842b46e9507372f0b1b963James Dong
1010c1bc742181ded4930842b46e9507372f0b1b963James Dong
1020c1bc742181ded4930842b46e9507372f0b1b963James Dong;//OMX_VC_4x4_DIAG_DL
1030c1bc742181ded4930842b46e9507372f0b1b963James Dong
1040c1bc742181ded4930842b46e9507372f0b1b963James DongdAbove          DN  D0.U8
1050c1bc742181ded4930842b46e9507372f0b1b963James DongdU7             DN  D2.U8
1060c1bc742181ded4930842b46e9507372f0b1b963James DongdU3             DN  D2.U8
1070c1bc742181ded4930842b46e9507372f0b1b963James DongdAbove0         DN  D3.U8
1080c1bc742181ded4930842b46e9507372f0b1b963James DongdAbove1         DN  D4.U8
1090c1bc742181ded4930842b46e9507372f0b1b963James DongdAbove2         DN  D5.U8
1100c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp            DN  D6.U8
1110c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp0           DN  D7.U8
1120c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp1           DN  D8.U8
1130c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp2            DN  D9.U8
1140c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp3            DN  D10.U8
1150c1bc742181ded4930842b46e9507372f0b1b963James DongdTmpU32         DN  D6.U32
1160c1bc742181ded4930842b46e9507372f0b1b963James Dong
1170c1bc742181ded4930842b46e9507372f0b1b963James Dong
1180c1bc742181ded4930842b46e9507372f0b1b963James Dong;//OMX_VC_4x4_DIAG_DR
1190c1bc742181ded4930842b46e9507372f0b1b963James DongdLeft           DN  D1.U8
1200c1bc742181ded4930842b46e9507372f0b1b963James DongdUL             DN  D2.U8
1210c1bc742181ded4930842b46e9507372f0b1b963James Dong
1220c1bc742181ded4930842b46e9507372f0b1b963James Dong;//OMX_VC_4x4_VR
1230c1bc742181ded4930842b46e9507372f0b1b963James DongdLeft0          DN  D1.U8
1240c1bc742181ded4930842b46e9507372f0b1b963James DongdLeft1          DN  D2.U8
1250c1bc742181ded4930842b46e9507372f0b1b963James DongdEven0          DN  D3.U8
1260c1bc742181ded4930842b46e9507372f0b1b963James DongdEven1          DN  D4.U8
1270c1bc742181ded4930842b46e9507372f0b1b963James DongdEven2          DN  D5.U8
1280c1bc742181ded4930842b46e9507372f0b1b963James DongdOdd0           DN  D6.U8
1290c1bc742181ded4930842b46e9507372f0b1b963James DongdOdd1           DN  D11.U8
1300c1bc742181ded4930842b46e9507372f0b1b963James DongdOdd2           DN  D12.U8
1310c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp3U32        DN  D10.U32
1320c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp2U32        DN  D9.U32
1330c1bc742181ded4930842b46e9507372f0b1b963James Dong
1340c1bc742181ded4930842b46e9507372f0b1b963James Dong
1350c1bc742181ded4930842b46e9507372f0b1b963James Dong;//OMX_VC_4x4_HD
1360c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp1U64        DN  D8.U64
1370c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp0U64        DN  D7.U64
1380c1bc742181ded4930842b46e9507372f0b1b963James DongdTmpU64         DN  D6.U64
1390c1bc742181ded4930842b46e9507372f0b1b963James DongdTmpU32         DN  D6.U32
1400c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp1U32        DN  D8.U32
1410c1bc742181ded4930842b46e9507372f0b1b963James Dong
1420c1bc742181ded4930842b46e9507372f0b1b963James Dong;//OMX_VC_4x4_HU
1430c1bc742181ded4930842b46e9507372f0b1b963James DongdL3             DN  D2.U8
1440c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftHU0        DN  D3.U8
1450c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftHU1        DN  D4.U8
1460c1bc742181ded4930842b46e9507372f0b1b963James DongdLeftHU2        DN  D5.U8
1470c1bc742181ded4930842b46e9507372f0b1b963James DongdTmp0U32        DN  D7.U32
1480c1bc742181ded4930842b46e9507372f0b1b963James Dong
1490c1bc742181ded4930842b46e9507372f0b1b963James Dong
1500c1bc742181ded4930842b46e9507372f0b1b963James Dong
1510c1bc742181ded4930842b46e9507372f0b1b963James Dong
1520c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-----------------------------------------------------------------------------------------------
1530c1bc742181ded4930842b46e9507372f0b1b963James Dong;// omxVCM4P10_PredictIntra_4x4 starts
1540c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-----------------------------------------------------------------------------------------------
1550c1bc742181ded4930842b46e9507372f0b1b963James Dong
1560c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Write function header
1570c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_START omxVCM4P10_PredictIntra_4x4, r12,d12
1580c1bc742181ded4930842b46e9507372f0b1b963James Dong
1590c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Define stack arguments
1600c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_ARG    LeftStep,     4
1610c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_ARG    DstStep,      4
1620c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_ARG    PredMode,     4
1630c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_ARG    Availability, 4
1640c1bc742181ded4930842b46e9507372f0b1b963James Dong
1650c1bc742181ded4930842b46e9507372f0b1b963James Dong
1660c1bc742181ded4930842b46e9507372f0b1b963James Dong        LDR      pTable,=armVCM4P10_pSwitchTable4x4  ;// Load index table for switch case
1670c1bc742181ded4930842b46e9507372f0b1b963James Dong
1680c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load argument from the stack
1690c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_LDRD   predMode,availability,PredMode     ;// Arg predMode & availability loaded from stack to reg
1700c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_LDRD   leftStep,dstStep,LeftStep          ;// Arg leftStep & dstStep loaded from stack to reg
1710c1bc742181ded4930842b46e9507372f0b1b963James Dong
1720c1bc742181ded4930842b46e9507372f0b1b963James Dong
1730c1bc742181ded4930842b46e9507372f0b1b963James Dong        LDR      pc, [pTable, predMode, LSL #2]      ;// Branch to the case based on preMode
1740c1bc742181ded4930842b46e9507372f0b1b963James Dong
1750c1bc742181ded4930842b46e9507372f0b1b963James Dong
1760c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_HOR
1770c1bc742181ded4930842b46e9507372f0b1b963James Dong
1780c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pSrcTmp, pSrcLeft, leftStep
1790c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     srcStep, leftStep, leftStep
1800c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load Left Edge
1810c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal0[]},[pSrcLeft],srcStep           ;// pSrcLeft[0*leftStep]
1820c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal1[]},[pSrcTmp],srcStep            ;//    pSrcLeft[1*leftStep]
1830c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal2[]},[pSrcLeft]                   ;//    pSrcLeft[2*leftStep]
1840c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal3[]},[pSrcTmp]                    ;//    pSrcLeft[3*leftStep]
1850c1bc742181ded4930842b46e9507372f0b1b963James Dong
1860c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
1870c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
1880c1bc742181ded4930842b46e9507372f0b1b963James Dong
1890c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dLeftVal0U32[0],[pDst],dstep                ;// pDst[0*dstStep+x] :0<= x <= 7
1900c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dLeftVal1U32[0],[pDstTmp],dstep             ;// pDst[1*dstStep+x] :0<= x <= 7
1910c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dLeftVal2U32[0],[pDst]                      ;// pDst[2*dstStep+x] :0<= x <= 7
1920c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dLeftVal3U32[0],[pDstTmp]                   ;// pDst[3*dstStep+x] :0<= x <= 7
1930c1bc742181ded4930842b46e9507372f0b1b963James Dong
1940c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        ExitPredict4x4                             ;// Branch to exit code
1950c1bc742181ded4930842b46e9507372f0b1b963James Dong
1960c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_VERT
1970c1bc742181ded4930842b46e9507372f0b1b963James Dong
1980c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load Upper Edge
1990c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1     dAboveU32[0],[pSrcAbove]
2000c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
2010c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
2020c1bc742181ded4930842b46e9507372f0b1b963James Dong
2030c1bc742181ded4930842b46e9507372f0b1b963James DongDCPredict4x4VertStore
2040c1bc742181ded4930842b46e9507372f0b1b963James Dong
2050c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1     dAboveU32[0],[pDst],dstep
2060c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1     dAboveU32[0],[pDstTmp],dstep
2070c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1     dAboveU32[0],[pDst]
2080c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1     dAboveU32[0],[pDstTmp]
2090c1bc742181ded4930842b46e9507372f0b1b963James Dong
2100c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        ExitPredict4x4                             ;// Branch to exit code
2110c1bc742181ded4930842b46e9507372f0b1b963James Dong
2120c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_DC
2130c1bc742181ded4930842b46e9507372f0b1b963James Dong
2140c1bc742181ded4930842b46e9507372f0b1b963James Dong
2150c1bc742181ded4930842b46e9507372f0b1b963James Dong        TST     availability, #OMX_VC_LEFT
2160c1bc742181ded4930842b46e9507372f0b1b963James Dong        BEQ     DCPredict4x4LeftNotAvailable
2170c1bc742181ded4930842b46e9507372f0b1b963James Dong
2180c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pSrcTmp, pSrcLeft, leftStep
2190c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     srcStep, leftStep, leftStep
2200c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load Left Edge
2210c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal[0]},[pSrcLeft],srcStep            ;// pSrcLeft[0*leftStep]
2220c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal[1]},[pSrcTmp],srcStep             ;//    pSrcLeft[1*leftStep]
2230c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal[2]},[pSrcLeft]                    ;//    pSrcLeft[2*leftStep]
2240c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeftVal[3]},[pSrcTmp]                     ;//    pSrcLeft[3*leftStep]
2250c1bc742181ded4930842b46e9507372f0b1b963James Dong
2260c1bc742181ded4930842b46e9507372f0b1b963James Dong        TST     availability, #OMX_VC_UPPER
2270c1bc742181ded4930842b46e9507372f0b1b963James Dong        BEQ     DCPredict4x4LeftOnlyAvailable
2280c1bc742181ded4930842b46e9507372f0b1b963James Dong
2290c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load Upper Edge also
2300c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1     dLeftValU32[1],[pSrcAbove]                 ;// pSrcAbove[0 to 3]
2310c1bc742181ded4930842b46e9507372f0b1b963James Dong        MOV      return, #OMX_Sts_NoErr
2320c1bc742181ded4930842b46e9507372f0b1b963James Dong
2330c1bc742181ded4930842b46e9507372f0b1b963James Dong        VPADDL   dSumAboveLeftU16, dLeftVal                 ;// [pSrcAbove[2+3 | 0+1] | pSrcLeft[2+3 | 0+1]]
2340c1bc742181ded4930842b46e9507372f0b1b963James Dong        VPADDL   dSumAboveLeftU32, dSumAboveLeftU16         ;// [pSrcAbove[2+3+0+1] | pSrcLeft[2+3+0+1]]
2350c1bc742181ded4930842b46e9507372f0b1b963James Dong        VPADDL   dSumAboveLeftU64, dSumAboveLeftU32         ;// [pSrcAbove[2+3+0+1] + pSrcLeft[2+3+0+1]]
2360c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRSHR    dSumAboveLeftU64,dSumAboveLeftU64,#3       ;// Sum = (Sum + 4) >> 3
2370c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
2380c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
2390c1bc742181ded4930842b46e9507372f0b1b963James Dong        VDUP     dSum,dSumAboveLeftU8[0]
2400c1bc742181ded4930842b46e9507372f0b1b963James Dong
2410c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        DCPredict4x4VertStore
2420c1bc742181ded4930842b46e9507372f0b1b963James Dong
2430c1bc742181ded4930842b46e9507372f0b1b963James DongDCPredict4x4LeftOnlyAvailable
2440c1bc742181ded4930842b46e9507372f0b1b963James Dong
2450c1bc742181ded4930842b46e9507372f0b1b963James Dong        MOV      return, #OMX_Sts_NoErr                     ;// returnNoError
2460c1bc742181ded4930842b46e9507372f0b1b963James Dong
2470c1bc742181ded4930842b46e9507372f0b1b963James Dong        VPADDL   dSumLeftValU16, dLeftVal                   ;// [ XX | pSrcLeft[2+3 | 0+1]]
2480c1bc742181ded4930842b46e9507372f0b1b963James Dong        VPADDL   dSumLeftValU32, dSumLeftValU16             ;// [ XXXX | pSrcLeft[2+3+0+1]]
2490c1bc742181ded4930842b46e9507372f0b1b963James Dong
2500c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRSHR    dSumLeftValU32,dSumLeftValU32,#2           ;// Sum = (Sum + 2) >> 2
2510c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
2520c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
2530c1bc742181ded4930842b46e9507372f0b1b963James Dong        VDUP     dSum,dSumLeftValU8[0]
2540c1bc742181ded4930842b46e9507372f0b1b963James Dong
2550c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        DCPredict4x4VertStore
2560c1bc742181ded4930842b46e9507372f0b1b963James Dong
2570c1bc742181ded4930842b46e9507372f0b1b963James DongDCPredict4x4LeftNotAvailable
2580c1bc742181ded4930842b46e9507372f0b1b963James Dong
2590c1bc742181ded4930842b46e9507372f0b1b963James Dong        TST     availability, #OMX_VC_UPPER
2600c1bc742181ded4930842b46e9507372f0b1b963James Dong        BEQ     DCPredict4x4NoneAvailable
2610c1bc742181ded4930842b46e9507372f0b1b963James Dong
2620c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load Upper Edge
2630c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1     dAboveU32[0],[pSrcAbove]                   ;// pSrcAbove[0 to 3]
2640c1bc742181ded4930842b46e9507372f0b1b963James Dong        MOV      return, #OMX_Sts_NoErr
2650c1bc742181ded4930842b46e9507372f0b1b963James Dong
2660c1bc742181ded4930842b46e9507372f0b1b963James Dong        VPADDL   dSumAboveValU16, dAboveVal                 ;// [ XX | pSrcAbove[2+3 | 0+1]]
2670c1bc742181ded4930842b46e9507372f0b1b963James Dong        VPADDL   dSumAboveValU32, dSumAboveValU16           ;// [ XXXX | pSrcAbove[2+3+0+1]]
2680c1bc742181ded4930842b46e9507372f0b1b963James Dong
2690c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRSHR    dSumAboveValU32,dSumAboveValU32,#2         ;// Sum = (Sum + 2) >> 2
2700c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
2710c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
2720c1bc742181ded4930842b46e9507372f0b1b963James Dong        VDUP     dSum,dSumAboveValU8[0]
2730c1bc742181ded4930842b46e9507372f0b1b963James Dong
2740c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        DCPredict4x4VertStore
2750c1bc742181ded4930842b46e9507372f0b1b963James Dong
2760c1bc742181ded4930842b46e9507372f0b1b963James DongDCPredict4x4NoneAvailable
2770c1bc742181ded4930842b46e9507372f0b1b963James Dong
2780c1bc742181ded4930842b46e9507372f0b1b963James Dong        VMOV     dConst128U8,#0x80                          ;// 0x8080808080808080 if(count == 0)
2790c1bc742181ded4930842b46e9507372f0b1b963James Dong        MOV      return, #OMX_Sts_NoErr
2800c1bc742181ded4930842b46e9507372f0b1b963James Dong
2810c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
2820c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
2830c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        DCPredict4x4VertStore
2840c1bc742181ded4930842b46e9507372f0b1b963James Dong
2850c1bc742181ded4930842b46e9507372f0b1b963James Dong
2860c1bc742181ded4930842b46e9507372f0b1b963James Dong
2870c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_DIAG_DL
2880c1bc742181ded4930842b46e9507372f0b1b963James Dong
2890c1bc742181ded4930842b46e9507372f0b1b963James Dong        TST     availability, #OMX_VC_UPPER_RIGHT
2900c1bc742181ded4930842b46e9507372f0b1b963James Dong        BEQ     DiagDLUpperRightNotAvailable
2910c1bc742181ded4930842b46e9507372f0b1b963James Dong
2920c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAbove0,[pSrcAbove]                     ;// [U7|U6|U5|U4|U3|U2|U1|U0]
2930c1bc742181ded4930842b46e9507372f0b1b963James Dong        VDUP    dU7, dAbove0[7]                         ;// [U7|U7|U7|U7|U7|U7|U7|U7]
2940c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove1, dAbove0, dU7, #1               ;// [U7|U7|U6|U5|U4|U3|U2|U1]
2950c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove2, dAbove0, dU7, #2               ;// [U7|U7|U7|U6|U5|U4|U3|U2]
2960c1bc742181ded4930842b46e9507372f0b1b963James Dong        B       DiagDLPredict4x4Store
2970c1bc742181ded4930842b46e9507372f0b1b963James Dong
2980c1bc742181ded4930842b46e9507372f0b1b963James DongDiagDLUpperRightNotAvailable
2990c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAboveU32[1],[pSrcAbove]                ;// [U3|U2|U1|U0|-|-|-|-]
3000c1bc742181ded4930842b46e9507372f0b1b963James Dong        VDUP    dU3, dAbove[7]                          ;// [U3 U3 U3 U3 U3 U3 U3 U3]
3010c1bc742181ded4930842b46e9507372f0b1b963James Dong
3020c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove0, dAbove, dU3, #4                ;// [U3 U3 U3 U3 U3 U2 U1 U0]
3030c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove1, dAbove, dU3, #5                ;// [U3 U3 U3 U3 U3 U3 U2 U1]
3040c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove2, dAbove, dU3, #6                ;// [U3 U3 U3 U3 U3 U3 U3 U2]
3050c1bc742181ded4930842b46e9507372f0b1b963James Dong
3060c1bc742181ded4930842b46e9507372f0b1b963James DongDiagDLPredict4x4Store
3070c1bc742181ded4930842b46e9507372f0b1b963James Dong
3080c1bc742181ded4930842b46e9507372f0b1b963James Dong        VHADD   dTmp, dAbove0, dAbove2
3090c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp, dTmp, dAbove1                     ;// (a+2*b+c+2)>>2
3100c1bc742181ded4930842b46e9507372f0b1b963James Dong
3110c1bc742181ded4930842b46e9507372f0b1b963James Dong
3120c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst],dstStep
3130c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp,dTmp,dTmp,#1
3140c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst],dstStep
3150c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp,dTmp,dTmp,#1
3160c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst],dstStep
3170c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp,dTmp,dTmp,#1
3180c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst]
3190c1bc742181ded4930842b46e9507372f0b1b963James Dong
3200c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        ExitPredict4x4                         ;// Branch to exit code
3210c1bc742181ded4930842b46e9507372f0b1b963James Dong
3220c1bc742181ded4930842b46e9507372f0b1b963James Dong
3230c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_DIAG_DR
3240c1bc742181ded4930842b46e9507372f0b1b963James Dong
3250c1bc742181ded4930842b46e9507372f0b1b963James Dong
3260c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load U0,U1,U2,U3
3270c1bc742181ded4930842b46e9507372f0b1b963James Dong
3280c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAboveU32[0],[pSrcAbove]                ;// [X|X|X|X|U3|U2|U1|U0]
3290c1bc742181ded4930842b46e9507372f0b1b963James Dong
3300c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load UL,L0,L1,L2,L3                         ;// dLeft = [UL|L0|L1|L2|L3|X|X|X]
3310c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[7]},[pSrcAboveLeft]
3320c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pSrcTmp, pSrcLeft, leftStep
3330c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     srcStep, leftStep, leftStep
3340c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDst1,pDst,dstStep
3350c1bc742181ded4930842b46e9507372f0b1b963James Dong
3360c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[6]},[pSrcLeft],srcStep           ;// pSrcLeft[0*leftStep]
3370c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[5]},[pSrcTmp],srcStep            ;// pSrcLeft[1*leftStep]
3380c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[4]},[pSrcLeft]                   ;// pSrcLeft[2*leftStep]
3390c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[3]},[pSrcTmp]                    ;// pSrcLeft[3*leftStep]
3400c1bc742181ded4930842b46e9507372f0b1b963James Dong
3410c1bc742181ded4930842b46e9507372f0b1b963James Dong
3420c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove0,dLeft,dAbove,#3                 ;// [U2|U1|U0|UL|L0|L1|L2|L3]
3430c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDst2,pDst1,dstStep
3440c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove1,dLeft,dAbove,#4                 ;// [U3|U2|U1|U0|UL|L0|L1|L2]
3450c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDst3,pDst2,dstStep
3460c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove2,dLeft,dAbove,#5                 ;// [ X|U3|U2|U1|U0|UL|L0|L1]
3470c1bc742181ded4930842b46e9507372f0b1b963James Dong
3480c1bc742181ded4930842b46e9507372f0b1b963James Dong        VHADD   dTmp, dAbove0, dAbove2
3490c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp, dTmp, dAbove1                     ;// (a+2*b+c+2)>>2
3500c1bc742181ded4930842b46e9507372f0b1b963James Dong
3510c1bc742181ded4930842b46e9507372f0b1b963James Dong
3520c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst3]                      ;// Store pTmp[0],[1],[2],[3] @ pDst3
3530c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp,dTmp,dTmp,#1
3540c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst2]                      ;// Store pTmp[1],[2],[3],[4] @ pDst2
3550c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp,dTmp,dTmp,#1
3560c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst1]                      ;// Store pTmp[2],[3],[4],[5] @ pDst1
3570c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp,dTmp,dTmp,#1
3580c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDst]                       ;// Store pTmp[3],[4],[5],[6] @ pDst
3590c1bc742181ded4930842b46e9507372f0b1b963James Dong
3600c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        ExitPredict4x4                         ;// Branch to exit code
3610c1bc742181ded4930842b46e9507372f0b1b963James Dong
3620c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_VR
3630c1bc742181ded4930842b46e9507372f0b1b963James Dong
3640c1bc742181ded4930842b46e9507372f0b1b963James Dong
3650c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load UL,U0,U1,U2,U3
3660c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAboveU32[0],[pSrcAbove]
3670c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAbove[7],[pSrcAboveLeft]               ;// [UL|X|X|X|U3|U2|U1|U0]
3680c1bc742181ded4930842b46e9507372f0b1b963James Dong
3690c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load L0,L1,L2                               ;// dLeft0 = [L0|L2|X|X|X|X|X|X]
3700c1bc742181ded4930842b46e9507372f0b1b963James Dong                                                        ;// dLeft1 = [L1| X|X|X|X|X|X|X]
3710c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft0[7]},[pSrcLeft],leftStep         ;// pSrcLeft[0*leftStep]
3720c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft1[7]},[pSrcLeft],leftStep         ;// pSrcLeft[1*leftStep]
3730c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft0[6]},[pSrcLeft]                  ;// pSrcLeft[2*leftStep]
3740c1bc742181ded4930842b46e9507372f0b1b963James Dong
3750c1bc742181ded4930842b46e9507372f0b1b963James Dong
3760c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dOdd2,dAbove,dAbove,#7                  ;// [ x x x U3 U2 U1 U0 UL ]
3770c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dEven0,dLeft0,dOdd2,#6                  ;// [ x x x U1 U0 UL L0 L2 ]
3780c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dEven1,dLeft1,dOdd2,#7                  ;// [ x x x U2 U1 U0 UL L1 ]
3790c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dEven2,dLeft0,dAbove,#7                 ;// [ x x x U3 U2 U1 U0 L0 ]
3800c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dOdd0,dLeft1,dAbove,#7                  ;// [ x x x U3 U2 U1 U0 L1 ]
3810c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dOdd1,dLeft0,dOdd2,#7                   ;// [ x x x U2 U1 U0 UL L0 ]
3820c1bc742181ded4930842b46e9507372f0b1b963James Dong
3830c1bc742181ded4930842b46e9507372f0b1b963James Dong        VHADD   dTmp1, dOdd0, dOdd2
3840c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp1, dTmp1, dOdd1                     ;// Tmp[ x x x 9 7 5 3 1 ]
3850c1bc742181ded4930842b46e9507372f0b1b963James Dong
3860c1bc742181ded4930842b46e9507372f0b1b963James Dong        VHADD   dTmp0, dEven0, dEven2
3870c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp0, dTmp0, dEven1                    ;// Tmp[ x x x 8 6 4 2 0 ]
3880c1bc742181ded4930842b46e9507372f0b1b963James Dong
3890c1bc742181ded4930842b46e9507372f0b1b963James Dong
3900c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp3,dTmp1,dTmp1,#1                    ;// Tmp[ x x x x 9 7 5 3 ]
3910c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
3920c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
3930c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp2,dTmp0,dTmp0,#1                    ;// Tmp[ x x x x 8 6 4 2 ]
3940c1bc742181ded4930842b46e9507372f0b1b963James Dong
3950c1bc742181ded4930842b46e9507372f0b1b963James Dong
3960c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp3U32[0],[pDst],dstep                ;// Tmp[9],[7],[5],[3]
3970c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp2U32[0],[pDstTmp],dstep             ;// Tmp[8],[6],[4],[2]
3980c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp1U32[0],[pDst],dstep                ;// Tmp[7],[5],[3],[1]
3990c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp0U32[0],[pDstTmp]                   ;// Tmp[6],[4],[2],[0]
4000c1bc742181ded4930842b46e9507372f0b1b963James Dong
4010c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        ExitPredict4x4                         ;// Branch to exit code
4020c1bc742181ded4930842b46e9507372f0b1b963James Dong
4030c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_HD
4040c1bc742181ded4930842b46e9507372f0b1b963James Dong
4050c1bc742181ded4930842b46e9507372f0b1b963James Dong
4060c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load U0,U1,U2,U3
4070c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAbove,[pSrcAbove]                      ;//dAboveLeftVal = [U7|U6|U5|U4|U3|U2|U1|U0]
4080c1bc742181ded4930842b46e9507372f0b1b963James Dong
4090c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load UL,L0,L1,L2,L3                         ;// dLeft = [UL|L0|L1|L2|L3|X|X|X]
4100c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[7]},[pSrcAboveLeft]
4110c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pSrcTmp, pSrcLeft, leftStep
4120c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     srcStep, leftStep, leftStep
4130c1bc742181ded4930842b46e9507372f0b1b963James Dong
4140c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[6]},[pSrcLeft],srcStep           ;// pSrcLeft[0*leftStep]
4150c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[5]},[pSrcTmp],srcStep            ;// pSrcLeft[1*leftStep]
4160c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[4]},[pSrcLeft]                   ;// pSrcLeft[2*leftStep]
4170c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[3]},[pSrcTmp]                    ;// pSrcLeft[3*leftStep]
4180c1bc742181ded4930842b46e9507372f0b1b963James Dong
4190c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove0,dLeft,dAbove,#3                 ;// [ U2|U1|U0|UL|L0|L1|L2|L3 ]
4200c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove1,dLeft,dAbove,#2                 ;// [ U1|U0|UL|L0|L1|L2|L3|X ]
4210c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove2,dLeft,dAbove,#1                 ;// [ U0|UL|L0|L1|L2|L3|X|X ]
4220c1bc742181ded4930842b46e9507372f0b1b963James Dong
4230c1bc742181ded4930842b46e9507372f0b1b963James Dong        VHADD   dTmp0, dAbove0, dAbove2
4240c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp0, dTmp0, dAbove1                   ;// Tmp[ 0 | 1 | 2 | 4 | 6 | 8 | X | X ]
4250c1bc742181ded4930842b46e9507372f0b1b963James Dong
4260c1bc742181ded4930842b46e9507372f0b1b963James Dong
4270c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp1, dAbove1, dAbove0                 ;// (a+b+1)>>1
4280c1bc742181ded4930842b46e9507372f0b1b963James Dong        VSHL    dTmp1U64,dTmp1U64,#24                   ;// Tmp[ 3|5| 7 |9 | X | X | X | X ]
4290c1bc742181ded4930842b46e9507372f0b1b963James Dong
4300c1bc742181ded4930842b46e9507372f0b1b963James Dong
4310c1bc742181ded4930842b46e9507372f0b1b963James Dong        VSHL    dTmpU64,dTmp0U64,#16                    ;// Tmp[ 2|4|6|8| X | X | X | X ]
4320c1bc742181ded4930842b46e9507372f0b1b963James Dong        VZIP    dTmp1,dTmp                              ;// dTmp = [ 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ]
4330c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp0,dTmp0,dTmp0,#6                    ;// Tmp[  X| X| X| X| X| X| 0 | 1 ]
4340c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp1,dTmp,dTmp0,#2                     ;// Tmp[ 0 | 1 | 2 | 3 | 4 | 5 | 6 |7 ]
4350c1bc742181ded4930842b46e9507372f0b1b963James Dong
4360c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
4370c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
4380c1bc742181ded4930842b46e9507372f0b1b963James Dong
4390c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp1U32[1],[pDst],dstep                ;// Store pTmp[0|1|2|3]
4400c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[1],[pDstTmp],dstep              ;// Store pTmp[2|3|4|5]
4410c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp1U32[0],[pDst]                      ;// Store pTmp[4|5|6|7]
4420c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmpU32[0],[pDstTmp]                    ;// Store pTmp[6|7|8|9]
4430c1bc742181ded4930842b46e9507372f0b1b963James Dong
4440c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        ExitPredict4x4                         ;// Branch to exit code
4450c1bc742181ded4930842b46e9507372f0b1b963James Dong
4460c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_VL
4470c1bc742181ded4930842b46e9507372f0b1b963James Dong
4480c1bc742181ded4930842b46e9507372f0b1b963James Dong
4490c1bc742181ded4930842b46e9507372f0b1b963James Dong        TST     availability, #OMX_VC_UPPER_RIGHT
4500c1bc742181ded4930842b46e9507372f0b1b963James Dong        BEQ     DiagVLUpperRightNotAvailable
4510c1bc742181ded4930842b46e9507372f0b1b963James Dong
4520c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAbove0,[pSrcAbove]                      ;// [U7|U6|U5|U4|U3|U2|U1|U0]
4530c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove1,dAbove0,dAbove0,#1               ;// [ X|U7|U6|U5|U4|U3|U2|U1]
4540c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove2,dAbove1,dAbove1,#1               ;// [ X| X|U7|U6|U5|U4|U3|U2]
4550c1bc742181ded4930842b46e9507372f0b1b963James Dong
4560c1bc742181ded4930842b46e9507372f0b1b963James Dong        B       DiagVLPredict4x4Store
4570c1bc742181ded4930842b46e9507372f0b1b963James Dong
4580c1bc742181ded4930842b46e9507372f0b1b963James DongDiagVLUpperRightNotAvailable
4590c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    dAboveU32[1],[pSrcAbove]                 ;// [U3|U2|U1|U0|-|-|-|-]
4600c1bc742181ded4930842b46e9507372f0b1b963James Dong        VDUP    dU3, dAbove[7]                           ;// [U3 U3 U3 U3 U3 U3 U3 U3]
4610c1bc742181ded4930842b46e9507372f0b1b963James Dong
4620c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove0, dAbove, dU3, #4                 ;// [U3 U3 U3 U3 U3 U2 U1 U0]
4630c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove1, dAbove, dU3, #5                 ;// [U3 U3 U3 U3 U3 U3 U2 U1]
4640c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dAbove2, dAbove, dU3, #6                 ;// [U3 U3 U3 U3 U3 U3 U3 U2]
4650c1bc742181ded4930842b46e9507372f0b1b963James Dong
4660c1bc742181ded4930842b46e9507372f0b1b963James DongDiagVLPredict4x4Store
4670c1bc742181ded4930842b46e9507372f0b1b963James Dong
4680c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp0, dAbove1, dAbove0                 ;// (a+b+1)>>1
4690c1bc742181ded4930842b46e9507372f0b1b963James Dong                                                        ;// Tmp[ X| X| X| 8| 6| 4| 2| 0 ]
4700c1bc742181ded4930842b46e9507372f0b1b963James Dong
4710c1bc742181ded4930842b46e9507372f0b1b963James Dong        VHADD   dTmp3, dAbove0, dAbove2
4720c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp3, dTmp3, dAbove1                   ;// (a+2*b+c+2)>>2
4730c1bc742181ded4930842b46e9507372f0b1b963James Dong                                                        ;// Tmp[ X| X| X| 9| 7| 5| 3| 1 ]
4740c1bc742181ded4930842b46e9507372f0b1b963James Dong
4750c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp1,dTmp0,dTmp0,#1                    ;// Tmp[ X| X| X| X| 8| 6| 4| 2 ]
4760c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pDstTmp, pDst, dstStep
4770c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     dstep, dstStep, dstStep
4780c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp2,dTmp3,dTmp1,#1                    ;// Tmp[ X| X| X| X| 9| 7| 5| 3 ]
4790c1bc742181ded4930842b46e9507372f0b1b963James Dong
4800c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp0U32[0],[pDst],dstep                ;// Tmp[6],[4],[2],[0]
4810c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp3U32[0],[pDstTmp],dstep             ;// Tmp[7],[5],[3],[1]
4820c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp1U32[0],[pDst]                      ;// Tmp[8],[6],[4],[2]
4830c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp2U32[0],[pDstTmp]                   ;// Tmp[9],[7],[5],[3]
4840c1bc742181ded4930842b46e9507372f0b1b963James Dong
4850c1bc742181ded4930842b46e9507372f0b1b963James Dong        B        ExitPredict4x4                         ;// Branch to exit code
4860c1bc742181ded4930842b46e9507372f0b1b963James Dong
4870c1bc742181ded4930842b46e9507372f0b1b963James DongOMX_VC_4x4_HU
4880c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     pSrcTmp, pSrcLeft, leftStep
4890c1bc742181ded4930842b46e9507372f0b1b963James Dong        ADD     srcStep, leftStep, leftStep
4900c1bc742181ded4930842b46e9507372f0b1b963James Dong
4910c1bc742181ded4930842b46e9507372f0b1b963James Dong        ;// Load Left Edge                              ;// [L3|L2|L1|L0|X|X|X|X]
4920c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[4]},[pSrcLeft],srcStep           ;// pSrcLeft[0*leftStep]
4930c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[5]},[pSrcTmp],srcStep            ;// pSrcLeft[1*leftStep]
4940c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[6]},[pSrcLeft]                   ;// pSrcLeft[2*leftStep]
4950c1bc742181ded4930842b46e9507372f0b1b963James Dong        VLD1    {dLeft[7]},[pSrcTmp]                    ;// pSrcLeft[3*leftStep]
4960c1bc742181ded4930842b46e9507372f0b1b963James Dong
4970c1bc742181ded4930842b46e9507372f0b1b963James Dong        VDUP    dL3,dLeft[7]                            ;// [L3|L3|L3|L3|L3|L3|L3|L3]
4980c1bc742181ded4930842b46e9507372f0b1b963James Dong
4990c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dLeftHU0,dLeft,dL3,#4                   ;// [L3|L3|L3|L3|L3|L2|L1|L0]
5000c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dLeftHU1,dLeft,dL3,#5                   ;// [L3|L3|L3|L3|L3|L3|L2|L1]
5010c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dLeftHU2,dLeft,dL3,#6                   ;// [L3|L3|L3|L3|L3|L3|L3|L2]
5020c1bc742181ded4930842b46e9507372f0b1b963James Dong
5030c1bc742181ded4930842b46e9507372f0b1b963James Dong        VHADD   dTmp0, dLeftHU0, dLeftHU2
5040c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp0, dTmp0, dLeftHU1                  ;// Tmp[ L3 | L3 | L3 | L3 | L3 | 5 | 3 | 1 ]
5050c1bc742181ded4930842b46e9507372f0b1b963James Dong
5060c1bc742181ded4930842b46e9507372f0b1b963James Dong        VRHADD  dTmp1, dLeftHU1, dLeftHU0               ;// (a+b+1)>>1
5070c1bc742181ded4930842b46e9507372f0b1b963James Dong                                                        ;//  Tmp[ L3 | L3 | L3 | L3 | L3 | 4 | 2 | 0 ]
5080c1bc742181ded4930842b46e9507372f0b1b963James Dong
5090c1bc742181ded4930842b46e9507372f0b1b963James Dong        VZIP    dTmp1,dTmp0                             ;// dTmp1 = Tmp[7| 6| 5| 4| 3| 2| 1| 0]
5100c1bc742181ded4930842b46e9507372f0b1b963James Dong                                                        ;// dTmp0 = [L3|L3|L3|L3|L3|L3|L3|L3]
5110c1bc742181ded4930842b46e9507372f0b1b963James Dong
5120c1bc742181ded4930842b46e9507372f0b1b963James Dong
5130c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp1U32[0],[pDst],dstStep              ;// [3|2|1|0]
5140c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp1,dTmp1,dTmp1,#2
5150c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp1U32[0],[pDst],dstStep              ;// [5|4|3|2]
5160c1bc742181ded4930842b46e9507372f0b1b963James Dong        VEXT    dTmp1,dTmp1,dTmp1,#2
5170c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp1U32[0],[pDst],dstStep              ;// [7|6|5|4]
5180c1bc742181ded4930842b46e9507372f0b1b963James Dong        VST1    dTmp0U32[0],[pDst]                      ;// [9|8|7|6]
5190c1bc742181ded4930842b46e9507372f0b1b963James Dong
5200c1bc742181ded4930842b46e9507372f0b1b963James Dong
5210c1bc742181ded4930842b46e9507372f0b1b963James DongExitPredict4x4
5220c1bc742181ded4930842b46e9507372f0b1b963James Dong
5230c1bc742181ded4930842b46e9507372f0b1b963James Dong        MOV      return,  #OMX_Sts_NoErr
5240c1bc742181ded4930842b46e9507372f0b1b963James Dong        M_END
5250c1bc742181ded4930842b46e9507372f0b1b963James Dong
5260c1bc742181ded4930842b46e9507372f0b1b963James Dong        ENDIF ;// CortexA8
5270c1bc742181ded4930842b46e9507372f0b1b963James Dong
5280c1bc742181ded4930842b46e9507372f0b1b963James Dong        END
5290c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-----------------------------------------------------------------------------------------------
5300c1bc742181ded4930842b46e9507372f0b1b963James Dong;// omxVCM4P10_PredictIntra_4x4 ends
5310c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-----------------------------------------------------------------------------------------------
532