1 ;// 2 ;// Copyright (C) 2007-2008 ARM Limited 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 express or implied. 13 ;// See the License for the specific language governing permissions and 14 ;// limitations under the License. 15 ;// 16 ;/** 17 ; * 18 ; * File Name: omxVCM4P2_DecodeVLCZigzag_IntraACVLC_s.s 19 ; * OpenMAX DL: v1.0.2 20 ; * Revision: 12290 21 ; * Date: Wednesday, April 9, 2008 22 ; * 23 ; * 24 ; * 25 ; * 26 ; * Description: 27 ; * Contains modules for zigzag scanning and VLC decoding 28 ; * for inter block. 29 ; * 30 ; * 31 ; * 32 ; * Function: omxVCM4P2_DecodeVLCZigzag_Inter 33 ; * 34 ; * Description: 35 ; * Performs VLC decoding and inverse zigzag scan for one intra coded block. 36 ; * 37 ; * Remarks: 38 ; * 39 ; * Parameters: 40 ; * [in] ppBitStream pointer to the pointer to the current byte in 41 ; * the bitstream buffer 42 ; * [in] pBitOffset pointer to the bit position in the byte pointed 43 ; * to by *ppBitStream. *pBitOffset is valid within [0-7]. 44 ; * [in] shortVideoHeader binary flag indicating presence of short_video_header; 45 ; * escape modes 0-3 are used if shortVideoHeader==0, 46 ; * and escape mode 4 is used when shortVideoHeader==1. 47 ; * [out] ppBitStream *ppBitStream is updated after the block is 48 ; * decoded, so that it points to the current byte 49 ; * in the bit stream buffer 50 ; * [out] pBitOffset *pBitOffset is updated so that it points to the 51 ; * current bit position in the byte pointed by 52 ; * *ppBitStream 53 ; * [out] pDst pointer to the coefficient buffer of current 54 ; * block. Must be 16-byte aligned 55 ; * 56 ; * Return Value: 57 ; * OMX_Sts_BadArgErr - bad arguments 58 ; * -At least one of the following pointers is NULL: ppBitStream, *ppBitStream, pBitOffset, pDst, or 59 ; * -pDst is not 16-byte aligned, or 60 ; * -*pBitOffset exceeds [0,7]. 61 ; * OMX_Sts_Err - status error 62 ; * -At least one mark bit is equal to zero 63 ; * -Encountered an illegal stream code that cannot be found in the VLC table 64 ; * -Encountered and illegal code in the VLC FLC table 65 ; * -The number of coefficients is greater than 64 66 ; * 67 ; */ 68 69 70 INCLUDE omxtypes_s.h 71 INCLUDE armCOMM_s.h 72 INCLUDE armCOMM_BitDec_s.h 73 74 75 M_VARIANTS ARM1136JS 76 77 78 79 80 81 IF ARM1136JS 82 83 ;// Import various tables needed for the function 84 85 86 IMPORT armVCM4P2_IntraVlcL0L1 ;// Contains optimized and packed VLC Tables for both Last =1 and last=0 87 ;// Packed in Run:Level:Last format 88 IMPORT armVCM4P2_IntraL0L1LMAX ;// Contains LMAX table entries with both Last=0 and Last=1 89 IMPORT armVCM4P2_IntraL0L1RMAX ;// Contains RMAX table entries with both Last=0 and Last=1 90 IMPORT armVCM4P2_aClassicalZigzagScan ;// contains classical Zigzag table entries with double the original values 91 IMPORT armVCM4P2_DecodeVLCZigzag_AC_unsafe 92 93 ;//Input Arguments 94 95 ppBitStream RN 0 96 pBitOffset RN 1 97 pDst RN 2 98 PredDir RN 3 99 shortVideoHeader RN 3 100 101 ;//Local Variables 102 103 Return RN 0 104 105 pVlcTableL0L1 RN 4 106 pLMAXTableL0L1 RN 4 107 pRMAXTableL0L1 RN 4 108 pZigzagTable RN 4 109 Count RN 6 110 111 112 113 ;// Allocate stack memory to store optimized VLC,Zigzag, RMAX, LMAX Table Addresses 114 115 M_ALLOC4 ppVlcTableL0L1,4 116 M_ALLOC4 ppLMAXTableL0L1,4 117 M_ALLOC4 ppRMAXTableL0L1,4 118 M_ALLOC4 ppZigzagTable,4 119 120 121 M_START omxVCM4P2_DecodeVLCZigzag_IntraACVLC,r12 122 123 M_ARG shortVideoHeaderonStack,4 ;// pointer to Input Argument on stack 124 125 LDR pZigzagTable, =armVCM4P2_aClassicalZigzagScan ;// Load Address of the Zigzag table 126 ADD pZigzagTable, pZigzagTable, PredDir, LSL #6 ;// Loading Different type of zigzag tables based on PredDir 127 128 M_STR pZigzagTable,ppZigzagTable ;// Store Zigzag table address on stack 129 LDR pVlcTableL0L1, =armVCM4P2_IntraVlcL0L1 ;// Load optimized packed VLC Table with both L=0 and L=1 entries 130 M_STR pVlcTableL0L1,ppVlcTableL0L1 ;// Store VLC Table address on stack 131 LDR pLMAXTableL0L1, =armVCM4P2_IntraL0L1LMAX ;// Load LMAX Table 132 M_STR pLMAXTableL0L1,ppLMAXTableL0L1 ;// Store LMAX Table address on Stack 133 LDR pRMAXTableL0L1, =armVCM4P2_IntraL0L1RMAX ;// Load RMAX Table 134 MOV Count,#0 ;// Set Start=0 135 136 M_STR pRMAXTableL0L1,ppRMAXTableL0L1 ;// Store RMAX Table address on stack 137 138 139 140 M_LDR shortVideoHeader,shortVideoHeaderonStack ;// get the Input Argument from stack 141 142 BL armVCM4P2_DecodeVLCZigzag_AC_unsafe ;// Call Unsafe Function 143 144 145 146 147 M_END 148 ENDIF 149 150 END 151