Changeset 826 in SHVCSoftware for branches/SHM-dev
- Timestamp:
- 12 Jul 2014, 08:45:16 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.cpp
r825 r826 80 80 { 81 81 assert( nCurOctantDepth <= m_nMaxOctantDepth ); 82 #if R0179_CGS_SIZE_8x1x1 83 assert( nCurYPartNumLog2 + nCurOctantDepth <= m_nMaxYPartNumLog2 + m_nMaxOctantDepth ); 84 #else 82 85 assert( nCurYPartNumLog2 <= m_nMaxYPartNumLog2 ); 86 #endif 83 87 84 88 m_nCurOctantDepth = nCurOctantDepth; -
branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.h
r825 r826 44 44 Int getResQuantBit() { return m_nResQuanBit; } 45 45 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 46 51 Int getMaxYPartNumLog2() { return m_nMaxYPartNumLog2; } 47 52 Int getCurYPartNumLog2() { return m_nCurYPartNumLog2; } … … 97 102 Int m_nMappingOffset; 98 103 Int m_nResQuanBit; 104 #if R0300_CGS_RES_COEFF_CODING 105 Int m_nDeltaBits; 106 #endif 99 107 SCuboid *** m_pCuboid; 100 108 const static Int m_nVertexIdxOffset[4][3]; -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r825 r826 96 96 #define R0151_CGS_3D_ASYMLUT_IMPROVE 1 ///< JCTVC-R0151: Non-uniform chroma partitioning and improved LUT coefficient coding 97 97 #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 98 100 #endif 99 101 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r825 r826 3935 3935 #endif 3936 3936 UInt uiCurOctantDepth , uiCurPartNumLog2 , uiInputBitDepthM8 , uiOutputBitDepthM8 , uiResQaunBit; 3937 #if R0300_CGS_RES_COEFF_CODING 3938 UInt uiDeltaBits; 3939 #endif 3937 3940 READ_CODE( 2 , uiCurOctantDepth , "cm_octant_depth" ); 3938 3941 READ_CODE( 2 , uiCurPartNumLog2 , "cm_y_part_num_log2" ); … … 3952 3955 #endif 3953 3956 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 3954 3962 #if R0151_CGS_3D_ASYMLUT_IMPROVE 3955 3963 #if R0150_CGS_SIGNAL_CONSTRAINTS … … 4020 4028 else 4021 4029 { 4030 #if R0300_CGS_RES_COEFF_CODING 4031 Int nFLCbits = pc3DAsymLUT->getMappingShift()-pc3DAsymLUT->getResQuantBit()-pc3DAsymLUT->getDeltaBits() ; 4032 nFLCbits = nFLCbits >= 0 ? nFLCbits:0; 4033 #endif 4022 4034 for( Int l = 0 ; l < nYPartNum ; l++ ) 4023 4035 { … … 4033 4045 { 4034 4046 #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 4035 4052 xReadParam( deltaY ); 4036 4053 xReadParam( deltaU ); 4037 4054 xReadParam( deltaV ); 4055 #endif 4038 4056 #else 4039 4057 READ_SVLC( deltaY , "resY" ); … … 4056 4074 4057 4075 #if R0151_CGS_3D_ASYMLUT_IMPROVE 4076 #if R0300_CGS_RES_COEFF_CODING 4077 Void TDecCavlc::xReadParam( Int& param, Int rParam ) 4078 #else 4058 4079 Void TDecCavlc::xReadParam( Int& param ) 4059 { 4080 #endif 4081 { 4082 #if !R0300_CGS_RES_COEFF_CODING 4060 4083 const UInt rParam = 7; 4084 #endif 4061 4085 UInt prefix; 4062 4086 UInt codeWord ; -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r825 r826 144 144 Void xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ); 145 145 #if R0151_CGS_3D_ASYMLUT_IMPROVE 146 #if R0300_CGS_RES_COEFF_CODING 147 Void xReadParam( Int& param, Int flc_bits ); 148 #else 146 149 Void xReadParam( Int& param ); 150 #endif 147 151 #endif 148 152 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r825 r826 2789 2789 assert( pc3DAsymLUT->getResQuantBit() < 4 ); 2790 2790 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 2791 2796 #if R0151_CGS_3D_ASYMLUT_IMPROVE 2792 2797 if( pc3DAsymLUT->getCurOctantDepth() == 1 ) … … 2828 2833 else 2829 2834 { 2835 #if R0300_CGS_RES_COEFF_CODING 2836 Int nFLCbits = pc3DAsymLUT->getMappingShift()-pc3DAsymLUT->getResQuantBit()-pc3DAsymLUT->getDeltaBits() ; 2837 nFLCbits = nFLCbits >= 0 ? nFLCbits : 0; 2838 #endif 2830 2839 for( Int l = 0 ; l < nYPartNum ; l++ ) 2831 2840 { … … 2845 2854 { 2846 2855 #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 2847 2861 xWriteParam( sRes.Y ); 2848 2862 xWriteParam( sRes.U ); 2849 2863 xWriteParam( sRes.V ); 2864 #endif 2850 2865 #else 2851 2866 WRITE_SVLC( sRes.Y , "resY" ); … … 2863 2878 2864 2879 #if R0151_CGS_3D_ASYMLUT_IMPROVE 2880 #if R0300_CGS_RES_COEFF_CODING 2881 Void TEncCavlc::xWriteParam( Int param, UInt rParam) 2882 #else 2865 2883 Void TEncCavlc::xWriteParam( Int param) 2866 { 2884 #endif 2885 { 2886 #if !R0300_CGS_RES_COEFF_CODING 2867 2887 const UInt rParam = 7; 2888 #endif 2868 2889 Int codeNumber = abs(param); 2869 2890 WRITE_UVLC(codeNumber / (1 << rParam), "quotient"); … … 2874 2895 #endif 2875 2896 2897 #if R0300_CGS_RES_COEFF_CODING 2898 Void 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 2919 Void 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 2964 Void 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 2876 2989 #endif 2877 2990 //! \} -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h
r825 r826 174 174 Void xCode3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ); 175 175 #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 176 182 Void xWriteParam( Int param); 183 #endif 177 184 #endif 178 185 #endif
Note: See TracChangeset for help on using the changeset viewer.