Changeset 852 in SHVCSoftware


Ignore:
Timestamp:
5 Aug 2014, 01:37:56 (10 years ago)
Author:
qualcomm
Message:

Bug fix for R0164

Location:
branches/SHM-dev/source/Lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.cpp

    r826 r852  
    1717  m_pCuboid = NULL;
    1818  m_nResQuanBit = 0;
    19 #if R0164_CGS_LUT_BUGFIX
     19#if R0164_CGS_LUT_BUGFIX_CHECK
    2020  m_pCuboidExplicit = NULL;
     21  m_pCuboidFilled = NULL;
    2122#endif
    2223}
     
    6061  xAllocate3DArray( m_pCuboid , m_nYSize , m_nUSize , m_nVSize );
    6162
    62 #if R0164_CGS_LUT_BUGFIX
     63#if R0164_CGS_LUT_BUGFIX_CHECK
    6364  xAllocate3DArray( m_pCuboidExplicit , m_nYSize , m_nUSize , m_nVSize );
     65  xAllocate3DArray( m_pCuboidFilled   , m_nYSize , m_nUSize , m_nVSize );
    6466#endif
    6567}
     
    6870{
    6971  xFree3DArray( m_pCuboid );
    70 #if R0164_CGS_LUT_BUGFIX
    71   xFree3DArray( m_pCuboidExplicit  );
     72#if R0164_CGS_LUT_BUGFIX_CHECK
     73  xFree3DArray( m_pCuboidExplicit );
     74  xFree3DArray( m_pCuboidFilled   );
    7275#endif
    7376}
     
    345348}
    346349
    347 #if R0164_CGS_LUT_BUGFIX
     350#if R0164_CGS_LUT_BUGFIX_CHECK
    348351Void TCom3DAsymLUT::xInitCuboids( )
    349352{
     
    356359      {
    357360        m_pCuboidExplicit[yIdx][uIdx][vIdx] = false;
     361        m_pCuboidFilled[yIdx][uIdx][vIdx]   = false;
    358362      }
    359363    }
     
    361365}
    362366
    363 Void TCom3DAsymLUT::xCuboidsExplicitCheck( Int yIdx , Int uIdx , Int vIdx )
    364 {
    365   if ( m_pCuboidExplicit[yIdx][uIdx][vIdx] == false )
     367Void TCom3DAsymLUT::xCuboidsFilledCheck( Int yIdx , Int uIdx , Int vIdx )
     368{
     369  if ( m_pCuboidFilled[yIdx][uIdx][vIdx] == false )
    366370  {
    367371    if( yIdx > 0)
    368       assert ( m_pCuboidExplicit[yIdx-1][uIdx][vIdx] );
     372      assert ( m_pCuboidFilled[yIdx-1][uIdx][vIdx] );
    369373
    370374    for ( Int nVertexIdx=0 ; nVertexIdx<4 ; nVertexIdx++ )
    371375      m_pCuboid[yIdx][uIdx][vIdx].P[nVertexIdx] = yIdx == 0 ? xGetCuboidVertexPredA( yIdx , uIdx , vIdx , nVertexIdx ): xGetCuboidVertexPredAll( yIdx , uIdx , vIdx , nVertexIdx );
    372376
    373     m_pCuboidExplicit[yIdx][uIdx][vIdx] = true ;
    374   }
    375 }
    376 
    377 
    378 Void TCom3DAsymLUT::xCuboidsExplicitCheck( Bool bDecode )
     377    m_pCuboidFilled[yIdx][uIdx][vIdx] = true ;
     378  }
     379}
     380
     381
     382Void TCom3DAsymLUT::xCuboidsFilledCheck( Bool bDecode )
    379383{
    380384  Int ySize = 1 << ( getCurOctantDepth() + getCurYPartNumLog2() );
     
    388392      {
    389393        if ( bDecode )
    390           xCuboidsExplicitCheck( yIdx , uIdx , vIdx );
    391 
    392         assert( m_pCuboidExplicit[yIdx][uIdx][vIdx] );
     394          xCuboidsFilledCheck( yIdx , uIdx , vIdx );
     395
     396        assert( m_pCuboidFilled[yIdx][uIdx][vIdx] );
    393397      }
    394398    }
     
    415419#endif
    416420
    417 #endif
    418 
     421#if R0164_CGS_LUT_BUGFIX_CHECK
     422Void  TCom3DAsymLUT::display( Bool bFilled )
     423{
     424  Int ySize = 1 << ( getCurOctantDepth() + getCurYPartNumLog2() );
     425  Int uSize = 1 << getCurOctantDepth();
     426  Int vSize = 1 << getCurOctantDepth();
     427  Int vIdx=0;
     428
     429  printf("\n");
     430  printf("3DLut Explicit flag:\n");
     431  for( Int uIdx = 0 ; uIdx < uSize ; uIdx++ )
     432  {
     433    for( Int yIdx = 0 ; yIdx < ySize ; yIdx++ )
     434    {
     435      printf("%d\t", m_pCuboidExplicit[yIdx][uIdx][vIdx] );
     436    }
     437    printf("\n");
     438  }
     439
     440  printf("3DLut values (explicit):\n");
     441  for( Int uIdx = 0 ; uIdx < uSize ; uIdx++ )
     442  {
     443    for( Int yIdx = 0 ; yIdx < ySize ; yIdx++ )
     444    {
     445      if ( m_pCuboidExplicit[yIdx][uIdx][vIdx] )  printf("%d\t", m_pCuboid[yIdx][uIdx][vIdx].P[0].Y );
     446      else                                        printf("?\t", m_pCuboid[yIdx][uIdx][vIdx].P[0].Y );
     447    }
     448    printf("\n");
     449  }
     450
     451  printf("3DLut values (all):\n");
     452  for( Int uIdx = 0 ; uIdx < uSize ; uIdx++ )
     453  {
     454    for( Int yIdx = 0 ; yIdx < ySize ; yIdx++ )
     455    {
     456      if ( bFilled ) {
     457        if ( m_pCuboidFilled[yIdx][uIdx][vIdx] )  printf("%d\t"  , m_pCuboid[yIdx][uIdx][vIdx].P[0].Y );
     458        else                                      printf("unk\t" , m_pCuboid[yIdx][uIdx][vIdx].P[0].Y );
     459      }
     460      else
     461        printf("%d\t"  , m_pCuboid[yIdx][uIdx][vIdx].P[0].Y );
     462    }
     463    printf("\n");
     464  }
     465
     466}
     467#endif
     468
     469#endif
     470
  • branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.h

    r826 r852  
    7474  SYUVP getCuboidVertexResTree( Int yIdx , Int uIdx , Int vIdx , Int nVertexIdx );
    7575  Void  setCuboidVertexResTree( Int yIdx , Int uIdx , Int vIdx , Int nVertexIdx , Int deltaY , Int deltaU , Int deltaV );
    76 #if R0164_CGS_LUT_BUGFIX
     76#if R0164_CGS_LUT_BUGFIX_CHECK
    7777  Void  xInitCuboids( );
    78   Void  xCuboidsExplicitCheck( Int yIdx , Int uIdx , Int vIdx );
    79   Void  xCuboidsExplicitCheck( Bool bDecode );
    80   Void  xSetExplicit( Int yIdx , Int uIdx , Int vIdx )  { m_pCuboidExplicit[yIdx][uIdx][vIdx] = true ;}
     78  Void  xCuboidsFilledCheck( Int yIdx , Int uIdx , Int vIdx );
     79  Void  xCuboidsFilledCheck( Bool bDecode );
     80  Void  display( Bool bFilled=true );
     81  Void  xSetExplicit( Int yIdx , Int uIdx , Int vIdx )  { m_pCuboidExplicit[yIdx][uIdx][vIdx] = true ; xSetFilled(yIdx,uIdx,vIdx); }
     82  Void  xSetFilled( Int yIdx , Int uIdx , Int vIdx )    { m_pCuboidFilled[yIdx][uIdx][vIdx] = true ; }
    8183#endif
    8284
     
    114116  Int   m_nAdaptCThresholdV;
    115117#endif
    116 #if R0164_CGS_LUT_BUGFIX
     118#if R0164_CGS_LUT_BUGFIX_CHECK
    117119  Bool  *** m_pCuboidExplicit;
     120  Bool  *** m_pCuboidFilled;
    118121#endif
    119122
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r851 r852  
    103103#define R0151_CGS_3D_ASYMLUT_IMPROVE     1      ///< JCTVC-R0151: Non-uniform chroma partitioning and improved LUT coefficient coding
    104104#define R0164_CGS_LUT_BUGFIX             1      ///< JCTVC-R0164: Bug fix with LUT syntax
     105#define R0164_CGS_LUT_BUGFIX_CHECK       0      ///< JCTVC-R0164: Add traces explicitly/non-explicitly encoded vertices and check if 3DLUT is correctly filled
    105106#define R0179_CGS_SIZE_8x1x1             1      ///< JCTVC-R0179: allow CGS LUT size to be 8x1x1 as well
    106107#define R0300_CGS_RES_COEFF_CODING       1      ///< JCTVC-R0300: improved residual coefficient coding for R0151
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r851 r852  
    41544154  pc3DAsymLUT->setResQuantBit( uiResQaunBit );
    41554155
    4156 #if R0164_CGS_LUT_BUGFIX
     4156#if R0164_CGS_LUT_BUGFIX_CHECK
    41574157  pc3DAsymLUT->xInitCuboids();
    41584158#endif
    41594159  xParse3DAsymLUTOctant( pc3DAsymLUT , 0 , 0 , 0 , 0 , 1 << pc3DAsymLUT->getCurOctantDepth() );
    41604160#if R0164_CGS_LUT_BUGFIX
    4161   pc3DAsymLUT->xCuboidsExplicitCheck( true );
     4161#if R0164_CGS_LUT_BUGFIX_CHECK
     4162  printf("============= Before 'xCuboidsFilledCheck()': ================\n");
     4163  pc3DAsymLUT->display();
     4164  pc3DAsymLUT->xCuboidsFilledCheck( false );
     4165  printf("============= After 'xCuboidsFilledCheck()': =================\n");
     4166  pc3DAsymLUT->display();
     4167#endif
    41624168#endif
    41634169}
     
    42194225#if R0164_CGS_LUT_BUGFIX
    42204226        pc3DAsymLUT->setCuboidVertexResTree( yIdx + (l<<shift) , uIdx , vIdx , nVertexIdx , deltaY , deltaU , deltaV );
     4227        for (Int m = 1; m < (1<<shift); m++) {
     4228          pc3DAsymLUT->setCuboidVertexResTree( yIdx + (l<<shift) + m , uIdx , vIdx , nVertexIdx , 0 , 0 , 0 );
     4229#if R0164_CGS_LUT_BUGFIX_CHECK
     4230          pc3DAsymLUT->xSetFilled( yIdx + (l<<shift) + m , uIdx , vIdx );
     4231#endif
     4232        }
    42214233#else
    42224234        pc3DAsymLUT->setCuboidVertexResTree( yIdx + l , uIdx , vIdx , nVertexIdx , deltaY , deltaU , deltaV );
    42234235#endif
    42244236      }
     4237#if R0164_CGS_LUT_BUGFIX_CHECK
     4238      pc3DAsymLUT->xSetExplicit( yIdx + (l<<shift) , uIdx , vIdx );
     4239#endif
     4240    }
    42254241#if R0164_CGS_LUT_BUGFIX
    4226       pc3DAsymLUT->xSetExplicit( yIdx + (l<<shift) , uIdx , vIdx );
    4227 #endif
    4228     }
     4242    for ( Int u=0 ; u<nLength ; u++ ) {
     4243      for ( Int v=0 ; v<nLength ; v++ ) {
     4244        if ( u!=0 || v!=0 ) {
     4245          for ( Int y=0 ; y<nLength*nYPartNum ; y++ ) {
     4246            for( Int nVertexIdx = 0 ; nVertexIdx < 4 ; nVertexIdx++ )
     4247            {
     4248              pc3DAsymLUT->setCuboidVertexResTree( yIdx + y , uIdx + u , vIdx + v , nVertexIdx , 0 , 0 , 0 );
     4249#if R0164_CGS_LUT_BUGFIX_CHECK
     4250              pc3DAsymLUT->xSetFilled( yIdx + y , uIdx + u , vIdx + v );
     4251#endif
     4252            }
     4253          }
     4254        }
     4255      }
     4256    }
     4257#endif
    42294258  }
    42304259}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r850 r852  
    28742874#endif
    28752875
    2876 #if R0164_CGS_LUT_BUGFIX
     2876#if R0164_CGS_LUT_BUGFIX_CHECK
    28772877  pc3DAsymLUT->xInitCuboids();
    28782878#endif
    28792879  xCode3DAsymLUTOctant( pc3DAsymLUT , 0 , 0 , 0 , 0 , 1 << pc3DAsymLUT->getCurOctantDepth() );
    2880 #if R0164_CGS_LUT_BUGFIX
    2881   pc3DAsymLUT->xCuboidsExplicitCheck( false );
     2880#if R0164_CGS_LUT_BUGFIX_CHECK
     2881  xCuboidsFilledCheck( false );
     2882  pc3DAsymLUT->display( false );
    28822883#endif
    28832884}
     
    29422943        }
    29432944      }
    2944 #if R0164_CGS_LUT_BUGFIX
     2945#if R0164_CGS_LUT_BUGFIX_CHECK
    29452946      pc3DAsymLUT->xSetExplicit( yIdx + (l<<shift) , uIdx , vIdx );
    29462947#endif
Note: See TracChangeset for help on using the changeset viewer.