Changeset 826 in SHVCSoftware for branches/SHM-dev


Ignore:
Timestamp:
12 Jul 2014, 08:45:16 (10 years ago)
Author:
interdigital
Message:

Added R0300_CGS_RES_COEFF_CODING for improved residual coefficient coding
Added R0179_CGS_SIZE_8x1x1 to allow 8x1x1 LUT size

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

Legend:

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

    r825 r826  
    8080{
    8181  assert( nCurOctantDepth <= m_nMaxOctantDepth );
     82#if R0179_CGS_SIZE_8x1x1
     83  assert( nCurYPartNumLog2 + nCurOctantDepth <= m_nMaxYPartNumLog2 + m_nMaxOctantDepth );
     84#else
    8285  assert( nCurYPartNumLog2 <= m_nMaxYPartNumLog2 );
     86#endif
    8387
    8488  m_nCurOctantDepth = nCurOctantDepth;
  • branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.h

    r825 r826  
    4444  Int   getResQuantBit()     { return m_nResQuanBit; }
    4545  Void  setResQuantBit(Int n){ m_nResQuanBit = n; }
     46#if R0300_CGS_RES_COEFF_CODING
     47  Int   getMappingShift()     { return m_nMappingShift; }
     48  Int   getDeltaBits()        { return m_nDeltaBits; }
     49  Void  setDeltaBits(Int n)   { m_nDeltaBits = n; }
     50#endif
    4651  Int   getMaxYPartNumLog2() { return m_nMaxYPartNumLog2; }
    4752  Int   getCurYPartNumLog2() { return m_nCurYPartNumLog2; }
     
    97102  Int   m_nMappingOffset;
    98103  Int   m_nResQuanBit;
     104#if R0300_CGS_RES_COEFF_CODING
     105  Int   m_nDeltaBits;
     106#endif
    99107  SCuboid *** m_pCuboid;
    100108  const static Int m_nVertexIdxOffset[4][3];
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r825 r826  
    9696#define R0151_CGS_3D_ASYMLUT_IMPROVE     1      ///< JCTVC-R0151: Non-uniform chroma partitioning and improved LUT coefficient coding
    9797#define R0164_CGS_LUT_BUGFIX             1      ///< JCTVC-R0164: Bug fix with LUT syntax
     98#define R0179_CGS_SIZE_8x1x1             1      ///< JCTVC-R0179: allow CGS LUT size to be 8x1x1 as well
     99#define R0300_CGS_RES_COEFF_CODING       1      ///< JCTVC-R0300: improved residual coefficient coding for R0151
    98100#endif
    99101#define O0194_WEIGHTED_PREDICTION_CGS    1      ///< JCTVC-O0194: Weighted prediciton for color gamut scalability
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r825 r826  
    39353935#endif
    39363936  UInt uiCurOctantDepth , uiCurPartNumLog2 , uiInputBitDepthM8 , uiOutputBitDepthM8 , uiResQaunBit;
     3937#if R0300_CGS_RES_COEFF_CODING
     3938  UInt uiDeltaBits;
     3939#endif
    39373940  READ_CODE( 2 , uiCurOctantDepth , "cm_octant_depth" );
    39383941  READ_CODE( 2 , uiCurPartNumLog2 , "cm_y_part_num_log2" );     
     
    39523955#endif
    39533956  READ_CODE( 2 , uiResQaunBit , "cm_res_quant_bit" );
     3957#if R0300_CGS_RES_COEFF_CODING
     3958  READ_CODE( 2 , uiDeltaBits , "cm_flc_bits" );
     3959  pc3DAsymLUT->setDeltaBits(uiDeltaBits + 1);
     3960#endif
     3961
    39543962#if R0151_CGS_3D_ASYMLUT_IMPROVE
    39553963#if R0150_CGS_SIGNAL_CONSTRAINTS
     
    40204028  else
    40214029  {
     4030#if R0300_CGS_RES_COEFF_CODING
     4031    Int nFLCbits = pc3DAsymLUT->getMappingShift()-pc3DAsymLUT->getResQuantBit()-pc3DAsymLUT->getDeltaBits() ;
     4032    nFLCbits = nFLCbits >= 0 ? nFLCbits:0;
     4033#endif
    40224034    for( Int l = 0 ; l < nYPartNum ; l++ )
    40234035    {
     
    40334045        {
    40344046#if R0151_CGS_3D_ASYMLUT_IMPROVE
     4047#if R0300_CGS_RES_COEFF_CODING
     4048          xReadParam( deltaY, nFLCbits );
     4049          xReadParam( deltaU, nFLCbits );
     4050          xReadParam( deltaV, nFLCbits );
     4051#else
    40354052          xReadParam( deltaY );
    40364053          xReadParam( deltaU );
    40374054          xReadParam( deltaV );
     4055#endif
    40384056#else
    40394057          READ_SVLC( deltaY , "resY" );
     
    40564074
    40574075#if R0151_CGS_3D_ASYMLUT_IMPROVE
     4076#if R0300_CGS_RES_COEFF_CODING
     4077Void TDecCavlc::xReadParam( Int& param, Int rParam )
     4078#else
    40584079Void TDecCavlc::xReadParam( Int& param )
    4059 {
     4080#endif
     4081{
     4082#if !R0300_CGS_RES_COEFF_CODING
    40604083  const UInt rParam = 7;
     4084#endif
    40614085  UInt prefix;
    40624086  UInt codeWord ;
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h

    r825 r826  
    144144  Void xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength );
    145145#if R0151_CGS_3D_ASYMLUT_IMPROVE
     146#if R0300_CGS_RES_COEFF_CODING
     147  Void xReadParam( Int& param, Int flc_bits );
     148#else
    146149  Void xReadParam( Int& param );
     150#endif
    147151#endif
    148152#endif
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r825 r826  
    27892789  assert( pc3DAsymLUT->getResQuantBit() < 4 );
    27902790  WRITE_CODE( pc3DAsymLUT->getResQuantBit() , 2 , "cm_res_quant_bit" );
     2791#if R0300_CGS_RES_COEFF_CODING
     2792  xFindDeltaBits( pc3DAsymLUT );
     2793  assert(pc3DAsymLUT->getDeltaBits() >=1 && pc3DAsymLUT->getDeltaBits() <= 4);
     2794  WRITE_CODE( pc3DAsymLUT->getDeltaBits()-1 , 2 , "cm_delta_bit" );
     2795#endif
    27912796#if R0151_CGS_3D_ASYMLUT_IMPROVE
    27922797  if( pc3DAsymLUT->getCurOctantDepth() == 1 )
     
    28282833  else
    28292834  {
     2835#if R0300_CGS_RES_COEFF_CODING
     2836    Int nFLCbits = pc3DAsymLUT->getMappingShift()-pc3DAsymLUT->getResQuantBit()-pc3DAsymLUT->getDeltaBits() ;
     2837    nFLCbits = nFLCbits >= 0 ? nFLCbits : 0;
     2838#endif
    28302839    for( Int l = 0 ; l < nYPartNum ; l++ )
    28312840    {
     
    28452854        {
    28462855#if R0151_CGS_3D_ASYMLUT_IMPROVE
     2856#if R0300_CGS_RES_COEFF_CODING
     2857          xWriteParam( sRes.Y, nFLCbits );
     2858          xWriteParam( sRes.U, nFLCbits );
     2859          xWriteParam( sRes.V, nFLCbits );
     2860#else
    28472861          xWriteParam( sRes.Y );
    28482862          xWriteParam( sRes.U );
    28492863          xWriteParam( sRes.V );
     2864#endif
    28502865#else
    28512866          WRITE_SVLC( sRes.Y , "resY" );
     
    28632878
    28642879#if R0151_CGS_3D_ASYMLUT_IMPROVE
     2880#if R0300_CGS_RES_COEFF_CODING
     2881Void TEncCavlc::xWriteParam( Int param, UInt rParam)
     2882#else
    28652883Void TEncCavlc::xWriteParam( Int param)
    2866 {
     2884#endif
     2885{
     2886#if !R0300_CGS_RES_COEFF_CODING
    28672887  const UInt rParam = 7;
     2888#endif
    28682889  Int codeNumber = abs(param);
    28692890  WRITE_UVLC(codeNumber / (1 << rParam), "quotient");
     
    28742895#endif
    28752896
     2897#if R0300_CGS_RES_COEFF_CODING
     2898Void TEncCavlc::xFindDeltaBits( TCom3DAsymLUT * pc3DAsymLUT )
     2899{
     2900  Int nDeltaBits;
     2901  Int nBestDeltaBits = -1;
     2902  Int nBestBits = MAX_INT;
     2903  for( nDeltaBits = 1; nDeltaBits < 5; nDeltaBits++)
     2904  {
     2905    Int nCurBits = 0;
     2906    xTally3DAsymLUTOctantBits( pc3DAsymLUT , 0 , 0 , 0 , 0 , 1 << pc3DAsymLUT->getCurOctantDepth(), nDeltaBits, nCurBits );
     2907    //printf("%d, %d, %d\n", nDeltaBits, nCurBits, nBestBits);
     2908    if(nCurBits < nBestBits)
     2909    {
     2910      nBestDeltaBits = nDeltaBits;
     2911      nBestBits = nCurBits;
     2912    }
     2913  }
     2914
     2915  assert(nBestDeltaBits >=1 && nBestDeltaBits < 5);
     2916  pc3DAsymLUT->setDeltaBits(nBestDeltaBits);
     2917}
     2918
     2919Void TEncCavlc::xTally3DAsymLUTOctantBits( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength, Int nDeltaBits, Int& nCurBits )
     2920{
     2921  UInt uiOctantSplit = nDepth < pc3DAsymLUT->getCurOctantDepth();
     2922  if( nDepth < pc3DAsymLUT->getCurOctantDepth() )
     2923    nCurBits ++;
     2924  Int nYPartNum = 1 << pc3DAsymLUT->getCurYPartNumLog2();
     2925  if( uiOctantSplit )
     2926  {
     2927    Int nHalfLength = nLength >> 1;
     2928    for( Int l = 0 ; l < 2 ; l++ )
     2929    {
     2930      for( Int m = 0 ; m < 2 ; m++ )
     2931      {
     2932        for( Int n = 0 ; n < 2 ; n++ )
     2933        {
     2934          xTally3DAsymLUTOctantBits( pc3DAsymLUT , nDepth + 1 , yIdx + l * nHalfLength * nYPartNum , uIdx + m * nHalfLength , vIdx + n * nHalfLength , nHalfLength, nDeltaBits, nCurBits );
     2935        }
     2936      }
     2937    }
     2938  }
     2939  else
     2940  {
     2941    Int nFLCbits = pc3DAsymLUT->getMappingShift()-pc3DAsymLUT->getResQuantBit()-nDeltaBits ;
     2942    nFLCbits = nFLCbits >= 0 ? nFLCbits:0;
     2943    //printf("nFLCbits = %d\n", nFLCbits);
     2944
     2945    for( Int l = 0 ; l < nYPartNum ; l++ )
     2946    {
     2947      for( Int nVertexIdx = 0 ; nVertexIdx < 4 ; nVertexIdx++ )
     2948      {
     2949        SYUVP sRes = pc3DAsymLUT->getCuboidVertexResTree( yIdx + l , uIdx , vIdx , nVertexIdx );
     2950
     2951        UInt uiCodeVertex = sRes.Y != 0 || sRes.U != 0 || sRes.V != 0;
     2952        nCurBits++;
     2953        if( uiCodeVertex )
     2954        {
     2955          xCheckParamBits( sRes.Y, nFLCbits, nCurBits );
     2956          xCheckParamBits( sRes.U, nFLCbits, nCurBits );
     2957          xCheckParamBits( sRes.V, nFLCbits, nCurBits );
     2958        }
     2959      }
     2960    }
     2961  }
     2962}
     2963
     2964Void TEncCavlc::xCheckParamBits( Int param, Int rParam, Int &nBits)
     2965{
     2966  Int codeNumber = abs(param);
     2967  Int codeQuotient = codeNumber >> rParam;
     2968  Int qLen;
     2969
     2970  UInt uiLength = 1;
     2971  UInt uiTemp = ++codeQuotient;
     2972   
     2973  while( 1 != uiTemp )
     2974  {
     2975    uiTemp >>= 1;
     2976    uiLength += 2;
     2977  }
     2978
     2979  qLen  = (uiLength >> 1);
     2980  qLen += ((uiLength+1) >> 1);
     2981
     2982  nBits += qLen;
     2983  nBits += rParam;
     2984  if (abs(param))
     2985    nBits++;
     2986}
     2987#endif
     2988
    28762989#endif
    28772990//! \}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h

    r825 r826  
    174174  Void xCode3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength );
    175175#if R0151_CGS_3D_ASYMLUT_IMPROVE
     176#if R0300_CGS_RES_COEFF_CODING
     177  Void xWriteParam( Int param, UInt nFLCBits);
     178  Void xCheckParamBits( Int param, Int nFLCBits, Int & nCurBits);
     179  Void xTally3DAsymLUTOctantBits( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength, Int nDeltaBits, Int &nCurBits);
     180  Void xFindDeltaBits( TCom3DAsymLUT * pc3DAsymLUT );
     181#else
    176182  Void xWriteParam( Int param);
     183#endif
    177184#endif
    178185#endif
Note: See TracChangeset for help on using the changeset viewer.