omxVCM4P2_DecodeVLCZigzag_Inter_s.s revision 78e52bfac041d71ce53b5b13c2abf78af742b09d
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_Inter_s.s
19; * OpenMAX DL: v1.0.2
20; * Revision:   9641
21; * Date:       Thursday, February 7, 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 inter 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_InterVlcL0L1             ;// Contains optimized and packed VLC Tables for both Last =1 and last=0
87                                                               ;// Packed in Run:Level:Last format
88        IMPORT          armVCM4P2_InterL0L1LMAX            ;// Contains LMAX table entries with both Last=0 and Last=1
89        IMPORT          armVCM4P2_InterL0L1RMAX            ;// 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
94
95;//Input Arguments
96
97ppBitStream          RN 0
98pBitOffset           RN 1
99pDst                 RN 2
100shortVideoHeader     RN 3
101
102;//Local Variables
103
104Return               RN 0
105
106pVlcTableL0L1        RN 4
107pLMAXTableL0L1       RN 4
108pRMAXTableL0L1       RN 4
109pZigzagTable         RN 4
110Count                RN 6
111
112
113
114        ;// Allocate stack memory to store the VLC,Zigzag,LMAX and RMAX tables
115
116
117        M_ALLOC4        ppVlcTableL0L1,4
118        M_ALLOC4        ppLMAXTableL0L1,4
119        M_ALLOC4        ppRMAXTableL0L1,4
120        M_ALLOC4        ppZigzagTable,4
121
122
123        M_START omxVCM4P2_DecodeVLCZigzag_Inter,r12
124
125
126
127
128        LDR             pZigzagTable, =armVCM4P2_aClassicalZigzagScan       ;// Load zigzag table
129        M_STR           pZigzagTable,ppZigzagTable                              ;// Store zigzag table on stack to pass as argument to unsafe function
130        LDR             pVlcTableL0L1, =armVCM4P2_InterVlcL0L1              ;// Load optimized VLC table with both L=0 and L=1 entries
131        M_STR           pVlcTableL0L1,ppVlcTableL0L1                            ;// Store optimized VLC table address on stack
132        LDR             pLMAXTableL0L1, =armVCM4P2_InterL0L1LMAX            ;// Load Interleaved L=0 and L=1 LMAX Tables
133        M_STR           pLMAXTableL0L1,ppLMAXTableL0L1                          ;// Store LMAX table address on stack
134        LDR             pRMAXTableL0L1, =armVCM4P2_InterL0L1RMAX            ;// Load Interleaved L=0 and L=1 RMAX Tables
135        MOV             Count,#0                                                ;// set start=0
136        M_STR           pRMAXTableL0L1,ppRMAXTableL0L1                          ;// store RMAX table address on stack
137
138
139        BL              armVCM4P2_DecodeVLCZigzag_AC_unsafe                 ;// call Unsafe Function for VLC Zigzag Decoding
140
141
142
143        M_END
144        ENDIF
145
146        END
147