History

Move common tables and definitions into the common library

Martin Storsjö committed 12 years ago

Commit 4af37a71 parent 44ebe7d12 files · +414 −568Browse files

Showing the changes to codec/decoder/core/src/decoder_data_tables.cpp (1 of 12 files). Show all

Unified · Split

codec/decoder/core/src/decoder_data_tables.cpp+0−108
@@ -40,40 +40,6 @@ namespace WelsDec { · 39 unmodified lines
40 40
41///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////41///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
42 42
43//////non_zero_count[16+8] mapping scan index
44const uint8_t g_kuiMbCountScan4Idx[24] = {
45 // 0 1 | 4 5 luma 8*8 block non_zero_count[16+8]
46 0, 1, 4, 5, // 2 3 | 6 7 0 | 1 0 1 2 3
47 2, 3, 6, 7, //--------------- --------- 4 5 6 7
48 8, 9, 12, 13, // 8 9 | 12 13 2 | 3 8 9 10 11
49 10, 11, 14, 15, // 10 11 | 14 15-----------------------------> 12 13 14 15
50 16, 17, 20, 21, //---------------- chroma 8*8 block 16 17 18 19
51 18, 19, 22, 23 // 16 17 | 20 21 0 1 20 21 22 23
52};
53//cache element equal to 26
54
55const uint8_t g_kuiCache48CountScan4Idx[24] = {
56 /* Luma */
57 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8,
58 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8,
59 25, 26, 33, 34, // 1+3*8, 2+3*8, 1+4*8, 2+4*8,
60 27, 28, 35, 36, // 3+3*8, 4+3*8, 3+4*8, 4+4*8,
61 /* Cb */
62 14, 15, // 6+1*8, 7+1*8,
63 22, 23, // 6+2*8, 7+2*8,
64
65 /* Cr */
66 38, 39, // 6+4*8, 7+4*8,
67 46, 47, // 6+5*8, 7+5*8,
68};
69
70//cache element equal to 30
71const uint8_t g_kuiCache30ScanIdx[16] = { //mv or ref_index cache scan index, 4*4 block as basic unit
72 7, 8, 13, 14,
73 9, 10, 15, 16,
74 19, 20, 25, 26,
75 21, 22, 27, 28
76};
77 43
78const uint8_t g_kuiScan4[16] = { //for mb cache in sMb (only current element, without neighbor)44const uint8_t g_kuiScan4[16] = { //for mb cache in sMb (only current element, without neighbor)
79 // 4*4block scan mb cache order45 // 4*4block scan mb cache order
@@ -87,51 +53,6 @@ const uint8_t g_kuiScan4[16] = { //for mb cache in sMb (only current element, wi · 7 unmodified lines
87 53
88// extern at wels_common_basis.h54// extern at wels_common_basis.h
89 55
90const uint8_t g_kuiChromaQpTable[52] = {
91 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
92 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
93 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 37,
94 37, 38, 38, 38, 39, 39, 39, 39
95};
96
97/*
98 * vcl type map for given NAL unit type and corresponding H264 type
99 */
100const VclType g_kuiVclTypeMap[32][2] = {
101 { NON_VCL, NON_VCL }, // 0: NAL_UNIT_UNSPEC_0
102 { VCL, VCL, }, // 1: NAL_UNIT_CODED_SLICE
103 { VCL, NOT_APP }, // 2: NAL_UNIT_CODED_SLICE_DPA
104 { VCL, NOT_APP }, // 3: NAL_UNIT_CODED_SLICE_DPB
105 { VCL, NOT_APP }, // 4: NAL_UNIT_CODED_SLICE_DPC
106 { VCL, VCL }, // 5: NAL_UNIT_CODED_SLICE_IDR
107 { NON_VCL, NON_VCL }, // 6: NAL_UNIT_SEI
108 { NON_VCL, NON_VCL }, // 7: NAL_UNIT_SPS
109 { NON_VCL, NON_VCL }, // 8: NAL_UNIT_PPS
110 { NON_VCL, NON_VCL }, // 9: NAL_UNIT_AU_DELIMITER
111 { NON_VCL, NON_VCL }, // 10: NAL_UNIT_END_OF_SEQ
112 { NON_VCL, NON_VCL }, // 11: NAL_UNIT_END_OF_STR
113 { NON_VCL, NON_VCL }, // 12: NAL_UNIT_FILLER_DATA
114 { NON_VCL, NON_VCL }, // 13: NAL_UNIT_SPS_EXT
115 { NON_VCL, NON_VCL }, // 14: NAL_UNIT_PREFIX, NEED associate succeeded NAL to make a VCL
116 { NON_VCL, NON_VCL }, // 15: NAL_UNIT_SUBSET_SPS
117 { NON_VCL, NON_VCL }, // 16: NAL_UNIT_RESV_16
118 { NON_VCL, NON_VCL }, // 17: NAL_UNIT_RESV_17
119 { NON_VCL, NON_VCL }, // 18: NAL_UNIT_RESV_18
120 { NON_VCL, NON_VCL }, // 19: NAL_UNIT_AUX_CODED_SLICE
121 { NON_VCL, VCL }, // 20: NAL_UNIT_CODED_SLICE_EXT
122 { NON_VCL, NON_VCL }, // 21: NAL_UNIT_RESV_21
123 { NON_VCL, NON_VCL }, // 22: NAL_UNIT_RESV_22
124 { NON_VCL, NON_VCL }, // 23: NAL_UNIT_RESV_23
125 { NON_VCL, NON_VCL }, // 24: NAL_UNIT_UNSPEC_24
126 { NON_VCL, NON_VCL }, // 25: NAL_UNIT_UNSPEC_25
127 { NON_VCL, NON_VCL }, // 26: NAL_UNIT_UNSPEC_26
128 { NON_VCL, NON_VCL }, // 27: NAL_UNIT_UNSPEC_27
129 { NON_VCL, NON_VCL }, // 28: NAL_UNIT_UNSPEC_28
130 { NON_VCL, NON_VCL }, // 29: NAL_UNIT_UNSPEC_29
131 { NON_VCL, NON_VCL }, // 30: NAL_UNIT_UNSPEC_30
132 { NON_VCL, NON_VCL } // 31: NAL_UNIT_UNSPEC_31
133};
134
135/*common use table*/56/*common use table*/
136const uint8_t g_kuiScan8[24] = { // [16 + 2*4]57const uint8_t g_kuiScan8[24] = { // [16 + 2*4]
137 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8,58 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8,
@@ -155,35 +76,6 @@ const uint8_t g_kuiChromaDcScan[4] = { · 17 unmodified lines
155 0, 16, 32, 4876 0, 16, 32, 48
156};77};
157 78
158ALIGNED_DECLARE (const uint16_t, g_kuiDequantCoeff[52][8], 16) = {
159 /* 0*/{ 10, 13, 10, 13, 13, 16, 13, 16 }, /* 1*/{ 11, 14, 11, 14, 14, 18, 14, 18 },
160 /* 2*/{ 13, 16, 13, 16, 16, 20, 16, 20 }, /* 3*/{ 14, 18, 14, 18, 18, 23, 18, 23 },
161 /* 4*/{ 16, 20, 16, 20, 20, 25, 20, 25 }, /* 5*/{ 18, 23, 18, 23, 23, 29, 23, 29 },
162 /* 6*/{ 20, 26, 20, 26, 26, 32, 26, 32 }, /* 7*/{ 22, 28, 22, 28, 28, 36, 28, 36 },
163 /* 8*/{ 26, 32, 26, 32, 32, 40, 32, 40 }, /* 9*/{ 28, 36, 28, 36, 36, 46, 36, 46 },
164 /*10*/{ 32, 40, 32, 40, 40, 50, 40, 50 }, /*11*/{ 36, 46, 36, 46, 46, 58, 46, 58 },
165 /*12*/{ 40, 52, 40, 52, 52, 64, 52, 64 }, /*13*/{ 44, 56, 44, 56, 56, 72, 56, 72 },
166 /*14*/{ 52, 64, 52, 64, 64, 80, 64, 80 }, /*15*/{ 56, 72, 56, 72, 72, 92, 72, 92 },
167 /*16*/{ 64, 80, 64, 80, 80, 100, 80, 100 }, /*17*/{ 72, 92, 72, 92, 92, 116, 92, 116 },
168 /*18*/{ 80, 104, 80, 104, 104, 128, 104, 128 }, /*19*/{ 88, 112, 88, 112, 112, 144, 112, 144 },
169 /*20*/{ 104, 128, 104, 128, 128, 160, 128, 160 }, /*21*/{ 112, 144, 112, 144, 144, 184, 144, 184 },
170 /*22*/{ 128, 160, 128, 160, 160, 200, 160, 200 }, /*23*/{ 144, 184, 144, 184, 184, 232, 184, 232 },
171 /*24*/{ 160, 208, 160, 208, 208, 256, 208, 256 }, /*25*/{ 176, 224, 176, 224, 224, 288, 224, 288 },
172 /*26*/{ 208, 256, 208, 256, 256, 320, 256, 320 }, /*27*/{ 224, 288, 224, 288, 288, 368, 288, 368 },
173 /*28*/{ 256, 320, 256, 320, 320, 400, 320, 400 }, /*29*/{ 288, 368, 288, 368, 368, 464, 368, 464 },
174 /*30*/{ 320, 416, 320, 416, 416, 512, 416, 512 }, /*31*/{ 352, 448, 352, 448, 448, 576, 448, 576 },
175 /*32*/{ 416, 512, 416, 512, 512, 640, 512, 640 }, /*33*/{ 448, 576, 448, 576, 576, 736, 576, 736 },
176 /*34*/{ 512, 640, 512, 640, 640, 800, 640, 800 }, /*35*/{ 576, 736, 576, 736, 736, 928, 736, 928 },
177 /*36*/{ 640, 832, 640, 832, 832, 1024, 832, 1024 }, /*37*/{ 704, 896, 704, 896, 896, 1152, 896, 1152 },
178 /*38*/{ 832, 1024, 832, 1024, 1024, 1280, 1024, 1280 }, /*39*/{ 896, 1152, 896, 1152, 1152, 1472, 1152, 1472 },
179 /*40*/{ 1024, 1280, 1024, 1280, 1280, 1600, 1280, 1600 }, /*41*/{ 1152, 1472, 1152, 1472, 1472, 1856, 1472, 1856 },
180 /*42*/{ 1280, 1664, 1280, 1664, 1664, 2048, 1664, 2048 }, /*43*/{ 1408, 1792, 1408, 1792, 1792, 2304, 1792, 2304 },
181 /*44*/{ 1664, 2048, 1664, 2048, 2048, 2560, 2048, 2560 }, /*45*/{ 1792, 2304, 1792, 2304, 2304, 2944, 2304, 2944 },
182 /*46*/{ 2048, 2560, 2048, 2560, 2560, 3200, 2560, 3200 }, /*47*/{ 2304, 2944, 2304, 2944, 2944, 3712, 2944, 3712 },
183 /*48*/{ 2560, 3328, 2560, 3328, 3328, 4096, 3328, 4096 }, /*49*/{ 2816, 3584, 2816, 3584, 3584, 4608, 3584, 4608 },
184 /*50*/{ 3328, 4096, 3328, 4096, 4096, 5120, 4096, 5120 }, /*51*/{ 3584, 4608, 3584, 4608, 4608, 5888, 4608, 5888 },
185};
186
187///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////79///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
188 80
189const uint8_t g_kuiIntra4x4CbpTable[48] = {81const uint8_t g_kuiIntra4x4CbpTable[48] = {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t