1 ;/** 2 ; * 3 ; * File Name: omxVCM4P2_QuantInvInter_I_s.s 4 ; * OpenMAX DL: v1.0.2 5 ; * Revision: 9641 6 ; * Date: Thursday, February 7, 2008 7 ; * 8 ; * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. 9 ; * 10 ; * 11 ; * 12 ; * Description: 13 ; * Contains modules for inter reconstruction 14 ; * 15 ; * 16 ; * 17 ; * 18 ; * 19 ; * Function: omxVCM4P2_QuantInvInter_I 20 ; * 21 ; * Description: 22 ; * Performs inverse quantization on intra/inter coded block. 23 ; * This function supports bits_per_pixel = 8. Mismatch control 24 ; * is performed for the first MPEG-4 mode inverse quantization method. 25 ; * The output coefficients are clipped to the range: [-2048, 2047]. 26 ; * Mismatch control is performed for the first inverse quantization method. 27 ; * 28 ; * Remarks: 29 ; * 30 ; * Parameters: 31 ; * [in] pSrcDst pointer to the input (quantized) intra/inter block. Must be 16-byte aligned. 32 ; * [in] QP quantization parameter (quantiser_scale) 33 ; * [in] videoComp (Intra version only.) Video component type of the 34 ; * current block. Takes one of the following flags: 35 ; * OMX_VC_LUMINANCE, OMX_VC_CHROMINANCE, 36 ; * OMX_VC_ALPHA. 37 ; * [in] shortVideoHeader a flag indicating presence of short_video_header; 38 ; * shortVideoHeader==1 selects linear intra DC mode, 39 ; * and shortVideoHeader==0 selects nonlinear intra DC mode. 40 ; * [out] pSrcDst pointer to the output (dequantized) intra/inter block. Must be 16-byte aligned. 41 ; * 42 ; * Return Value: 43 ; * OMX_Sts_NoErr - no error 44 ; * OMX_Sts_BadArgErr - bad arguments 45 ; * - If pSrcDst is NULL or is not 16-byte aligned. 46 ; * or 47 ; * - If QP <= 0. 48 ; * or 49 ; * - videoComp is none of OMX_VC_LUMINANCE, OMX_VC_CHROMINANCE and OMX_VC_ALPHA. 50 ; * 51 ; */ 52 53 INCLUDE omxtypes_s.h 54 INCLUDE armCOMM_s.h 55 56 M_VARIANTS ARM1136JS 57 58 59 60 IF ARM1136JS 61 62 ;//Input Arguments 63 pSrcDst RN 0 64 QP RN 1 65 66 ;//Local Variables 67 Return RN 0 68 Count RN 4 69 tempVal21 RN 2 70 tempVal43 RN 3 71 QP1 RN 5 72 X2 RN 6 73 X3 RN 14 74 Result1 RN 8 75 Result2 RN 9 76 two RN 7 77 78 M_START omxVCM4P2_QuantInvInter_I,r9 79 80 MOV Count,#64 81 TST QP,#1 82 LDRD tempVal21,[pSrcDst] ;// Loads first two values of pSrcDst to tempVal21, 83 ;// next two values to tempVal43 84 SUBEQ QP1,QP,#1 ;// QP1=QP if QP is odd , QP1=QP-1 if QP is even 85 MOVNE QP1,QP 86 MOV two,#2 87 88 89 90 Loop 91 92 93 SMULBB X2,tempVal21,two ;// X2= first val(lower 16 bits of tampVal21)*2 94 CMP X2,#0 95 96 RSBLT X2,X2,#0 ;// X2=absoluteval(first val) 97 SMLABBNE X2,QP,X2,QP1 ;// X2=2*absval(first val)*QP+QP if QP is odd 98 ;// X2=2*absval(first val)*QP+QP-1 if QP is even 99 SMULTB X3,tempVal21,two ;// X3= second val(top 16 bits of tampVal21)*2 100 RSBLT X2,X2,#0 101 102 CMP X3,#0 103 104 RSBLT X3,X3,#0 105 SMLABBNE X3,QP,X3,QP1 106 107 RSBLT X3,X3,#0 108 PKHBT Result1,X2,X3,LSL #16 ;// Result1[0-15]=X2[0-15],Result1[16-31]=X3[16-31] 109 SMULBB X2,tempVal43,two ;// X2= first val(lower 16 bits of tampVal43)*2 110 SSAT16 Result1,#12,Result1 ;// clip to range [-2048,2047] 111 CMP X2,#0 112 113 114 115 RSBLE X2,X2,#0 116 SMLABBNE X2,QP,X2,QP1 117 SMULTB X3,tempVal43,two ;// X2= first val(top 16 bits of tampVal21)*2 118 RSBLT X2,X2,#0 119 CMP X3,#0 120 121 LDRD tempVal21,[pSrcDst,#8] ;// Load next four Values to tempVal21,tempVal43 122 123 RSBLT X3,X3,#0 124 SMLABBNE X3,QP,X3,QP1 125 RSBLT X3,X3,#0 126 PKHBT Result2,X2,X3,LSL #16 ;// Result2[0-15]=X2[0-15],Result2[16-31]=X3[0-15] 127 SSAT16 Result2,#12,Result2 ;// clip to range [-2048,2047] 128 129 SUBS Count,Count,#4 ;// Decrement Count by 4 and continue if it has not reached 0 130 STRD Result1,[pSrcDst],#8 ;// Store Double words and increment the pointer to point the next store address 131 132 133 134 BGT Loop 135 136 MOV Return,#OMX_Sts_NoErr 137 138 M_END 139 ENDIF 140 END 141 142