1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 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 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 19 #include "mp4dec_api.h" 20 #include "mp4def.h" 21 #include "zigzag.h" 22 /*---------------------------------------------------------------------------- 23 ; MACROS 24 ; Define module specific macros here 25 ----------------------------------------------------------------------------*/ 26 27 28 /*---------------------------------------------------------------------------- 29 ; DEFINES 30 ; Include all pre-processor statements here. Include conditional 31 ; compile variables also. 32 ----------------------------------------------------------------------------*/ 33 34 /*---------------------------------------------------------------------------- 35 ; LOCAL FUNCTION DEFINITIONS 36 ; Function Prototype declaration 37 ----------------------------------------------------------------------------*/ 38 39 40 /*---------------------------------------------------------------------------- 41 ; LOCAL STORE/BUFFER/POINTER DEFINITIONS 42 ; Variable declaration - defined here and used outside this module 43 ----------------------------------------------------------------------------*/ 44 const int zigzag_inv[3*NCOEFF_BLOCK] = 45 { 46 0, 1, 8, 16, 9, 2, 3, 10, 47 17, 24, 32, 25, 18, 11, 4, 5, 48 12, 19, 26, 33, 40, 48, 41, 34, 49 27, 20, 13, 6, 7, 14, 21, 28, 50 35, 42, 49, 56, 57, 50, 43, 36, 51 29, 22, 15, 23, 30, 37, 44, 51, 52 58, 59, 52, 45, 38, 31, 39, 46, 53 53, 60, 61, 54, 47, 55, 62, 63, 54 //}; 55 56 /* Vertical inverse zigzag */ 57 //const static Int zigzag_v_inv[NCOEFF_BLOCK] = { 58 0, 8, 16, 24, 1, 9, 2, 10, 59 17, 25, 32, 40, 48, 56, 57, 49, 60 41, 33, 26, 18, 3, 11, 4, 12, 61 19, 27, 34, 42, 50, 58, 35, 43, 62 51, 59, 20, 28, 5, 13, 6, 14, 63 21, 29, 36, 44, 52, 60, 37, 45, 64 53, 61, 22, 30, 7, 15, 23, 31, 65 38, 46, 54, 62, 39, 47, 55, 63, 66 //}; 67 /* Horizontal inverse zigzag*/ 68 //const static Int zizag_h_inv[NCOEFF_BLOCK] = { 69 0, 1, 2, 3, 8, 9, 16, 17, 70 10, 11, 4, 5, 6, 7, 15, 14, 71 13, 12, 19, 18, 24, 25, 32, 33, 72 26, 27, 20, 21, 22, 23, 28, 29, 73 30, 31, 34, 35, 40, 41, 48, 49, 74 42, 43, 36, 37, 38, 39, 44, 45, 75 46, 47, 50, 51, 56, 57, 58, 59, 76 52, 53, 54, 55, 60, 61, 62, 63 77 }; 78 79 /*---------------------------------------------------------------------------- 80 ; EXTERNAL FUNCTION REFERENCES 81 ; Declare functions defined elsewhere and referenced in this module 82 ----------------------------------------------------------------------------*/ 83 84 85 /*---------------------------------------------------------------------------- 86 ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES 87 ; Declare variables used in this module but defined elsewhere 88 ----------------------------------------------------------------------------*/ 89 90 91 /*---------------------------------------------------------------------------- 92 ; FUNCTION CODE 93 ----------------------------------------------------------------------------*/ 94 95 96 /*---------------------------------------------------------------------------- 97 ; Define all local variables 98 ----------------------------------------------------------------------------*/ 99 100 101 /*---------------------------------------------------------------------------- 102 ; Function body here 103 ----------------------------------------------------------------------------*/ 104 105 106 /*---------------------------------------------------------------------------- 107 ; Return nothing or data or data pointer 108 ----------------------------------------------------------------------------*/ 109 110 111