Ticket #224: tiles_SPS_PPS_bugfix.patch
File tiles_SPS_PPS_bugfix.patch, 13.9 KB (added by shilin.xu, 13 years ago) |
---|
-
source/Lib/TLibCommon/TComPicSym.cpp
97 97 m_puiCUOrderMap[i] = i; 98 98 m_puiInverseCUOrderMap[i] = i; 99 99 } 100 101 m_apcTComTile = new TComTile*[m_uiNumCUsInFrame]; 102 for( i=0; i<m_uiNumCUsInFrame; i++ ) 103 { 104 m_apcTComTile[i] = new TComTile; 105 } 100 106 #endif 101 107 } 102 108 … … 124 130 m_apcTComDataCU = NULL; 125 131 126 132 #if TILES 127 for (i = 0; i < (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++)133 for (i = 0; i < m_uiNumCUsInFrame; i++) 128 134 { 129 135 delete m_apcTComTile[i]; 130 136 } … … 178 184 return getCUOrderMap(SCUEncOrder/m_uiNumPartitions)*m_uiNumPartitions + SCUEncOrder%m_uiNumPartitions; 179 185 } 180 186 181 Void TComPicSym::xCreateTComTileArray()182 {183 m_apcTComTile = new TComTile*[(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1)];184 for( UInt i=0; i<(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ )185 {186 m_apcTComTile[i] = new TComTile;187 }188 }189 190 187 Void TComPicSym::xInitTiles() 191 188 { 192 189 UInt uiTileIdx; -
source/Lib/TLibCommon/TComPicSym.h
152 152 UInt getInverseCUOrderMap( Int cuAddr ) { return *(m_puiInverseCUOrderMap + (cuAddr>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : cuAddr)); } 153 153 UInt getPicSCUEncOrder( UInt SCUAddr ); 154 154 UInt getPicSCUAddr( UInt SCUEncOrder ); 155 Void xCreateTComTileArray();156 155 Void xInitTiles(); 157 156 UInt xCalculateNxtCUAddr( UInt uiCurrCUAddr ); 158 157 #if TILES_DECODER -
source/Lib/TLibDecoder/TDecCAVLC.cpp
202 202 pcPPS->setColumnRowInfoPresent(uiCode); 203 203 if( pcPPS->getColumnRowInfoPresent() == 1 ) 204 204 { 205 READ_FLAG ( uiCode, "uniform_spacing_idc" );206 pcPPS->setUniformSpacingIdr( uiCode );207 READ_FLAG ( uiCode, "tile_boundary_independence_idc" );208 pcPPS->setTileBoundaryIndependenceIdr( uiCode );209 210 205 READ_UVLC ( uiCode, "num_tile_columns_minus1" ); 211 206 pcPPS->setNumColumnsMinus1( uiCode ); 212 207 READ_UVLC ( uiCode, "num_tile_rows_minus1" ); 213 pcPPS->setNumRowsMinus1( uiCode ); 208 pcPPS->setNumRowsMinus1( uiCode ); 214 209 215 if( pcPPS->get UniformSpacingIdr() ==0 )210 if( pcPPS->getNumColumnsMinus1()!=0 || pcPPS->getNumRowsMinus1()!=0 ) 216 211 { 217 UInt* columnWidth = (UInt*)malloc(pcPPS->getNumColumnsMinus1()*sizeof(UInt)); 218 for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++) 219 { 220 READ_UVLC( uiCode, "column_width" ); 221 columnWidth[i] = uiCode; 222 } 223 pcPPS->setColumnWidth(columnWidth); 224 free(columnWidth); 212 READ_FLAG ( uiCode, "tile_boundary_independence_idc" ); 213 pcPPS->setTileBoundaryIndependenceIdr( uiCode ); 214 READ_FLAG ( uiCode, "uniform_spacing_idc" ); 215 pcPPS->setUniformSpacingIdr( uiCode ); 225 216 226 UInt* rowHeight = (UInt*)malloc(pcPPS->getNumRowsMinus1()*sizeof(UInt)); 227 for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++) 217 if( pcPPS->getUniformSpacingIdr() != 1 ) 228 218 { 229 READ_UVLC( uiCode, "row_height" ); 230 rowHeight[i] = uiCode; 219 UInt* columnWidth = (UInt*)malloc(pcPPS->getNumColumnsMinus1()*sizeof(UInt)); 220 for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++) 221 { 222 READ_UVLC( uiCode, "column_width" ); 223 columnWidth[i] = uiCode; 224 } 225 pcPPS->setColumnWidth(columnWidth); 226 free(columnWidth); 227 228 UInt* rowHeight = (UInt*)malloc(pcPPS->getNumRowsMinus1()*sizeof(UInt)); 229 for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++) 230 { 231 READ_UVLC( uiCode, "row_height" ); 232 rowHeight[i] = uiCode; 233 } 234 pcPPS->setRowHeight(rowHeight); 235 free(rowHeight); 231 236 } 232 pcPPS->setRowHeight(rowHeight);233 free(rowHeight);234 237 } 238 else 239 { 240 pcPPS->setTileBoundaryIndependenceIdr(0); 241 pcPPS->setUniformSpacingIdr(0); 242 } 235 243 } 236 244 #endif 237 245 return; … … 358 366 #endif 359 367 360 368 #if TILES 361 READ_FLAG ( uiCode, "uniform_spacing_idc" );362 pcSPS->setUniformSpacingIdr( uiCode );363 READ_FLAG ( uiCode, "tile_boundary_independence_idc" );364 pcSPS->setTileBoundaryIndependenceIdr( uiCode );365 366 369 READ_UVLC ( uiCode, "num_tile_columns_minus1" ); 367 370 pcSPS->setNumColumnsMinus1( uiCode ); 368 371 READ_UVLC ( uiCode, "num_tile_rows_minus1" ); 369 pcSPS->setNumRowsMinus1( uiCode ); 370 if( pcSPS->getUniformSpacingIdr() == 0 ) 372 pcSPS->setNumRowsMinus1( uiCode ); 373 374 if( pcSPS->getNumColumnsMinus1()!=0 || pcSPS->getNumRowsMinus1()!=0 ) 371 375 { 372 UInt* columnWidth = (UInt*)malloc(pcSPS->getNumColumnsMinus1()*sizeof(UInt)); 373 for(UInt i=0; i<pcSPS->getNumColumnsMinus1(); i++) 374 { 375 READ_UVLC( uiCode, "column_width" ); 376 columnWidth[i] = uiCode; 377 } 378 pcSPS->setColumnWidth(columnWidth); 379 free(columnWidth); 376 READ_FLAG ( uiCode, "tile_boundary_independence_idc" ); 377 pcSPS->setTileBoundaryIndependenceIdr( uiCode ); 378 READ_FLAG ( uiCode, "uniform_spacing_idc" ); 379 pcSPS->setUniformSpacingIdr( uiCode ); 380 if( pcSPS->getUniformSpacingIdr() != 1 ) 381 { 382 UInt* columnWidth = (UInt*)malloc(pcSPS->getNumColumnsMinus1()*sizeof(UInt)); 383 for(UInt i=0; i<pcSPS->getNumColumnsMinus1(); i++) 384 { 385 READ_UVLC( uiCode, "column_width" ); 386 columnWidth[i] = uiCode; 387 } 388 pcSPS->setColumnWidth(columnWidth); 389 free(columnWidth); 380 390 381 UInt* rowHeight = (UInt*)malloc(pcSPS->getNumRowsMinus1()*sizeof(UInt)); 382 for(UInt i=0; i<pcSPS->getNumRowsMinus1(); i++) 383 { 384 READ_UVLC( uiCode, "row_height" ); 385 rowHeight[i] = uiCode; 391 UInt* rowHeight = (UInt*)malloc(pcSPS->getNumRowsMinus1()*sizeof(UInt)); 392 for(UInt i=0; i<pcSPS->getNumRowsMinus1(); i++) 393 { 394 READ_UVLC( uiCode, "row_height" ); 395 rowHeight[i] = uiCode; 396 } 397 pcSPS->setRowHeight(rowHeight); 398 free(rowHeight); 386 399 } 387 pcSPS->setRowHeight(rowHeight);388 free(rowHeight);389 400 } 401 else 402 { 403 pcSPS->setTileBoundaryIndependenceIdr( 0 ); 404 pcSPS->setUniformSpacingIdr( 0 ); 405 } 390 406 #endif 391 407 392 408 return; -
source/Lib/TLibDecoder/TDecTop.cpp
410 410 pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getPPS()->getNumColumnsMinus1() ); 411 411 pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getPPS()->getNumRowsMinus1() ); 412 412 413 //create the TComTileArray414 pcPic->getPicSym()->xCreateTComTileArray();415 416 413 if( pcSlice->getPPS()->getUniformSpacingIdr() == 1) 417 414 { 418 415 //set the width for each tile … … 473 470 pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getSPS()->getNumColumnsMinus1() ); 474 471 pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getSPS()->getNumRowsMinus1() ); 475 472 476 //create the TComTileArray477 pcPic->getPicSym()->xCreateTComTileArray();478 479 473 //automatically set the column and row boundary if UniformSpacingIdr = 1 480 474 if( pcSlice->getSPS()->getUniformSpacingIdr() == 1 ) 481 475 { -
source/Lib/TLibEncoder/TEncCavlc.cpp
349 349 WRITE_FLAG( pcPPS->getColumnRowInfoPresent(), "tile_info_present_flag" ); 350 350 if( pcPPS->getColumnRowInfoPresent() == 1 ) 351 351 { 352 WRITE_FLAG( pcPPS->getUniformSpacingIdr(), "uniform_spacing_idc" ); 353 WRITE_FLAG( pcPPS->getTileBoundaryIndependenceIdr(), "tile_boundary_independence_idc" ); 354 WRITE_UVLC( pcPPS->getNumColumnsMinus1(), "num_tile_columns_minus1" ); 355 WRITE_UVLC( pcPPS->getNumRowsMinus1(), "num_tile_rows_minus1" ); 356 if( pcPPS->getUniformSpacingIdr() == 0 ) 352 WRITE_UVLC( pcPPS->getNumColumnsMinus1(), "num_tile_columns_minus1" ); 353 WRITE_UVLC( pcPPS->getNumRowsMinus1(), "num_tile_rows_minus1" ); 354 if( pcPPS->getNumColumnsMinus1()!=0 || pcPPS->getNumRowsMinus1()!=0 ) 357 355 { 358 for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++) 356 WRITE_FLAG( pcPPS->getTileBoundaryIndependenceIdr(), "tile_boundary_independence_idc" ); 357 WRITE_FLAG( pcPPS->getUniformSpacingIdr(), "uniform_spacing_idc" ); 358 if( pcPPS->getUniformSpacingIdr() != 1 ) 359 359 { 360 WRITE_UVLC( pcPPS->getColumnWidth(i), "column_width" ); 360 for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++) 361 { 362 WRITE_UVLC( pcPPS->getColumnWidth(i), "column_width" ); 363 } 364 for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++) 365 { 366 WRITE_UVLC( pcPPS->getRowHeight(i), "row_height" ); 367 } 361 368 } 362 for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++)363 {364 WRITE_UVLC( pcPPS->getRowHeight(i), "row_height" );365 }366 369 } 367 370 } 368 371 #endif … … 476 479 #endif 477 480 478 481 #if TILES 479 WRITE_FLAG( pcSPS->getUniformSpacingIdr(), "uniform_spacing_idc" ); 480 WRITE_FLAG( pcSPS->getTileBoundaryIndependenceIdr(), "tile_boundary_independence_idc" ); 481 WRITE_UVLC( pcSPS->getNumColumnsMinus1(), "num_tile_columns_minus1" ); 482 WRITE_UVLC( pcSPS->getNumRowsMinus1(), "num_tile_rows_minus1" ); 483 if( pcSPS->getUniformSpacingIdr()==0 ) 482 WRITE_UVLC( pcSPS->getNumColumnsMinus1(), "num_tile_columns_minus1" ); 483 WRITE_UVLC( pcSPS->getNumRowsMinus1(), "num_tile_rows_minus1" ); 484 if( pcSPS->getNumColumnsMinus1()!=0 || pcSPS->getNumRowsMinus1()!=0 ) 484 485 { 485 for(UInt i=0; i<pcSPS->getNumColumnsMinus1(); i++) 486 WRITE_FLAG( pcSPS->getTileBoundaryIndependenceIdr(), "tile_boundary_independence_idc" ); 487 WRITE_FLAG( pcSPS->getUniformSpacingIdr(), "uniform_spacing_idc" ); 488 if( pcSPS->getUniformSpacingIdr()!=1 ) 486 489 { 487 WRITE_UVLC( pcSPS->getColumnWidth(i), "column_width" ); 490 for(UInt i=0; i<pcSPS->getNumColumnsMinus1(); i++) 491 { 492 WRITE_UVLC( pcSPS->getColumnWidth(i), "column_width" ); 493 } 494 for(UInt i=0; i<pcSPS->getNumRowsMinus1(); i++) 495 { 496 WRITE_UVLC( pcSPS->getRowHeight(i), "row_height" ); 497 } 488 498 } 489 for(UInt i=0; i<pcSPS->getNumRowsMinus1(); i++)490 {491 WRITE_UVLC( pcSPS->getRowHeight(i), "row_height" );492 }493 499 } 494 500 #endif 495 501 } -
source/Lib/TLibEncoder/TEncGOP.cpp
370 370 pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getPPS()->getNumColumnsMinus1() ); 371 371 pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getPPS()->getNumRowsMinus1() ); 372 372 373 //create the TComTileArray374 pcPic->getPicSym()->xCreateTComTileArray();375 376 373 if( pcSlice->getPPS()->getUniformSpacingIdr() == 1 ) 377 374 { 378 375 //set the width for each tile … … 433 430 pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getSPS()->getNumColumnsMinus1() ); 434 431 pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getSPS()->getNumRowsMinus1() ); 435 432 436 //create the TComTileArray437 pcPic->getPicSym()->xCreateTComTileArray();438 439 433 if( pcSlice->getSPS()->getUniformSpacingIdr() == 1 ) 440 434 { 441 435 //set the width for each tile -
source/Lib/TLibEncoder/TEncTop.cpp
628 628 #endif 629 629 630 630 #if TILES 631 m_cSPS.setUniformSpacingIdr( m_iUniformSpacingIdr );632 m_cSPS.setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr );633 631 m_cSPS.setNumColumnsMinus1( m_iNumColumnsMinus1 ); 634 632 m_cSPS.setNumRowsMinus1( m_iNumRowsMinus1 ); 633 if( m_iNumColumnsMinus1!=0 || m_iNumRowsMinus1!=0 ) 634 { 635 m_cSPS.setUniformSpacingIdr( m_iUniformSpacingIdr ); 636 m_cSPS.setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr ); 637 } 638 else 639 { 640 m_cSPS.setUniformSpacingIdr( 0 ); 641 m_cSPS.setTileBoundaryIndependenceIdr( 0 ); 642 } 635 643 if( m_iUniformSpacingIdr == 0 ) 636 644 { 637 645 m_cSPS.setColumnWidth( m_puiColumnWidth ); … … 688 696 Void TEncTop::xInitPPSforTiles() 689 697 { 690 698 m_cPPS.setColumnRowInfoPresent( m_iColumnRowInfoPresent ); 691 m_cPPS.setUniformSpacingIdr( m_iUniformSpacingIdr );692 m_cPPS.setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr );693 699 m_cPPS.setNumColumnsMinus1( m_iNumColumnsMinus1 ); 694 700 m_cPPS.setNumRowsMinus1( m_iNumRowsMinus1 ); 701 if( m_iNumColumnsMinus1!=0 || m_iNumRowsMinus1!=0 ) 702 { 703 m_cPPS.setUniformSpacingIdr( m_iUniformSpacingIdr ); 704 m_cPPS.setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr ); 705 } 706 else 707 { 708 m_cPPS.setUniformSpacingIdr( 0 ); 709 m_cPPS.setTileBoundaryIndependenceIdr( 0 ); 710 } 695 711 if( m_iUniformSpacingIdr == 0 ) 696 712 { 697 713 m_cPPS.setColumnWidth( m_puiColumnWidth );