<div dir="ltr"><div dir="ltr"><div>From 0e97ef4ea834c3fb305dc22d5dc4d917f44d8a35 Mon Sep 17 00:00:00 2001</div><div>From: ashok2022 <<a href="mailto:ashok@multicorewareinc.com">ashok@multicorewareinc.com</a>></div><div>Date: Wed, 21 Sep 2022 17:59:57 +0530</div><div>Subject: [PATCH] Get slice type of mcstf frame</div><div><br></div><div>---</div><div> source/encoder/slicetype.cpp | 21 +++++++++++++++++++++</div><div> source/encoder/slicetype.h   |  1 +</div><div> 2 files changed, 22 insertions(+)</div><div><br></div><div>diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp</div><div>index 1222a8511..93ddffe62 100644</div><div>--- a/source/encoder/slicetype.cpp</div><div>+++ b/source/encoder/slicetype.cpp</div><div>@@ -2409,6 +2409,27 @@ void Lookahead::slicetypePath(Lowres **frames, int length, char(*best_paths)[X26</div><div>     memcpy(best_paths[length % (X265_BFRAME_MAX + 1)], paths[idx ^ 1], length);</div><div> }</div><div> </div><div>+// Find slicetype of the frame with poc # in lookahead buffer</div><div>+int Lookahead::FindSliceType(int poc)</div><div>+{</div><div>+    int out_slicetype = X265_TYPE_AUTO;</div><div>+    if (m_filled)</div><div>+    {</div><div>+        m_outputLock.acquire();</div><div>+        Frame* out = m_outputQueue.first();</div><div>+        while (out != NULL) {</div><div>+            if (poc == out->m_poc)</div><div>+            {</div><div>+                out_slicetype = out->m_lowres.sliceType;</div><div>+                break;</div><div>+            }</div><div>+            out = out->m_next;</div><div>+        }</div><div>+        m_outputLock.release();</div><div>+    }</div><div>+    return out_slicetype;</div><div>+}</div><div>+</div><div> int64_t Lookahead::slicetypePathCost(Lowres **frames, char *path, int64_t threshold)</div><div> {</div><div>     int64_t cost = 0;</div><div>diff --git a/source/encoder/slicetype.h b/source/encoder/slicetype.h</div><div>index 6484ad8a0..52b55a4a8 100644</div><div>--- a/source/encoder/slicetype.h</div><div>+++ b/source/encoder/slicetype.h</div><div>@@ -174,6 +174,7 @@ public:</div><div> </div><div>     void    getEstimatedPictureCost(Frame *pic);</div><div>     void    setLookaheadQueue();</div><div>+    int FindSliceType(int poc);</div><div> </div><div> protected:</div><div> </div><div>-- </div><div>2.34.1.windows.1</div><div><br></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><i><font face="georgia, serif">Thanks and Regards,</font></i></div><div><i><font face="georgia, serif"><b>Snehaa.G</b><br>Video Codec Engineer,<br>Media & AI analytics<br><a href="https://multicorewareinc.com/" target="_blank"><img src="https://ci3.googleusercontent.com/mail-sig/AIorK4yEumXeQ2mgcFAR2us9INa7z3rCbl8ordut3fbdeIbuPv0n3EA75Or1rHs0neGaI0WM8mFPz1g"></a><br><span></span><span></span><br></font></i></div></div></div></div></div></div>