1 /** 2 * 3 * File Name: armVCM4P2_Huff_Tables_VLC.c 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 * File: armVCM4P2_Huff_Tables_VLC.c 13 * Description: Contains all the Huffman tables used in MPEG4 codec 14 * 15 */ 16 17#include "omxtypes.h" 18#include "armOMX.h" 19 20#include "armCOMM_Bitstream.h" 21 22 23 24 25// Contains optimized and Packed VLC tables with Last=0 and Last=1 26 27// optimized Packed VLC table Entry Format 28// --------------------------------------- 29// 30// 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 31// +------------------------------------------------+ 32// | Len | Run | Level |L | 1 | 33// +------------------------------------------------+ 34// | Offset | 0 | 35// +------------------------------------------------+ 36// If the table entry is a leaf entry then bit 0 set: 37// Len = Number of bits overread (0 to 7) 3 bits 38// Run = RunLength of the Symbol (0 to 63) 6 bits 39// Level = Level of the Symbol (0 to 31) 5 bits 40// L = Last Value of the Symbol (0 or 1) 1 bit 41// 42// If the table entry is an internal node then bit 0 is clear: 43// Offset = Number of (16-bit) half words from the table 44// start to the next table node 45// 46// The table is accessed by successive lookup up on the 47// next Step bits of the input bitstream until a leaf node 48// is obtained. The Step sizes are supplied to the VLD macro. 49 50// The VLC tables used for Intra and non inta coefficients in non Escape mode 51// contains symbols with both Last=0 and Last=1. 52// If a symbol is not found in the table it will be coded as 0xFFF 53 54 55const OMX_U16 armVCM4P2_InterVlcL0L1[200] = { 56 0x0020, 0x0108, 0x0148, 0x0170, 0x0178, 0x0180, 0x0188, 0x1b09, 57 0x4009, 0x4009, 0x4009, 0x4009, 0x2109, 0x2109, 0x0209, 0x0011, 58 0x0028, 0x0060, 0x00b8, 0x00e0, 0x0030, 0x0048, 0x0050, 0x0058, 59 0x3fff, 0x3fff, 0x0038, 0x0040, 0x2115, 0x2115, 0x201d, 0x201d, 60 0x2059, 0x2059, 0x2051, 0x2051, 0x1c0d, 0x1b0d, 0x1a0d, 0x190d, 61 0x0911, 0x0811, 0x0711, 0x0611, 0x0511, 0x0319, 0x0219, 0x0121, 62 0x0068, 0x0090, 0x3fff, 0x3fff, 0x0070, 0x0078, 0x0080, 0x0088, 63 0x2061, 0x2061, 0x2129, 0x2129, 0x3709, 0x3709, 0x3809, 0x3809, 64 0x3d0d, 0x3d0d, 0x3e0d, 0x3e0d, 0x3f0d, 0x3f0d, 0x200d, 0x200d, 65 0x0098, 0x00a0, 0x00a8, 0x00b0, 0x0131, 0x0221, 0x0419, 0x0519, 66 0x0619, 0x0a11, 0x1909, 0x1a09, 0x210d, 0x220d, 0x230d, 0x240d, 67 0x250d, 0x260d, 0x270d, 0x280d, 0x00c0, 0x00c8, 0x00d0, 0x00d8, 68 0x0049, 0x0041, 0x380d, 0x380d, 0x370d, 0x370d, 0x360d, 0x360d, 69 0x350d, 0x350d, 0x340d, 0x340d, 0x330d, 0x330d, 0x320d, 0x320d, 70 0x00e8, 0x00f0, 0x00f8, 0x0100, 0x310d, 0x310d, 0x2015, 0x2015, 71 0x3609, 0x3609, 0x3509, 0x3509, 0x3409, 0x3409, 0x3309, 0x3309, 72 0x3209, 0x3209, 0x3109, 0x3109, 0x0110, 0x0130, 0x0138, 0x0140, 73 0x0118, 0x0120, 0x0128, 0x100d, 0x3009, 0x3009, 0x2f09, 0x2f09, 74 0x2411, 0x2411, 0x2311, 0x2311, 0x2039, 0x2039, 0x2031, 0x2031, 75 0x0f0d, 0x0e0d, 0x0d0d, 0x0c0d, 0x0b0d, 0x0a0d, 0x090d, 0x0e09, 76 0x0d09, 0x0211, 0x0119, 0x0029, 0x0150, 0x0158, 0x0160, 0x0168, 77 0x280d, 0x280d, 0x270d, 0x270d, 0x260d, 0x260d, 0x250d, 0x250d, 78 0x2c09, 0x2c09, 0xb759, 0xb759, 0x2a09, 0x2a09, 0x2021, 0x2021, 79 0x040d, 0x030d, 0x0b35, 0x010d, 0x0909, 0x0809, 0x0709, 0x0609, 80 0x0111, 0x0019, 0x2509, 0x2509, 0x2409, 0x2409, 0x2309, 0x2309 81}; 82 83 84const OMX_U16 armVCM4P2_IntraVlcL0L1[200] = { 85 0x0020, 0x0108, 0x0148, 0x0170, 0x0178, 0x0180, 0x0188, 0x0f09, 86 0x4009, 0x4009, 0x4009, 0x4009, 0x2011, 0x2011, 0x0109, 0x0019, 87 0x0028, 0x0060, 0x00b8, 0x00e0, 0x0030, 0x0048, 0x0050, 0x0058, 88 0x3fff, 0x3fff, 0x0038, 0x0040, 0x203d, 0x203d, 0x2035, 0x2035, 89 0x20b1, 0x20b1, 0x20a9, 0x20a9, 0x0215, 0x011d, 0x002d, 0x0d09, 90 0x0519, 0x0811, 0x0419, 0x0321, 0x0221, 0x0139, 0x00a1, 0x0099, 91 0x0068, 0x0090, 0x3fff, 0x3fff, 0x0070, 0x0078, 0x0080, 0x0088, 92 0x20b9, 0x20b9, 0x20c1, 0x20c1, 0x2141, 0x2141, 0x2911, 0x2911, 93 0x2315, 0x2315, 0x2415, 0x2415, 0x2f0d, 0x2f0d, 0x300d, 0x300d, 94 0x0098, 0x00a0, 0x00a8, 0x00b0, 0x00c9, 0x00d1, 0x00d9, 0x0149, 95 0x0619, 0x0151, 0x0229, 0x0719, 0x0e09, 0x0045, 0x0515, 0x0615, 96 0x110d, 0x120d, 0x130d, 0x140d, 0x00c0, 0x00c8, 0x00d0, 0x00d8, 97 0x0091, 0x0089, 0x2e0d, 0x2e0d, 0x2d0d, 0x2d0d, 0x2c0d, 0x2c0d, 98 0x2b0d, 0x2b0d, 0x2a0d, 0x2a0d, 0x2115, 0x2115, 0x2025, 0x2025, 99 0x00e8, 0x00f0, 0x00f8, 0x0100, 0x2c09, 0x2c09, 0x2b09, 0x2b09, 100 0x2711, 0x2711, 0x2611, 0x2611, 0x2511, 0x2511, 0x2319, 0x2319, 101 0x2219, 0x2219, 0x2131, 0x2131, 0x0110, 0x0130, 0x0138, 0x0140, 102 0x0118, 0x0120, 0x0128, 0x080d, 0x2129, 0x2129, 0x2081, 0x2081, 103 0x2411, 0x2411, 0x2079, 0x2079, 0x2071, 0x2071, 0x2069, 0x2069, 104 0x1bb5, 0x060d, 0x001d, 0xd3f9, 0x0909, 0x0809, 0x090d, 0x0311, 105 0x0121, 0x0061, 0x0059, 0x0051, 0x0150, 0x0158, 0x0160, 0x0168, 106 0x240d, 0x240d, 0x230d, 0x230d, 0x2609, 0x2609, 0x250d, 0x250d, 107 0x2709, 0x2709, 0x2211, 0x2211, 0x2119, 0x2119, 0x2049, 0x2049, 108 0x0015, 0x0509, 0x020d, 0x010d, 0x0409, 0x0309, 0x0041, 0x0039, 109 0x0111, 0x0031, 0x2209, 0x2209, 0x2029, 0x2029, 0x2021, 0x2021 110}; 111 112const OMX_U16 armVCM4P2_aIntraDCLumaChromaIndex[64] = { 113 0x0020, 0x000b, 0x2009, 0x2009, 0x2007, 0x2007, 0x2001, 0x2001, 114 0x4005, 0x4005, 0x4005, 0x4005, 0x4003, 0x4003, 0x4003, 0x4003, 115 0x0028, 0x000f, 0x200d, 0x200d, 0x0030, 0x0013, 0x2011, 0x2011, 116 0x0038, 0x0017, 0x2015, 0x2015, 0x3fff, 0x3fff, 0x2019, 0x2019, 117 118 0x0020, 0x0009, 0x2007, 0x2007, 0x4005, 0x4005, 0x4005, 0x4005, 119 0x4003, 0x4003, 0x4003, 0x4003, 0x4001, 0x4001, 0x4001, 0x4001, 120 0x0028, 0x000d, 0x200b, 0x200b, 0x0030, 0x0011, 0x200f, 0x200f, 121 0x0038, 0x0015, 0x2013, 0x2013, 0x1fff, 0x0019, 0x2017, 0x2017 122}; 123 124 125const OMX_U16 armVCM4P2_aVlcMVD[124] = { 126 0x0010, 0x00f0, 0x0043, 0x003f, 0x4041, 0x4041, 0x4041, 0x4041, 127 0x0018, 0x00d8, 0x0047, 0x003b, 0x0020, 0x0080, 0x00a8, 0x00d0, 128 0x0028, 0x0048, 0x0070, 0x0078, 0x1fff, 0x0030, 0x0038, 0x0040, 129 0x0081, 0x0001, 0x007f, 0x0003, 0x207d, 0x207d, 0x2005, 0x2005, 130 0x207b, 0x207b, 0x2007, 0x2007, 0x0050, 0x0058, 0x0060, 0x0068, 131 0x2079, 0x2079, 0x2009, 0x2009, 0x2077, 0x2077, 0x200b, 0x200b, 132 0x2075, 0x2075, 0x200d, 0x200d, 0x2073, 0x2073, 0x200f, 0x200f, 133 0x0071, 0x0011, 0x006f, 0x0013, 0x006d, 0x0015, 0x006b, 0x0017, 134 0x0088, 0x0090, 0x0098, 0x00a0, 0x0069, 0x0019, 0x0067, 0x001b, 135 0x0065, 0x001d, 0x0063, 0x001f, 0x0061, 0x0021, 0x005f, 0x0023, 136 0x005d, 0x0025, 0x005b, 0x0027, 0x00b0, 0x00b8, 0x00c0, 0x00c8, 137 0x0059, 0x0029, 0x0057, 0x002b, 0x2055, 0x2055, 0x202d, 0x202d, 138 0x2053, 0x2053, 0x202f, 0x202f, 0x2051, 0x2051, 0x2031, 0x2031, 139 0x204f, 0x204f, 0x2033, 0x2033, 0x00e0, 0x00e8, 0x0049, 0x0039, 140 0x204d, 0x204d, 0x2035, 0x2035, 0x204b, 0x204b, 0x2037, 0x2037, 141 0x2045, 0x2045, 0x203d, 0x203d 142}; 143 144/* LMAX table for non Inter (Last == 0 and Last=1) 145 Level - 1 Indexed 146 padded armVCM4P2_InterL0L1LMAX[27-31] with zeros to acess entries for Last=1 effectively 147 148*/ 149const OMX_U8 armVCM4P2_InterL0L1LMAX[73] = 150{ 151 12, 6, 4, 3, 3, 3, 3, 2, 152 2, 2, 2, 1, 1, 1, 1, 1, 153 1, 1, 1, 1, 1, 1, 1, 1, 154 1, 1, 1, 0, 0, 0, 0, 0, 155 3, 2, 1, 1, 1, 1, 1, 1, 156 1, 1, 1, 1, 1, 1, 1, 1, 157 1, 1, 1, 1, 1, 1, 1, 1, 158 1, 1, 1, 1, 1, 1, 1, 1, 159 1, 1, 1, 1, 1, 1, 1, 1, 160 1 161}; 162 163/* RMAX table for non Inter (Last == 0 and Last=1) 164 Level - 1 Indexed 165 padded armVCM4P2_InterL0L1RMAX[12-31] with zeros to access entries for Last=1 table effectively */ 166 167 168const OMX_U8 armVCM4P2_InterL0L1RMAX[35] = 169{ 170 26, 10, 6, 2, 1, 1, 171 0, 0, 0, 0, 0, 0, 172 0, 0, 0, 0, 0, 0, 173 0, 0, 0, 0, 0, 0, 174 0, 0, 0, 0, 175 0, 0, 0, 0, 40, 1, 0 176}; 177 178/* LMAX table for non Intra (Last == 0 and Last=1) 179 Level - 1 Indexed 180 padded armVCM4P2_IntraL0L1LMAX[15-31] with zeros to acess entries for Last=1 effectively 181 182*/ 183const OMX_U8 armVCM4P2_IntraL0L1LMAX[53] = 184{ 185 27, 10, 5, 4, 3, 3, 3, 186 3, 2, 2, 1, 1, 1, 1, 1, 0, 187 0, 0, 0, 0, 0, 0, 0, 0, 188 0, 0, 0, 0, 0, 0, 0, 0, 189 190 8, 3, 2, 2, 2, 2, 2, 1, 191 1, 1, 1, 1, 1, 1, 1, 1, 192 1, 1, 1, 1, 1 193}; 194 195 196/* RMAX table for non Inter (Last == 0 and Last=1) 197 Level - 1 Indexed 198 padded armVCM4P2_IntraL0L1RMAX[27-31] with zeros to access entries for Last=1 table effectively */ 199 200 201const OMX_U8 armVCM4P2_IntraL0L1RMAX[40] = 202{ 203 14, 9, 7, 3, 2, 1, 1, 204 1, 1, 1, 0, 0, 0, 0, 205 0, 0, 0, 0, 0, 0, 0, 206 0, 0, 0, 0, 0, 0, 0, 207 0, 0, 0, 0, 208 209 20, 6, 1, 0, 0, 0, 0, 0 210 211}; 212