Commit d1b16075 authored by Shelly Chiang's avatar Shelly Chiang

add the initial version

parent 2637b3c2
......@@ -85,6 +85,8 @@
#define JVET_O0364_PDPC_DC 1 // JVET-O0364 Part 4: align PDPC process for DC with the one for Planar
#define JVET_O0364_PDPC_ANGULAR 1 // JVET-O0364 Part 5: simplify PDPC process for angular modes
#define JVET_O0294_TRANSFORM_CLEANUP 1 // JVET-O0294: Context modelling for MTS index
#define FIX_DB_MAX_TRANSFORM_SIZE 1
#define MRG_SHARELIST_SHARSIZE 32
......
......@@ -2481,7 +2481,9 @@ void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID )
void CABACReader::mts_coding( TransformUnit& tu, ComponentID compID )
{
#if !JVET_O0294_TRANSFORM_CLEANUP
const CodingUnit &cu = *tu.cu;
#endif
const bool tsAllowed = TU::isTSAllowed ( tu, compID );
const bool mtsAllowed = TU::isMTSAllowed( tu, compID );
......@@ -2497,14 +2499,22 @@ void CABACReader::mts_coding( TransformUnit& tu, ComponentID compID )
{
ctxIdx = 6;
symbol = m_BinDecoder.decodeBin( Ctx::MTSIndex( ctxIdx ) );
#if JVET_O0294_TRANSFORM_CLEANUP
tu.mtsIdx = symbol ? MTS_SKIP : MTS_DCT2_DCT2;
#else
tu.mtsIdx = symbol ? MTS_DCT2_DCT2 : MTS_SKIP;
#endif
}
if( tu.mtsIdx != MTS_SKIP )
{
if( mtsAllowed )
{
#if JVET_O0294_TRANSFORM_CLEANUP
ctxIdx = 0;
#else
ctxIdx = std::min( (int)cu.qtDepth, 5 );
#endif
symbol = m_BinDecoder.decodeBin( Ctx::MTSIndex( ctxIdx ) );
if( symbol )
......
......@@ -2378,7 +2378,9 @@ void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID )
void CABACWriter::mts_coding( const TransformUnit& tu, ComponentID compID )
{
#if !JVET_O0294_TRANSFORM_CLEANUP
const CodingUnit &cu = *tu.cu;
#endif
const bool tsAllowed = TU::isTSAllowed ( tu, compID );
const bool mtsAllowed = TU::isMTSAllowed( tu, compID );
......@@ -2389,7 +2391,11 @@ void CABACWriter::mts_coding( const TransformUnit& tu, ComponentID compID )
if( tsAllowed )
{
#if JVET_O0294_TRANSFORM_CLEANUP
symbol = (tu.mtsIdx == MTS_SKIP) ? 1 : 0;
#else
symbol = (tu.mtsIdx == MTS_SKIP) ? 0 : 1;
#endif
ctxIdx = 6;
m_BinEncoder.encodeBin( symbol, Ctx::MTSIndex( ctxIdx ) );
}
......@@ -2399,7 +2405,11 @@ void CABACWriter::mts_coding( const TransformUnit& tu, ComponentID compID )
if( mtsAllowed )
{
symbol = tu.mtsIdx != MTS_DCT2_DCT2 ? 1 : 0;
#if JVET_O0294_TRANSFORM_CLEANUP
ctxIdx = 0;
#else
ctxIdx = std::min( (int)cu.qtDepth, 5 );
#endif
m_BinEncoder.encodeBin( symbol, Ctx::MTSIndex( ctxIdx ) );
if( symbol )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment