10c1bc742181ded4930842b46e9507372f0b1b963James Dong;// 20c1bc742181ded4930842b46e9507372f0b1b963James Dong;// 30c1bc742181ded4930842b46e9507372f0b1b963James Dong;// File Name: omxVCM4P10_TransformDequantChromaDCFromPair_s.s 40c1bc742181ded4930842b46e9507372f0b1b963James Dong;// OpenMAX DL: v1.0.2 50c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Revision: 9641 60c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Date: Thursday, February 7, 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 IMPORT armVCM4P10_QPDivTable 180c1bc742181ded4930842b46e9507372f0b1b963James Dong IMPORT armVCM4P10_VMatrixQPModTable 190c1bc742181ded4930842b46e9507372f0b1b963James Dong 200c1bc742181ded4930842b46e9507372f0b1b963James Dong M_VARIANTS ARM1136JS 210c1bc742181ded4930842b46e9507372f0b1b963James Dong 220c1bc742181ded4930842b46e9507372f0b1b963James Dong 230c1bc742181ded4930842b46e9507372f0b1b963James Dong IF ARM1136JS 240c1bc742181ded4930842b46e9507372f0b1b963James Dong 250c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------------- 260c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Declare input registers 270c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------------- 280c1bc742181ded4930842b46e9507372f0b1b963James DongppSrc RN 0 290c1bc742181ded4930842b46e9507372f0b1b963James DongpDst RN 1 300c1bc742181ded4930842b46e9507372f0b1b963James DongQP RN 2 310c1bc742181ded4930842b46e9507372f0b1b963James Dong 320c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------- 330c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Scratch variable for Unpack2x2 340c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------- 350c1bc742181ded4930842b46e9507372f0b1b963James DongpSrc RN 9 360c1bc742181ded4930842b46e9507372f0b1b963James DongValue RN 4 370c1bc742181ded4930842b46e9507372f0b1b963James DongValue2 RN 5 380c1bc742181ded4930842b46e9507372f0b1b963James DongFlag RN 6 390c1bc742181ded4930842b46e9507372f0b1b963James DongstrOffset RN 7 400c1bc742181ded4930842b46e9507372f0b1b963James DongcstOffset RN 8 410c1bc742181ded4930842b46e9507372f0b1b963James Dong 420c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------- 430c1bc742181ded4930842b46e9507372f0b1b963James Dong;// Scratch variable 440c1bc742181ded4930842b46e9507372f0b1b963James Dong;//-------------------------------- 450c1bc742181ded4930842b46e9507372f0b1b963James Dongr0w0 RN 3 460c1bc742181ded4930842b46e9507372f0b1b963James Dongr0w1 RN 4 470c1bc742181ded4930842b46e9507372f0b1b963James Dong 480c1bc742181ded4930842b46e9507372f0b1b963James Dongc0w0 RN 5 490c1bc742181ded4930842b46e9507372f0b1b963James Dongc1w0 RN 6 500c1bc742181ded4930842b46e9507372f0b1b963James Dong 510c1bc742181ded4930842b46e9507372f0b1b963James Dongreturn RN 0 520c1bc742181ded4930842b46e9507372f0b1b963James DongpQPDivTable RN 5 530c1bc742181ded4930842b46e9507372f0b1b963James DongpQPModTable RN 6 540c1bc742181ded4930842b46e9507372f0b1b963James DongShift RN 9 550c1bc742181ded4930842b46e9507372f0b1b963James DongScale RN 2 560c1bc742181ded4930842b46e9507372f0b1b963James Dong 570c1bc742181ded4930842b46e9507372f0b1b963James DongTemp1 RN 3 580c1bc742181ded4930842b46e9507372f0b1b963James DongTemp2 RN 4 590c1bc742181ded4930842b46e9507372f0b1b963James DongTemp3 RN 7 600c1bc742181ded4930842b46e9507372f0b1b963James DongTemp4 RN 8 610c1bc742181ded4930842b46e9507372f0b1b963James Dong 620c1bc742181ded4930842b46e9507372f0b1b963James Dong ;// Write function header 630c1bc742181ded4930842b46e9507372f0b1b963James Dong M_START omxVCM4P10_TransformDequantChromaDCFromPair, r9 640c1bc742181ded4930842b46e9507372f0b1b963James Dong 650c1bc742181ded4930842b46e9507372f0b1b963James Dong 660c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR pSrc, [ppSrc] ;// Load pSrc 670c1bc742181ded4930842b46e9507372f0b1b963James Dong MOV cstOffset, #31 ;// To be used in the loop, to compute offset 680c1bc742181ded4930842b46e9507372f0b1b963James Dong 690c1bc742181ded4930842b46e9507372f0b1b963James Dong ;//----------------------------------------------------------------------- 700c1bc742181ded4930842b46e9507372f0b1b963James Dong ;// Firstly, fill all the coefficient values on the <pDst> buffer by zero 710c1bc742181ded4930842b46e9507372f0b1b963James Dong ;//----------------------------------------------------------------------- 720c1bc742181ded4930842b46e9507372f0b1b963James Dong 730c1bc742181ded4930842b46e9507372f0b1b963James Dong MOV Value, #0 ;// Initialize the zero value 740c1bc742181ded4930842b46e9507372f0b1b963James Dong MOV Value2, #0 ;// Initialize the zero value 750c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRB Flag, [pSrc], #1 ;// Preload <Flag> before <unpackLoop> 760c1bc742181ded4930842b46e9507372f0b1b963James Dong STRD Value, [pDst, #0] ;// pDst[0] = pDst[1] = pDst[2] = pDst[3] = 0 770c1bc742181ded4930842b46e9507372f0b1b963James Dong 780c1bc742181ded4930842b46e9507372f0b1b963James Dong 790c1bc742181ded4930842b46e9507372f0b1b963James DongunpackLoop 800c1bc742181ded4930842b46e9507372f0b1b963James Dong TST Flag, #0x10 ;// Computing (Flag & 0x10) 810c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRSBNE Value2,[pSrc,#1] 820c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRBNE Value, [pSrc], #2 ;// Load byte wise to avoid unaligned access 830c1bc742181ded4930842b46e9507372f0b1b963James Dong AND strOffset, cstOffset, Flag, LSL #1 ;// strOffset = (Flag & 15) < 1; 840c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRSBEQ Value, [pSrc], #1 ;// Value = (OMX_U8) *pSrc++ 850c1bc742181ded4930842b46e9507372f0b1b963James Dong ORRNE Value,Value,Value2, LSL #8 ;// Value = (OMX_U16) *pSrc++ 860c1bc742181ded4930842b46e9507372f0b1b963James Dong 870c1bc742181ded4930842b46e9507372f0b1b963James Dong TST Flag, #0x20 ;// Computing (Flag & 0x20) to check, if we're done 880c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRBEQ Flag, [pSrc], #1 ;// Flag = (OMX_U8) *pSrc++, for next iteration 890c1bc742181ded4930842b46e9507372f0b1b963James Dong STRH Value, [pDst, strOffset] ;// Store <Value> at offset <strOffset> 900c1bc742181ded4930842b46e9507372f0b1b963James Dong BEQ unpackLoop ;// Branch to the loop beginning 910c1bc742181ded4930842b46e9507372f0b1b963James Dong 920c1bc742181ded4930842b46e9507372f0b1b963James Dong LDMIA pDst, {r0w0, r0w1} ;// r0w0 = |c1|c0| & r0w1 = |c3|c2| 930c1bc742181ded4930842b46e9507372f0b1b963James Dong 940c1bc742181ded4930842b46e9507372f0b1b963James Dong 950c1bc742181ded4930842b46e9507372f0b1b963James Dong STR pSrc, [ppSrc] ;// Update the bitstream pointer 960c1bc742181ded4930842b46e9507372f0b1b963James Dong 970c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR pQPDivTable, =armVCM4P10_QPDivTable ;// QP Division look-up-table base pointer 980c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR pQPModTable, =armVCM4P10_VMatrixQPModTable ;// QP Modulo look-up-table base pointer 990c1bc742181ded4930842b46e9507372f0b1b963James Dong 1000c1bc742181ded4930842b46e9507372f0b1b963James Dong SADDSUBX r0w0, r0w0, r0w0 ;// [ c00+c01, c00-c01 ] 1010c1bc742181ded4930842b46e9507372f0b1b963James Dong SADDSUBX r0w1, r0w1, r0w1 ;// [ c10+c11, c10-c11 ] 1020c1bc742181ded4930842b46e9507372f0b1b963James Dong 1030c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRSB Shift, [pQPDivTable, QP] ;// Shift = pQPDivTable[QP] 1040c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRSB Scale, [pQPModTable, QP] ;// Scale = pQPModTable[QP] 1050c1bc742181ded4930842b46e9507372f0b1b963James Dong 1060c1bc742181ded4930842b46e9507372f0b1b963James Dong SADD16 c0w0, r0w0, r0w1 ;// [ d00+d10, d01+d11 ] 1070c1bc742181ded4930842b46e9507372f0b1b963James Dong SSUB16 c1w0, r0w0, r0w1 ;// [ d00-d10, d01-d11 ] 1080c1bc742181ded4930842b46e9507372f0b1b963James Dong 1090c1bc742181ded4930842b46e9507372f0b1b963James Dong LSL Scale, Scale, Shift ;// Scale = Scale << Shift 1100c1bc742181ded4930842b46e9507372f0b1b963James Dong 1110c1bc742181ded4930842b46e9507372f0b1b963James Dong SMULTB Temp2, c0w0, Scale ;// Temp2 = T(c0w0) * Scale 1120c1bc742181ded4930842b46e9507372f0b1b963James Dong SMULTB Temp4, c1w0, Scale ;// Temp4 = T(c1w0) * Scale 1130c1bc742181ded4930842b46e9507372f0b1b963James Dong SMULBB Temp1, c0w0, Scale ;// Temp1 = B(c0w0) * Scale 1140c1bc742181ded4930842b46e9507372f0b1b963James Dong SMULBB Temp3, c1w0, Scale ;// Temp3 = B(c1w0) * Scale 1150c1bc742181ded4930842b46e9507372f0b1b963James Dong MOV Temp2, Temp2, ASR #1 ;// Temp2 = Temp2 >> 1 & Temp1 = (Temp1 >> 1) << 16 1160c1bc742181ded4930842b46e9507372f0b1b963James Dong MOV Temp4, Temp4, ASR #1 ;// Temp4 = Temp4 >> 1 & Temp3 = (Temp3 >> 1) << 16 1170c1bc742181ded4930842b46e9507372f0b1b963James Dong PKHBT c0w0, Temp2, Temp1, LSL #15 ;// c0w0 = | Temp1 | Temp2 | 1180c1bc742181ded4930842b46e9507372f0b1b963James Dong PKHBT c1w0, Temp4, Temp3, LSL #15 ;// c1w0 = | Temp3 | Temp4 | 1190c1bc742181ded4930842b46e9507372f0b1b963James Dong STMIA pDst, {c0w0, c1w0} ;// Storing all the coefficients at once 1200c1bc742181ded4930842b46e9507372f0b1b963James Dong MOV return, #OMX_Sts_NoErr 1210c1bc742181ded4930842b46e9507372f0b1b963James Dong M_END 1220c1bc742181ded4930842b46e9507372f0b1b963James Dong 1230c1bc742181ded4930842b46e9507372f0b1b963James Dong ENDIF ;// ARM1136JS 1240c1bc742181ded4930842b46e9507372f0b1b963James Dong 1250c1bc742181ded4930842b46e9507372f0b1b963James Dong 1260c1bc742181ded4930842b46e9507372f0b1b963James Dong 1270c1bc742181ded4930842b46e9507372f0b1b963James Dong 1280c1bc742181ded4930842b46e9507372f0b1b963James Dong END 129