Lines Matching refs:mb
163 static u32 IsSliceBoundaryOnLeft(mbStorage_t *mb);
165 static u32 IsSliceBoundaryOnTop(mbStorage_t *mb);
167 static u32 GetMbFilteringFlags(mbStorage_t *mb);
171 static u32 GetBoundaryStrengths(mbStorage_t *mb, bS_t *bs, u32 flags);
195 mbStorage_t *mb,
200 mbStorage_t *mb,
206 static u32 GetBoundaryStrengths(mbStorage_t *mb, u8 (*bs)[16], u32 flags);
209 mbStorage_t *mb,
217 mbStorage_t *mb,
236 u32 IsSliceBoundaryOnLeft(mbStorage_t *mb)
243 ASSERT(mb && mb->mbA);
245 if (mb->sliceId != mb->mbA->sliceId)
261 u32 IsSliceBoundaryOnTop(mbStorage_t *mb)
268 ASSERT(mb && mb->mbB);
270 if (mb->sliceId != mb->mbB->sliceId)
288 u32 GetMbFilteringFlags(mbStorage_t *mb)
297 ASSERT(mb);
300 if (mb->disableDeblockingFilterIdc != 1)
304 /* filterLeftMbEdgeFlag, left mb is MB_A */
305 if (mb->mbA &&
306 ((mb->disableDeblockingFilterIdc != 2) ||
307 !IsSliceBoundaryOnLeft(mb)))
311 if (mb->mbB &&
312 ((mb->disableDeblockingFilterIdc != 2) ||
313 !IsSliceBoundaryOnTop(mb)))
328 called -> no intra mb condition here.
391 before this is called -> no intra mb conditions here.
421 before this is called -> no intra mb conditions here.
488 before this is called -> no intra mb conditions here.
563 mb pointer to macroblock data structure of the top-left
576 mbStorage_t *mb)
592 ASSERT(mb);
601 pMb = mb;
1134 u32 GetBoundaryStrengths(mbStorage_t *mb, bS_t *bS, u32 flags)
1145 ASSERT(mb);
1152 if (IS_INTRA_MB(*mb) || IS_INTRA_MB(*mb->mbB))
1159 bS[0].top = EdgeBoundaryStrength(mb, mb->mbB, 0, 10);
1160 bS[1].top = EdgeBoundaryStrength(mb, mb->mbB, 1, 11);
1161 bS[2].top = EdgeBoundaryStrength(mb, mb->mbB, 4, 14);
1162 bS[3].top = EdgeBoundaryStrength(mb, mb->mbB, 5, 15);
1175 if (IS_INTRA_MB(*mb) || IS_INTRA_MB(*mb->mbA))
1182 bS[0].left = EdgeBoundaryStrength(mb, mb->mbA, 0, 5);
1183 bS[4].left = EdgeBoundaryStrength(mb, mb->mbA, 2, 7);
1184 bS[8].left = EdgeBoundaryStrength(mb, mb->mbA, 8, 13);
1185 bS[12].left = EdgeBoundaryStrength(mb, mb->mbA, 10, 15);
1197 if (IS_INTRA_MB(*mb))
1211 /* 16x16 inter mb -> ref addresses or motion vectors cannot differ,
1213 if (h264bsdNumMbPart(mb->mbType) == 1)
1215 bS[4].top = mb->totalCoeff[2] || mb->totalCoeff[0] ? 2 : 0;
1216 bS[5].top = mb->totalCoeff[3] || mb->totalCoeff[1] ? 2 : 0;
1217 bS[6].top = mb->totalCoeff[6] || mb->totalCoeff[4] ? 2 : 0;
1218 bS[7].top = mb->totalCoeff[7] || mb->totalCoeff[5] ? 2 : 0;
1219 bS[8].top = mb->totalCoeff[8] || mb->totalCoeff[2] ? 2 : 0;
1220 bS[9].top = mb->totalCoeff[9] || mb->totalCoeff[3] ? 2 : 0;
1221 bS[10].top = mb->totalCoeff[12] || mb->totalCoeff[6] ? 2 : 0;
1222 bS[11].top = mb->totalCoeff[13] || mb->totalCoeff[7] ? 2 : 0;
1223 bS[12].top = mb->totalCoeff[10] || mb->totalCoeff[8] ? 2 : 0;
1224 bS[13].top = mb->totalCoeff[11] || mb->totalCoeff[9] ? 2 : 0;
1225 bS[14].top = mb->totalCoeff[14] || mb->totalCoeff[12] ? 2 : 0;
1226 bS[15].top = mb->totalCoeff[15] || mb->totalCoeff[13] ? 2 : 0;
1228 bS[1].left = mb->totalCoeff[1] || mb->totalCoeff[0] ? 2 : 0;
1229 bS[2].left = mb->totalCoeff[4] || mb->totalCoeff[1] ? 2 : 0;
1230 bS[3].left = mb->totalCoeff[5] || mb->totalCoeff[4] ? 2 : 0;
1231 bS[5].left = mb->totalCoeff[3] || mb->totalCoeff[2] ? 2 : 0;
1232 bS[6].left = mb->totalCoeff[6] || mb->totalCoeff[3] ? 2 : 0;
1233 bS[7].left = mb->totalCoeff[7] || mb->totalCoeff[6] ? 2 : 0;
1234 bS[9].left = mb->totalCoeff[9] || mb->totalCoeff[8] ? 2 : 0;
1235 bS[10].left = mb->totalCoeff[12] || mb->totalCoeff[9] ? 2 : 0;
1236 bS[11].left = mb->totalCoeff[13] || mb->totalCoeff[12] ? 2 : 0;
1237 bS[13].left = mb->totalCoeff[11] || mb->totalCoeff[10] ? 2 : 0;
1238 bS[14].left = mb->totalCoeff[14] || mb->totalCoeff[11] ? 2 : 0;
1239 bS[15].left = mb->totalCoeff[15] || mb->totalCoeff[14] ? 2 : 0;
1241 /* 16x8 inter mb -> ref addresses and motion vectors can be different
1245 else if (mb->mbType == P_L0_L0_16x8)
1247 bS[4].top = mb->totalCoeff[2] || mb->totalCoeff[0] ? 2 : 0;
1248 bS[5].top = mb->totalCoeff[3] || mb->totalCoeff[1] ? 2 : 0;
1249 bS[6].top = mb->totalCoeff[6] || mb->totalCoeff[4] ? 2 : 0;
1250 bS[7].top = mb->totalCoeff[7] || mb->totalCoeff[5] ? 2 : 0;
1251 bS[12].top = mb->totalCoeff[10] || mb->totalCoeff[8] ? 2 : 0;
1252 bS[13].top = mb->totalCoeff[11] || mb->totalCoeff[9] ? 2 : 0;
1253 bS[14].top = mb->totalCoeff[14] || mb->totalCoeff[12] ? 2 : 0;
1254 bS[15].top = mb->totalCoeff[15] || mb->totalCoeff[13] ? 2 : 0;
1255 bS[8].top = InnerBoundaryStrength(mb, 8, 2);
1256 bS[9].top = InnerBoundaryStrength(mb, 9, 3);
1257 bS[10].top = InnerBoundaryStrength(mb, 12, 6);
1258 bS[11].top = InnerBoundaryStrength(mb, 13, 7);
1260 bS[1].left = mb->totalCoeff[1] || mb->totalCoeff[0] ? 2 : 0;
1261 bS[2].left = mb->totalCoeff[4] || mb->totalCoeff[1] ? 2 : 0;
1262 bS[3].left = mb->totalCoeff[5] || mb->totalCoeff[4] ? 2 : 0;
1263 bS[5].left = mb->totalCoeff[3] || mb->totalCoeff[2] ? 2 : 0;
1264 bS[6].left = mb->totalCoeff[6] || mb->totalCoeff[3] ? 2 : 0;
1265 bS[7].left = mb->totalCoeff[7] || mb->totalCoeff[6] ? 2 : 0;
1266 bS[9].left = mb->totalCoeff[9] || mb->totalCoeff[8] ? 2 : 0;
1267 bS[10].left = mb->totalCoeff[12] || mb->totalCoeff[9] ? 2 : 0;
1268 bS[11].left = mb->totalCoeff[13] || mb->totalCoeff[12] ? 2 : 0;
1269 bS[13].left = mb->totalCoeff[11] || mb->totalCoeff[10] ? 2 : 0;
1270 bS[14].left = mb->totalCoeff[14] || mb->totalCoeff[11] ? 2 : 0;
1271 bS[15].left = mb->totalCoeff[15] || mb->totalCoeff[14] ? 2 : 0;
1273 /* 8x16 inter mb -> ref addresses and motion vectors can be different
1277 else if (mb->mbType == P_L0_L0_8x16)
1279 bS[4].top = mb->totalCoeff[2] || mb->totalCoeff[0] ? 2 : 0;
1280 bS[5].top = mb->totalCoeff[3] || mb->totalCoeff[1] ? 2 : 0;
1281 bS[6].top = mb->totalCoeff[6] || mb->totalCoeff[4] ? 2 : 0;
1282 bS[7].top = mb->totalCoeff[7] || mb->totalCoeff[5] ? 2 : 0;
1283 bS[8].top = mb->totalCoeff[8] || mb->totalCoeff[2] ? 2 : 0;
1284 bS[9].top = mb->totalCoeff[9] || mb->totalCoeff[3] ? 2 : 0;
1285 bS[10].top = mb->totalCoeff[12] || mb->totalCoeff[6] ? 2 : 0;
1286 bS[11].top = mb->totalCoeff[13] || mb->totalCoeff[7] ? 2 : 0;
1287 bS[12].top = mb->totalCoeff[10] || mb->totalCoeff[8] ? 2 : 0;
1288 bS[13].top = mb->totalCoeff[11] || mb->totalCoeff[9] ? 2 : 0;
1289 bS[14].top = mb->totalCoeff[14] || mb->totalCoeff[12] ? 2 : 0;
1290 bS[15].top = mb->totalCoeff[15] || mb->totalCoeff[13] ? 2 : 0;
1292 bS[1].left = mb->totalCoeff[1] || mb->totalCoeff[0] ? 2 : 0;
1293 bS[3].left = mb->totalCoeff[5] || mb->totalCoeff[4] ? 2 : 0;
1294 bS[5].left = mb->totalCoeff[3] || mb->totalCoeff[2] ? 2 : 0;
1295 bS[7].left = mb->totalCoeff[7] || mb->totalCoeff[6] ? 2 : 0;
1296 bS[9].left = mb->totalCoeff[9] || mb->totalCoeff[8] ? 2 : 0;
1297 bS[11].left = mb->totalCoeff[13] || mb->totalCoeff[12] ? 2 : 0;
1298 bS[13].left = mb->totalCoeff[11] || mb->totalCoeff[10] ? 2 : 0;
1299 bS[15].left = mb->totalCoeff[15] || mb->totalCoeff[14] ? 2 : 0;
1300 bS[2].left = InnerBoundaryStrength(mb, 4, 1);
1301 bS[6].left = InnerBoundaryStrength(mb, 6, 3);
1302 bS[10].left = InnerBoundaryStrength(mb, 12, 9);
1303 bS[14].left = InnerBoundaryStrength(mb, 14, 11);
1308 InnerBoundaryStrength(mb, mb4x4Index[4], mb4x4Index[0]);
1310 InnerBoundaryStrength(mb, mb4x4Index[5], mb4x4Index[1]);
1312 InnerBoundaryStrength(mb, mb4x4Index[6], mb4x4Index[2]);
1314 InnerBoundaryStrength(mb, mb4x4Index[7], mb4x4Index[3]);
1316 InnerBoundaryStrength(mb, mb4x4Index[8], mb4x4Index[4]);
1318 InnerBoundaryStrength(mb, mb4x4Index[9], mb4x4Index[5]);
1320 InnerBoundaryStrength(mb, mb4x4Index[10], mb4x4Index[6]);
1322 InnerBoundaryStrength(mb, mb4x4Index[11], mb4x4Index[7]);
1324 InnerBoundaryStrength(mb, mb4x4Index[12], mb4x4Index[8]);
1326 InnerBoundaryStrength(mb, mb4x4Index[13], mb4x4Index[9]);
1328 InnerBoundaryStrength(mb, mb4x4Index[14], mb4x4Index[10]);
1330 InnerBoundaryStrength(mb, mb4x4Index[15], mb4x4Index[11]);
1333 InnerBoundaryStrength(mb, mb4x4Index[1], mb4x4Index[0]);
1335 InnerBoundaryStrength(mb, mb4x4Index[2], mb4x4Index[1]);
1337 InnerBoundaryStrength(mb, mb4x4Index[3], mb4x4Index[2]);
1339 InnerBoundaryStrength(mb, mb4x4Index[5], mb4x4Index[4]);
1341 InnerBoundaryStrength(mb, mb4x4Index[6], mb4x4Index[5]);
1343 InnerBoundaryStrength(mb, mb4x4Index[7], mb4x4Index[6]);
1345 InnerBoundaryStrength(mb, mb4x4Index[9], mb4x4Index[8]);
1347 InnerBoundaryStrength(mb, mb4x4Index[10], mb4x4Index[9]);
1349 InnerBoundaryStrength(mb, mb4x4Index[11], mb4x4Index[10]);
1351 InnerBoundaryStrength(mb, mb4x4Index[13], mb4x4Index[12]);
1353 InnerBoundaryStrength(mb, mb4x4Index[14], mb4x4Index[13]);
1355 InnerBoundaryStrength(mb, mb4x4Index[15], mb4x4Index[14]);
1383 mbStorage_t *mb,
1395 ASSERT(mb);
1397 qp = mb->qpY;
1399 indexA = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetA);
1400 indexB = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetB);
1408 qpTmp = mb->mbB->qpY;
1413 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
1414 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);
1429 qpTmp = mb->mbA->qpY;
1434 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
1435 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);
1462 mbStorage_t *mb,
1475 ASSERT(mb);
1477 qp = mb->qpY;
1480 indexA = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetA);
1481 indexB = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetB);
1489 qpTmp = mb->mbB->qpY;
1490 if (qpTmp != mb->qpY)
1495 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
1496 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);
1511 qpTmp = mb->mbA->qpY;
1512 if (qpTmp != mb->qpY)
1517 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
1518 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);
1754 mb pointer to macroblock data structure of the top-left
1768 mbStorage_t *mb)
1788 ASSERT(mb);
1797 pMb = mb;
1882 u32 GetBoundaryStrengths(mbStorage_t *mb, u8 (*bS)[16], u32 flags)
1895 ASSERT(mb);
1899 isIntraMb = IS_INTRA_MB(*mb);
1905 if (isIntraMb || IS_INTRA_MB(*mb->mbB))
1912 *pTmp = EdgeBoundaryStrengthTop(mb, mb->mbB);
1926 if (isIntraMb || IS_INTRA_MB(*mb->mbA))
1934 *pTmp = EdgeBoundaryStrengthLeft(mb, mb->mbA);
1960 pTmp = (u32*)mb->totalCoeff;
1962 /* 16x16 inter mb -> ref addresses or motion vectors cannot differ,
1964 if (h264bsdNumMbPart(mb->mbType) == 1)
1992 tmp1 = mb->totalCoeff[8];
1993 tmp2 = mb->totalCoeff[2];
1994 tmp3 = mb->totalCoeff[9];
1995 tmp4 = mb->totalCoeff[3];
1998 tmp1 = mb->totalCoeff[12];
1999 tmp2 = mb->totalCoeff[6];
2001 tmp3 = mb->totalCoeff[13];
2002 tmp4 = mb->totalCoeff[7];
2004 tmp1 = mb->totalCoeff[4];
2005 tmp2 = mb->totalCoeff[1];
2007 tmp3 = mb->totalCoeff[6];
2008 tmp4 = mb->totalCoeff[3];
2010 tmp1 = mb
2011 tmp2 = mb->totalCoeff[9];
2013 tmp3 = mb->totalCoeff[14];
2014 tmp4 = mb->totalCoeff[11];
2020 /* 16x8 inter mb -> ref addresses and motion vectors can be different
2024 else if (mb->mbType == P_L0_L0_16x8)
2048 bS[1][8] = (u8)InnerBoundaryStrength(mb, 8, 2);
2049 bS[1][9] = (u8)InnerBoundaryStrength(mb, 9, 3);
2050 bS[1][10] = (u8)InnerBoundaryStrength(mb, 12, 6);
2051 bS[1][11] = (u8)InnerBoundaryStrength(mb, 13, 7);
2056 tmp1 = mb->totalCoeff[4];
2057 tmp2 = mb->totalCoeff[1];
2058 tmp3 = mb->totalCoeff[6];
2059 tmp4 = mb->totalCoeff[3];
2061 tmp1 = mb->totalCoeff[12];
2062 tmp2 = mb->totalCoeff[9];
2064 tmp3 = mb->totalCoeff[14];
2065 tmp4 = mb->totalCoeff[11];
2070 /* 8x16 inter mb -> ref addresses and motion vectors can be different
2074 else if (mb->mbType == P_L0_L0_8x16)
2098 bS[0][8] = (u8)InnerBoundaryStrength(mb, 4, 1);
2099 bS[0][9] = (u8)InnerBoundaryStrength(mb, 6, 3);
2100 bS[0][10] = (u8)InnerBoundaryStrength(mb, 12, 9);
2101 bS[0][11] = (u8)InnerBoundaryStrength(mb, 14, 11);
2106 tmp1 = mb->totalCoeff[8];
2107 tmp2 = mb->totalCoeff[2];
2108 tmp3 = mb->totalCoeff[9];
2109 tmp4 = mb->totalCoeff[3];
2111 tmp1 = mb->totalCoeff[12];
2112 tmp2 = mb->totalCoeff[6];
2114 tmp3 = mb->totalCoeff[13];
2115 tmp4 = mb->totalCoeff[7];
2123 bS[1][4] = (tmp1 & 0x00FF00FF) ? 2 : (u8)InnerBoundaryStrength2(mb, 2, 0);
2124 bS[1][5] = (tmp1 & 0xFF00FF00) ? 2 : (u8)InnerBoundaryStrength2(mb, 3, 1);
2125 bS[0][4] = (tmp1 & 0x0000FFFF) ? 2 : (u8)InnerBoundaryStrength2(mb, 1, 0);
2126 bS[0][5] = (tmp1 & 0xFFFF0000) ? 2 : (u8)InnerBoundaryStrength2(mb, 3, 2);
2128 bS[1][6] = (tmp1 & 0x00FF00FF) ? 2 : (u8)InnerBoundaryStrength2(mb, 6, 4);
2129 bS[1][7] = (tmp1 & 0xFF00FF00) ? 2 : (u8)InnerBoundaryStrength2(mb, 7, 5);
2130 bS[0][12] = (tmp1 & 0x0000FFFF) ? 2 : (u8)InnerBoundaryStrength2(mb, 5, 4);
2131 bS[0][13] = (tmp1 & 0xFFFF0000) ? 2 : (u8)InnerBoundaryStrength2(mb, 7, 6);
2133 bS[1][12] = (tmp1 & 0x00FF00FF) ? 2 : (u8)InnerBoundaryStrength2(mb, 10, 8);
2134 bS[1][13] = (tmp1 & 0xFF00FF00) ? 2 : (u8)InnerBoundaryStrength2(mb, 11, 9);
2135 bS[0][6] = (tmp1 & 0x0000FFFF) ? 2 : (u8)InnerBoundaryStrength2(mb, 9, 8);
2136 bS[0][7] = (tmp1 & 0xFFFF0000) ? 2 : (u8)InnerBoundaryStrength2(mb, 11, 10);
2138 bS[1][14] = (tmp1 & 0x00FF00FF) ? 2 : (u8)InnerBoundaryStrength2(mb, 14, 12);
2139 bS[1][15] = (tmp1 & 0xFF00FF00) ? 2 : (u8)InnerBoundaryStrength2(mb, 15, 13);
2140 bS[0][14] = (tmp1 & 0x0000FFFF) ? 2 : (u8)InnerBoundaryStrength2(mb, 13, 12);
2141 bS[0][15] = (tmp1 & 0xFFFF0000) ? 2 : (u8)InnerBoundaryStrength2(mb, 15, 14);
2143 bS[1][8] = (u8)InnerBoundaryStrength(mb, 8, 2);
2144 bS[1][9] = (u8)InnerBoundaryStrength(mb, 9, 3);
2145 bS[1][10] = (u8)InnerBoundaryStrength(mb, 12, 6);
2146 bS[1][11] = (u8)InnerBoundaryStrength(mb, 13, 7);
2148 bS[0][8] = (u8)InnerBoundaryStrength(mb, 4, 1);
2149 bS[0][9] = (u8)InnerBoundaryStrength(mb, 6, 3);
2150 bS[0][10] = (u8)InnerBoundaryStrength(mb, 12, 9);
2151 bS[0][11] = (u8)InnerBoundaryStrength(mb, 14, 11);
2175 mbStorage_t *mb,
2195 ASSERT(mb);
2197 qp = mb->qpY;
2199 indexA = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetA);
2200 indexB = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetB);
2253 qpTmp = mb->mbB->qpY;
2259 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
2260 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);
2276 qpTmp = mb->mbA->qpY;
2281 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
2282 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);
2305 mbStorage_t *mb,
2326 ASSERT(mb);
2327 ASSERT(mb);
2329 qp = mb->qpY;
2332 indexA = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetA);
2333 indexB = (u32)CLIP3(0, 51, (i32)qp + mb->filterOffsetB);
2368 qpTmp = mb->mbB->qpY;
2369 if (qpTmp != mb->qpY)
2375 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
2376 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);
2393 qpTmp = mb->mbA->qpY;
2394 if (qpTmp != mb->qpY)
2400 indexA = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetA);
2401 indexB = (u32)CLIP3(0, 51, (i32)qpAv + mb->filterOffsetB);