>From 0e97ef4ea834c3fb305dc22d5dc4d917f44d8a35 Mon Sep 17 00:00:00 2001
From: ashok2022 <[email protected]>
Date: Wed, 21 Sep 2022 17:59:57 +0530
Subject: [PATCH] Get slice type of mcstf frame

---
 source/encoder/slicetype.cpp | 21 +++++++++++++++++++++
 source/encoder/slicetype.h   |  1 +
 2 files changed, 22 insertions(+)

diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp
index 1222a8511..93ddffe62 100644
--- a/source/encoder/slicetype.cpp
+++ b/source/encoder/slicetype.cpp
@@ -2409,6 +2409,27 @@ void Lookahead::slicetypePath(Lowres **frames, int
length, char(*best_paths)[X26
     memcpy(best_paths[length % (X265_BFRAME_MAX + 1)], paths[idx ^ 1],
length);
 }

+// Find slicetype of the frame with poc # in lookahead buffer
+int Lookahead::FindSliceType(int poc)
+{
+    int out_slicetype = X265_TYPE_AUTO;
+    if (m_filled)
+    {
+        m_outputLock.acquire();
+        Frame* out = m_outputQueue.first();
+        while (out != NULL) {
+            if (poc == out->m_poc)
+            {
+                out_slicetype = out->m_lowres.sliceType;
+                break;
+            }
+            out = out->m_next;
+        }
+        m_outputLock.release();
+    }
+    return out_slicetype;
+}
+
 int64_t Lookahead::slicetypePathCost(Lowres **frames, char *path, int64_t
threshold)
 {
     int64_t cost = 0;
diff --git a/source/encoder/slicetype.h b/source/encoder/slicetype.h
index 6484ad8a0..52b55a4a8 100644
--- a/source/encoder/slicetype.h
+++ b/source/encoder/slicetype.h
@@ -174,6 +174,7 @@ public:

     void    getEstimatedPictureCost(Frame *pic);
     void    setLookaheadQueue();
+    int FindSliceType(int poc);

 protected:

-- 
2.34.1.windows.1

*Thanks and Regards,*





*Snehaa.GVideo Codec Engineer,Media & AI analytics
<https://multicorewareinc.com/>*

Attachment: mcstf_patch_05.diff
Description: Binary data

_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to