[x265] [PATCH 5/14] Get slice type of mcstf frame

Snehaa Giridharan snehaa at multicorewareinc.com
Wed Oct 19 07:29:47 UTC 2022


>From 0e97ef4ea834c3fb305dc22d5dc4d917f44d8a35 Mon Sep 17 00:00:00 2001
From: ashok2022 <ashok at multicorewareinc.com>
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/>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20221019/38eefe2a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcstf_patch_05.diff
Type: application/octet-stream
Size: 1713 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20221019/38eefe2a/attachment.obj>


More information about the x265-devel mailing list