From 2dd5e48c2e2eee22f66591dd55a6c8555652ce22 Mon Sep 17 00:00:00 2001
From: Franck Galpin <franck.galpin@interdigital.com>
Date: Fri, 24 May 2024 16:25:27 +0000
Subject: [PATCH] Hop4 nnvc

---
 cfg/nn-based/HOP4.cfg          | 5 +++++
 source/Lib/CommonLib/Picture.h | 3 +++
 source/Lib/CommonLib/TypeDef.h | 1 +
 3 files changed, 9 insertions(+)
 create mode 100644 cfg/nn-based/HOP4.cfg

diff --git a/cfg/nn-based/HOP4.cfg b/cfg/nn-based/HOP4.cfg
new file mode 100644
index 000000000..6eb7ed284
--- /dev/null
+++ b/cfg/nn-based/HOP4.cfg
@@ -0,0 +1,5 @@
+NnlfOption                 : 4   
+NnlfModelName		   : models/nnlf_hop4_model_int16.sadl
+CbQpOffset                          : 1 
+CrQpOffset                          : 1 
+
diff --git a/source/Lib/CommonLib/Picture.h b/source/Lib/CommonLib/Picture.h
index 427de890d..d9631c179 100644
--- a/source/Lib/CommonLib/Picture.h
+++ b/source/Lib/CommonLib/Picture.h
@@ -433,6 +433,9 @@ public:
     m_picprm.block_size = sps.getNnlfUnifiedInferSize(inferGranularity);
     m_picprm.extension  = sps.getNnlfUnifiedInfSizeExt();
     m_picprm.prmNum = sps.getNnlfUnifiedMaxNumPrms();
+#if JVET_AH0205_AH0189_WIDE_ATTEN
+    if (sps.getNnlfId() == NNLFUnifiedID::HOP4) m_picprm.block_size=sps.getNnlfUnifiedInferSize(NNLF_UNIFIED_INFER_GRANULARITY_BASE);
+#endif
 #if JVET_AG0130_UNIFIED_SR
     const PPS& pps = *slice.getPPS();
     if(pps.getPPSId() == ENC_PPS_ID_RPR)
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 90f23174f..e188db088 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -64,6 +64,7 @@ using TypeSadlLFUnified=int16_t;
 #define JVET_AH0080_TRANS_INPUT           1 // JVET-AH0080: joint LOP model with inputs transformed
 #define JVET_AH0096_CONTENT_ADAPTIVE_LOP  1 // JVET-AH0096: Content-adaptive loop-filter
 #define NN_LF_UNIFIED_ID                  1 // unified the model switch using sps ID
+#define JVET_AH0205_AH0189_WIDE_ATTEN     1 // JVET-AH0205: Attention for HOP + AH0189 wide activation
 #endif
 
 
-- 
GitLab