Index: branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.cpp
===================================================================
--- branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.cpp	(revision 1350)
+++ branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.cpp	(revision 1351)
@@ -1554,5 +1554,55 @@
 };
 
+UInt SEIAlternativeDepthInfo::getManGvdFocalLengthXLen       ( Int i, int j ) const
+{
+  return xGetSyntaxElementLen( m_expGvdFocalLengthX[i][j], m_precGvdFocalLength, m_manGvdFocalLengthX[i][j]  );
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdFocalLengthYLen       ( Int i, int j ) const
+{
+  return xGetSyntaxElementLen( m_expGvdFocalLengthY[i][j], m_precGvdFocalLength, m_manGvdFocalLengthY[i][j]  );
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdPrincipalPointXLen    ( Int i, int j ) const
+{
+  return xGetSyntaxElementLen( m_expGvdPrincipalPointX[i][j], m_precGvdPrincipalPoint, m_manGvdPrincipalPointX[i][j]  );
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdPrincipalPointYLen    ( Int i, int j ) const
+{
+  return xGetSyntaxElementLen( m_expGvdPrincipalPointY[i][j], m_precGvdPrincipalPoint, m_manGvdPrincipalPointY[i][j]  );
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdRLen                  ( Int i, int j, int k ) const
+{
+  return xGetSyntaxElementLen( m_expGvdR[i][j][k], m_precGvdRotationParam, m_manGvdR[i][j][k] );
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdTXLen                 ( Int i, int j ) const
+{
+  return xGetSyntaxElementLen( m_expGvdTX[i][j], m_precGvdTranslationParam, m_manGvdTX[i][j]  );
+};
+
+UInt SEIAlternativeDepthInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
+{
+  UInt len;
+  if( expo == 0 )
+  {
+    len = std::max(0, prec - 30 );
+  }
+  else
+  {
+    len = std::max( 0, expo + prec - 31 );
+  }
+
+#if DEBUG_NH_3D_SEI
+  printf("DEBUG: SEIAlternativeDepthInfo::xGetSyntaxElementLen(): val: %d, len %u\n", val, len);
 #endif
+  assert( val >= 0 );
+  assert( val <= ( ( 1 << len )- 1) );
+  return len;
+}
 
 #endif
+
+#endif
Index: branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.h
===================================================================
--- branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.h	(revision 1350)
+++ branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.h	(revision 1351)
@@ -1150,4 +1150,12 @@
   Void setupFromCfgFile( const Char*      cfgFile );
   Bool checkCfg        ( const TComSlice* slice   );
+
+  UInt getManGvdFocalLengthXLen       ( Int i, Int j ) const;
+  UInt getManGvdFocalLengthYLen       ( Int i, Int j ) const;
+  UInt getManGvdPrincipalPointXLen    ( Int i, Int j ) const;
+  UInt getManGvdPrincipalPointYLen    ( Int i, Int j ) const;
+  UInt getManGvdRLen                  ( Int i, int j, int k ) const;
+  UInt getManGvdTXLen                 ( Int i, Int j ) const;
+  UInt xGetSyntaxElementLen           ( Int expo, Int prec, Int val ) const;
 
   Void resizeArrays( )
Index: branches/HTM-15.1-dev0-NICT/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- branches/HTM-15.1-dev0-NICT/source/Lib/TLibDecoder/SEIread.cpp	(revision 1350)
+++ branches/HTM-15.1-dev0-NICT/source/Lib/TLibDecoder/SEIread.cpp	(revision 1351)
@@ -1745,14 +1745,24 @@
           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_x" ); sei.m_signGvdFocalLengthX[i][j] = (code == 1);
           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_x" ); sei.m_expGvdFocalLengthX[i][j] = code;
-          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdFocalLength, code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i][j] = code;
+          //sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdFocalLength, code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthXLen(i,j), code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i][j] = code;
           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_y" ); sei.m_signGvdFocalLengthY[i][j] = (code == 1);
           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_y" ); sei.m_expGvdFocalLengthY[i][j] = code;
-          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdFocalLength, code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i][j] = code;
+          //sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdFocalLength, code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthYLen(i,j), code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i][j] = code;
           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_x" ); sei.m_signGvdPrincipalPointX[i][j] = (code == 1);
           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_x" ); sei.m_expGvdPrincipalPointX[i][j] = code;
-          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdPrincipalPoint, code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i][j] = code;
+          //sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdPrincipalPoint, code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointXLen(i,j), code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i][j] = code;
           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_y" ); sei.m_signGvdPrincipalPointY[i][j] = (code == 1);
           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_y" ); sei.m_expGvdPrincipalPointY[i][j] = code;
-          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdPrincipalPoint, code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i][j] = code;
+          //sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdPrincipalPoint, code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointYLen(i,j), code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i][j] = code;
+#if DEBUG_NH_3D_SEI
+          printf("manLEN_gvd_focal_length_x     : sei.getManGvdFocalLengthXLen(%d,%d): %u\n", i, j, sei.getManGvdFocalLengthXLen(i,j));
+          printf("manLEN_gvd_focal_length_y     : sei.getManGvdFocalLengthYLen(%d,%d): %u\n", i, j, sei.getManGvdFocalLengthYLen(i,j));
+          printf("manLEN_gvd_principal_point_x  : sei.getManGvdPrincipalPointXLen(%d,%d): %u\n", i, j, sei.getManGvdPrincipalPointXLen(i,j));
+          printf("manLEN_gvd_principal_point_x  : sei.getManGvdPrincipalPointYLen(%d,%d): %u\n", i, j, sei.getManGvdPrincipalPointYLen(i,j));
+#endif
         }
         if( sei.m_rotationGvdFlag )
@@ -1763,12 +1773,15 @@
             sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r" ); sei.m_expGvdR[i][j][k] = code;
             sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r" ); sei.m_manGvdR[i][j][k] = code;
+            //sei_read_code( pDecodedMessageOutputStream, sei.getManGvdRLen(i,j,k), code, "man_gvd_r" ); sei.m_manGvdR[i][j][k] = code;
           }
         }
         if( sei.m_translationGvdFlag )
         {
-#if NH_MV_SEI_TBD
           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_t_x" ); sei.m_signGvdTX[i][j] = (code == 1);
           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_t_x" ); sei.m_expGvdTX[i][j] = code;
-          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdTranslationParam, code, "man_gvd_t_x" ); sei.m_manGvdTX[i][j] = code;
+          //sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdTranslationParam, code, "man_gvd_t_x" ); sei.m_manGvdTX[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdTXLen(i,j), code, "man_gvd_t_x" ); sei.m_manGvdTX[i][j] = code;
+#if DEBUG_NH_3D_SEI
+          printf("manLEN_gvd_t_x                : sei.getManGvdTXLen(%d,%d): %u\n", i, j, sei.getManGvdTXLen(i,j));
 #endif
         }
Index: branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1350)
+++ branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1351)
@@ -1385,26 +1385,34 @@
           printf("exp_gvd_focal_length_x        : sei.m_expGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_expGvdFocalLengthX[i][j]);
           printf("man_gvd_focal_length_x        : sei.m_manGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_manGvdFocalLengthX[i][j]);
+          printf("manLEN_gvd_focal_length_x     : sei.getManGvdFocalLengthXLen(%d,%d): %u\n", i, j, sei.getManGvdFocalLengthXLen(i,j));
           printf("sign_gvd_focal_length_y       : sei.m_signGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_signGvdFocalLengthY[i][j]);
           printf("exp_gvd_focal_length_y        : sei.m_expGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_expGvdFocalLengthY[i][j]);
           printf("man_gvd_focal_length_y        : sei.m_manGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_manGvdFocalLengthY[i][j]);
+          printf("manLEN_gvd_focal_length_y     : sei.getManGvdFocalLengthYLen(%d,%d): %u\n", i, j, sei.getManGvdFocalLengthYLen(i,j));
           printf("sign_gvd_principal_point_x    : sei.m_signGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_signGvdPrincipalPointX[i][j]);
           printf("exp_gvd_principal_point_x     : sei.m_expGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_expGvdPrincipalPointX[i][j]);
           printf("man_gvd_principal_point_x     : sei.m_manGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_manGvdPrincipalPointX[i][j]);
+          printf("manLEN_gvd_principal_point_x  : sei.getManGvdPrincipalPointXLen(%d,%d): %u\n", i, j, sei.getManGvdPrincipalPointXLen(i,j));
           printf("sign_gvd_principal_point_y    : sei.m_signGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_signGvdPrincipalPointY[i][j]);
           printf("exp_gvd_principal_point_y     : sei.m_expGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_expGvdPrincipalPointY[i][j]);
           printf("man_gvd_principal_point_y     : sei.m_manGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_manGvdPrincipalPointY[i][j]);
+          printf("manLEN_gvd_principal_point_x  : sei.getManGvdPrincipalPointYLen(%d,%d): %u\n", i, j, sei.getManGvdPrincipalPointYLen(i,j));
 #endif
           WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" );
           WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" );
-          WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_x" );
+          //WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_x" );
+          WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.getManGvdFocalLengthXLen(i,j), "man_gvd_focal_length_x" );
           WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" );
           WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" );
-          WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_y" );
+          //WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_y" );
+          WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.getManGvdFocalLengthYLen(i,j), "man_gvd_focal_length_y" );
           WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" );
           WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" );
-          WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_x" );
+          //WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_x" );
+          WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.getManGvdPrincipalPointXLen(i,j), "man_gvd_principal_point_x" );
           WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" );
           WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" );
-          WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_y" );
+          //WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_y" );
+          WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.getManGvdPrincipalPointYLen(i,j), "man_gvd_principal_point_y" );
         }
         if( sei.m_rotationGvdFlag )
@@ -1416,8 +1424,10 @@
             printf("exp_gvd_r                     : sei.m_expGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_expGvdR[i][j][k]);
             printf("man_gvd_r                     : sei.m_manGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_manGvdR[i][j][k]);
+            printf("manLEN_gvd_r                  : sei.getManGvdRLen(%d,%d,%d): %u\n", i, j, k, sei.getManGvdRLen(i,j,k));
 #endif
             WRITE_FLAG( ( sei.m_signGvdR[i][j][k] ? 1 : 0 ), "sign_gvd_r" );
             WRITE_CODE( sei.m_expGvdR[i][j][k], 6, "exp_gvd_r" );
-            WRITE_CODE( sei.m_manGvdR[i][j][k], sei.m_precGvdTranslationParam, "man_gvd_r" );
+            WRITE_CODE( sei.m_manGvdR[i][j][k], sei.m_precGvdRotationParam, "man_gvd_r" );
+            //WRITE_CODE( sei.m_manGvdR[i][j][k], sei.getManGvdRLen(i,j,k), "man_gvd_r" );
           }
         }
@@ -1428,8 +1438,10 @@
           printf("exp_gvd_t_x                   : sei.m_expGvdTX[%d][%d]: %u\n", i, j, sei.m_expGvdTX[i][j]);
           printf("man_gvd_t_x                   : sei.m_manGvdTX[%d][%d]: %u\n", i, j, sei.m_manGvdTX[i][j]);
+          printf("manLEN_gvd_t_x                : sei.getManGvdTXLen(%d,%d): %u\n", i, j, sei.getManGvdTXLen(i,j));
 #endif
           WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" );
           WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" );
-          WRITE_CODE( sei.m_manGvdTX[i][j], sei.m_numConstituentViewsGvdMinus1, "man_gvd_t_x" );
+          //WRITE_CODE( sei.m_manGvdTX[i][j], sei.m_precGvdTranslationParam, "man_gvd_t_x" );
+          WRITE_CODE( sei.m_manGvdTX[i][j], sei.getManGvdTXLen(i,j), "man_gvd_t_x" );
         }
       }
