<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 3, 2017 at 4:19 PM,  <span dir="ltr"><<a href="mailto:praveen@multicorewareinc.com" target="_blank">praveen@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Praveen Tiwari <<a href="mailto:praveen@multicorewareinc.com">praveen@multicorewareinc.com</a>><br>
# Date 1509438457 -19800<br>
#      Tue Oct 31 13:57:37 2017 +0530<br>
# Node ID de91aae2db5353e4e548d002e2dce5<wbr>30a6c8078d<br>
# Parent  6a310b24c6a2d831ef08bbda1bdcf9<wbr>d929daa308<br>
api: 'x265_get_slicetype_poc_and_<wbr>scenecut' to fetch slicetype, poc and scenecut information<br></blockquote><div><br></div><div>Pushed to default branch. Thanks!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r 6a310b24c6a2 -r de91aae2db53 doc/reST/api.rst<br>
--- a/doc/reST/api.rst  Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/doc/reST/api.rst  Tue Oct 31 13:57:37 2017 +0530<br>
@@ -192,6 +192,15 @@<br>
         *      presets is not recommended without a more fine-grained breakdown of<br>
         *      parameters to take this into account. */<br>
        int x265_encoder_reconfig(x265_<wbr>encoder *, x265_param *);<br>
+<br>
+**x265_get_slicetype_poc_and_<wbr>scenecut()** may be used to fetch slice type, poc and scene cut information mid-encode::<br>
+<br>
+    /* x265_get_slicetype_poc_and_<wbr>scenecut:<br>
+     *     get the slice type, poc and scene cut information for the current frame,<br>
+     *     returns negative on error, 0 on success.<br>
+     *     This API must be called after(poc >= lookaheadDepth + bframes + 2) condition check. */<br>
+     int x265_get_slicetype_poc_and_<wbr>scenecut(x265_encoder *encoder, int *slicetype, int *poc, int* sceneCut);<br>
+<br>
 **x265_encoder_ctu_info**<br>
        /* x265_encoder_ctu_info:<br>
         *    Copy CTU information such as ctu address and ctu partition structure of all<br>
diff -r 6a310b24c6a2 -r de91aae2db53 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt     Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/source/CMakeLists.txt     Tue Oct 31 13:57:37 2017 +0530<br>
@@ -29,7 +29,7 @@<br>
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br>
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
 # X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 136)<br>
+set(X265_BUILD 137)<br>
 configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265.def.in" rel="noreferrer" target="_blank">x265.def.in</a>"<br>
                "${PROJECT_BINARY_DIR}/x265.<wbr>def")<br>
 configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265_config.h.in" rel="noreferrer" target="_blank">x265_config.h.in</a>"<br>
diff -r 6a310b24c6a2 -r de91aae2db53 source/common/piclist.cpp<br>
--- a/source/common/piclist.cpp Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/source/common/piclist.cpp Tue Oct 31 13:57:37 2017 +0530<br>
@@ -117,6 +117,15 @@<br>
         return NULL;<br>
 }<br>
<br>
+Frame* PicList::getCurFrame(void)<br>
+{<br>
+    Frame *curFrame = m_start;<br>
+    if (curFrame != NULL)<br>
+        return curFrame;<br>
+    else<br>
+        return NULL;<br>
+}<br>
+<br>
 void PicList::remove(Frame& curFrame)<br>
 {<br>
 #if _DEBUG<br>
diff -r 6a310b24c6a2 -r de91aae2db53 source/common/piclist.h<br>
--- a/source/common/piclist.h   Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/source/common/piclist.h   Tue Oct 31 13:57:37 2017 +0530<br>
@@ -62,6 +62,9 @@<br>
     /** Find frame with specified POC */<br>
     Frame* getPOC(int poc);<br>
<br>
+    /** Get the current Frame from the list **/<br>
+    Frame* getCurFrame(void);<br>
+<br>
     /** Remove picture from list */<br>
     void remove(Frame& pic);<br>
<br>
diff -r 6a310b24c6a2 -r de91aae2db53 source/encoder/api.cpp<br>
--- a/source/encoder/api.cpp    Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/source/encoder/api.cpp    Tue Oct 31 13:57:37 2017 +0530<br>
@@ -340,6 +340,16 @@<br>
     return 0;<br>
 }<br>
<br>
+int x265_get_slicetype_poc_and_<wbr>scenecut(x265_encoder *enc, int *slicetype, int *poc, int *sceneCut)<br>
+{<br>
+    if (!enc)<br>
+        return -1;<br>
+    Encoder *encoder = static_cast<Encoder*>(enc);<br>
+    if (!encoder-><wbr>copySlicetypePocAndSceneCut(<wbr>slicetype, poc, sceneCut))<br>
+        return 0;<br>
+    return -1;<br>
+}<br>
+<br>
 void x265_cleanup(void)<br>
 {<br>
     BitCost::destroy();<br>
@@ -413,6 +423,7 @@<br>
     sizeof(x265_frame_stats),<br>
     &x265_encoder_intra_refresh,<br>
     &x265_encoder_ctu_info,<br>
+    &x265_get_slicetype_poc_and_<wbr>scenecut,<br>
 };<br>
<br>
 typedef const x265_api* (*api_get_func)(int bitDepth);<br>
diff -r 6a310b24c6a2 -r de91aae2db53 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp        Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/source/encoder/encoder.cpp        Tue Oct 31 13:57:37 2017 +0530<br>
@@ -429,6 +429,23 @@<br>
     }<br>
 }<br>
<br>
+int Encoder::<wbr>copySlicetypePocAndSceneCut(<wbr>int *slicetype, int *poc, int *sceneCut)<br>
+{<br>
+    Frame *FramePtr = m_dpb->m_picList.getCurFrame()<wbr>;<br>
+    if (FramePtr != NULL)<br>
+    {<br>
+        *slicetype = FramePtr->m_lowres.sliceType;<br>
+        *poc = FramePtr->m_encData->m_slice-><wbr>m_poc;<br>
+        *sceneCut = FramePtr->m_lowres.bScenecut;<br>
+    }<br>
+    else<br>
+    {<br>
+        x265_log(NULL, X265_LOG_WARNING, "Frame is still in lookahead pipeline, this API must be called after (poc >= lookaheadDepth + bframes + 2) condition check\n");<br>
+        return -1;<br>
+    }<br>
+    return 0;<br>
+}<br>
+<br>
 void Encoder::destroy()<br>
 {<br>
 #if ENABLE_HDR10_PLUS<br>
diff -r 6a310b24c6a2 -r de91aae2db53 source/encoder/encoder.h<br>
--- a/source/encoder/encoder.h  Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/source/encoder/encoder.h  Tue Oct 31 13:57:37 2017 +0530<br>
@@ -205,6 +205,8 @@<br>
<br>
     void copyCtuInfo(x265_ctu_info_t** frameCtuInfo, int poc);<br>
<br>
+    int copySlicetypePocAndSceneCut(<wbr>int *slicetype, int *poc, int *sceneCut);<br>
+<br>
     void getStreamHeaders(NALList& list, Entropy& sbacCoder, Bitstream& bs);<br>
<br>
     void fetchStats(x265_stats* stats, size_t statsSizeBytes);<br>
diff -r 6a310b24c6a2 -r de91aae2db53 source/x265.h<br>
--- a/source/x265.h     Thu Nov 02 12:17:29 2017 +0530<br>
+++ b/source/x265.h     Tue Oct 31 13:57:37 2017 +0530<br>
@@ -1705,6 +1705,13 @@<br>
 int x265_encoder_ctu_info(x265_<wbr>encoder *, int poc, x265_ctu_info_t** ctu);<br>
 /* x265_cleanup:<br>
  *       release library static allocations, reset configured CTU size */<br>
+<br>
+/* x265_get_slicetype_poc_and_<wbr>scenecut:<br>
+ *     get the slice type, poc and scene cut information for the current frame,<br>
+ *     returns negative on error, 0 when access unit were output.<br>
+ *     This API must be called after(poc >= lookaheadDepth + bframes + 2) condition check */<br>
+int x265_get_slicetype_poc_and_<wbr>scenecut(x265_encoder *encoder, int *slicetype, int *poc, int* sceneCut);<br>
+<br>
 void x265_cleanup(void);<br>
<br>
 #define X265_MAJOR_VERSION 1<br>
@@ -1752,6 +1759,7 @@<br>
     int           sizeof_frame_stats;   /* sizeof(x265_frame_stats) */<br>
     int           (*encoder_intra_refresh)(x265_<wbr>encoder*);<br>
     int           (*encoder_ctu_info)(x265_<wbr>encoder*, int, x265_ctu_info_t**);<br>
+    int           (*x265_get_slicetype_poc_and_<wbr>scenecut)(x265_encoder*, int*, int*, int*);<br>
     /* add new pointers to the end, or increment X265_MAJOR_VERSION */<br>
 } x265_api;<br>
<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>