History

Add Transform 8x8 support Add Intra 8x8 support Add no_deblocking support inside T8x8 Add CABAC parse support Add static data sheet for dequant Fix bugs and clean/astyle the code Remove build warnings Modify the UT cases Fix the ParseNalHeader bug

Haibo committed 11 years ago

Commit e9916c71 parent 473f2e325 files · +1808 −270Browse files

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

Unified · Split

codec/decoder/core/src/decode_mb_aux.cpp+90−0
@@ -76,6 +76,96 @@ void IdctResAddPred_c (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) { · 75 unmodified lines
76 }76 }
77}77}
78 78
79void IdctResAddPred8x8_c (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {
80 // To make the ASM code easy to write, should using one funciton to apply hor and ver together, such as we did on HEVC
81 // Ugly code, just for easy debug, the final version need optimization
82 int16_t p[8], b[8];
83 int16_t a[4];
84
85 int16_t iTmp[64];
86 int16_t iRes[64];
87
88 // Horizontal
89 for (int i = 0; i < 8; i++) {
90 for (int j = 0; j < 8; j++) {
91 p[j] = pRs[j + (i << 3)];
92 }
93 a[0] = p[0] + p[4];
94 a[1] = p[0] - p[4];
95 a[2] = p[6] - (p[2] >> 1);
96 a[3] = p[2] + (p[6] >> 1);
97
98 b[0] = a[0] + a[3];
99 b[2] = a[1] - a[2];
100 b[4] = a[1] + a[2];
101 b[6] = a[0] - a[3];
102
103 a[0] = -p[3] + p[5] - p[7] - (p[7] >> 1);
104 a[1] = p[1] + p[7] - p[3] - (p[3] >> 1);
105 a[2] = -p[1] + p[7] + p[5] + (p[5] >> 1);
106 a[3] = p[3] + p[5] + p[1] + (p[1] >> 1);
107
108 b[1] = a[0] + (a[3] >> 2);
109 b[3] = a[1] + (a[2] >> 2);
110 b[5] = a[2] - (a[1] >> 2);
111 b[7] = a[3] - (a[0] >> 2);
112
113 iTmp[0 + (i << 3)] = b[0] + b[7];
114 iTmp[1 + (i << 3)] = b[2] - b[5];
115 iTmp[2 + (i << 3)] = b[4] + b[3];
116 iTmp[3 + (i << 3)] = b[6] + b[1];
117 iTmp[4 + (i << 3)] = b[6] - b[1];
118 iTmp[5 + (i << 3)] = b[4] - b[3];
119 iTmp[6 + (i << 3)] = b[2] + b[5];
120 iTmp[7 + (i << 3)] = b[0] - b[7];
121 }
122
123 //Vertical
124 for (int i = 0; i < 8; i++) {
125 for (int j = 0; j < 8; j++) {
126 p[j] = iTmp[i + (j << 3)];
127 }
128
129 a[0] = p[0] + p[4];
130 a[1] = p[0] - p[4];
131 a[2] = p[6] - (p[2] >> 1);
132 a[3] = p[2] + (p[6] >> 1);
133
134 b[0] = a[0] + a[3];
135 b[2] = a[1] - a[2];
136 b[4] = a[1] + a[2];
137 b[6] = a[0] - a[3];
138
139 a[0] = -p[3] + p[5] - p[7] - (p[7] >> 1);
140 a[1] = p[1] + p[7] - p[3] - (p[3] >> 1);
141 a[2] = -p[1] + p[7] + p[5] + (p[5] >> 1);
142 a[3] = p[3] + p[5] + p[1] + (p[1] >> 1);
143
144
145 b[1] = a[0] + (a[3] >> 2);
146 b[7] = a[3] - (a[0] >> 2);
147 b[3] = a[1] + (a[2] >> 2);
148 b[5] = a[2] - (a[1] >> 2);
149
150 iRes[ (0 << 3) + i] = b[0] + b[7];
151 iRes[ (1 << 3) + i] = b[2] - b[5];
152 iRes[ (2 << 3) + i] = b[4] + b[3];
153 iRes[ (3 << 3) + i] = b[6] + b[1];
154 iRes[ (4 << 3) + i] = b[6] - b[1];
155 iRes[ (5 << 3) + i] = b[4] - b[3];
156 iRes[ (6 << 3) + i] = b[2] + b[5];
157 iRes[ (7 << 3) + i] = b[0] - b[7];
158 }
159
160 uint8_t* pDst = pPred;
161 for (int i = 0; i < 8; i++) {
162 for (int j = 0; j < 8; j++) {
163 pDst[i * kiStride + j] = WelsClip1 (((32 + iRes[ (i << 3) + j]) >> 6) + pDst[i * kiStride + j]);
164 }
165 }
166
167}
168
79void GetI4LumaIChromaAddrTable (int32_t* pBlockOffset, const int32_t kiYStride, const int32_t kiUVStride) {169void GetI4LumaIChromaAddrTable (int32_t* pBlockOffset, const int32_t kiYStride, const int32_t kiUVStride) {
80 int32_t* pOffset = pBlockOffset;170 int32_t* pOffset = pBlockOffset;
81 int32_t i;171 int32_t i;

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