Changeset 736 in SHVCSoftware
- Timestamp:
- 24 Apr 2014, 23:58:18 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.cpp
r726 r736 1301 1301 pBLPic->getSlice(0)->setReferenced(true); 1302 1302 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 1303 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth();1304 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight();1305 1303 1306 1304 if( pFile->good() ) 1307 1305 { 1306 Bool is16bit = g_bitDepthYLayer[0] > 8 || g_bitDepthCLayer[0] > 8; 1307 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth(); 1308 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(); 1309 1310 Int len = uiWidth * (is16bit ? 2 : 1); 1311 UChar *buf = new UChar[len]; 1312 1308 1313 UInt64 uiPos = (UInt64) m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2; 1309 1314 1310 1315 pFile->seekg((UInt)uiPos, ios::beg ); 1311 1316 1317 // read Y component 1312 1318 Pel* pPel = pBLPic->getPicYuvRec()->getLumaAddr(); 1313 1319 UInt uiStride = pBLPic->getPicYuvRec()->getStride(); 1314 1320 for( Int i = 0; i < uiHeight; i++ ) 1315 1321 { 1316 for( Int j = 0; j < uiWidth; j++ ) 1322 pFile->read(reinterpret_cast<Char*>(buf), len); 1323 1324 if( !is16bit ) 1317 1325 { 1318 pPel[j] = pFile->get(); 1326 for (Int x = 0; x < uiWidth; x++) 1327 { 1328 pPel[x] = buf[x]; 1329 } 1319 1330 } 1331 else 1332 { 1333 for (Int x = 0; x < uiWidth; x++) 1334 { 1335 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1336 } 1337 } 1338 1320 1339 pPel += uiStride; 1321 1340 } 1322 1341 1342 len >>= 1; 1343 uiWidth >>= 1; 1344 uiHeight >>= 1; 1345 1346 // read Cb component 1323 1347 pPel = pBLPic->getPicYuvRec()->getCbAddr(); 1324 1348 uiStride = pBLPic->getPicYuvRec()->getCStride(); 1325 for( Int i = 0; i < uiHeight/2; i++ ) 1326 { 1327 for( Int j = 0; j < uiWidth/2; j++ ) 1349 for( Int i = 0; i < uiHeight; i++ ) 1350 { 1351 pFile->read(reinterpret_cast<Char*>(buf), len); 1352 1353 if( !is16bit ) 1328 1354 { 1329 pPel[j] = pFile->get(); 1355 for( Int x = 0; x < uiWidth; x++ ) 1356 { 1357 pPel[x] = buf[x]; 1358 } 1330 1359 } 1360 else 1361 { 1362 for( Int x = 0; x < uiWidth; x++ ) 1363 { 1364 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1365 } 1366 } 1367 1331 1368 pPel += uiStride; 1332 1369 } 1333 1370 1371 // read Cr component 1334 1372 pPel = pBLPic->getPicYuvRec()->getCrAddr(); 1335 1373 uiStride = pBLPic->getPicYuvRec()->getCStride(); 1336 for( Int i = 0; i < uiHeight/2; i++ ) 1337 { 1338 for( Int j = 0; j < uiWidth/2; j++ ) 1374 for( Int i = 0; i < uiHeight; i++ ) 1375 { 1376 pFile->read(reinterpret_cast<Char*>(buf), len); 1377 1378 if( !is16bit ) 1339 1379 { 1340 pPel[j] = pFile->get(); 1380 for( Int x = 0; x < uiWidth; x++ ) 1381 { 1382 pPel[x] = buf[x]; 1383 } 1341 1384 } 1385 else 1386 { 1387 for( Int x = 0; x < uiWidth; x++ ) 1388 { 1389 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1390 } 1391 } 1392 1342 1393 pPel += uiStride; 1343 1394 } 1395 1396 delete[] buf; 1344 1397 } 1345 1398 }
Note: See TracChangeset for help on using the changeset viewer.