changeset 11950:f09f3b4a2115 draft

modify api x265_get_ref_frame_list to provide POC lists for L0 and L1 references
author Santhoshini Sekar <santhoshini@multicorewareinc.com>
date Tue, 12 Dec 2017 18:04:04 +0530
parents 6b079854e56e
children 57eaef9abfd8
files doc/reST/api.rst source/CMakeLists.txt source/encoder/api.cpp source/encoder/encoder.cpp source/encoder/encoder.h source/x265.h
diffstat 6 files changed, 10 insertions(+-), 8 deletions(-) [+]
line wrap: on
line diff
--- a/doc/reST/api.rst	Thu Dec 07 09:19:11 2017 +0100
+++ b/doc/reST/api.rst	Tue Dec 12 18:04:04 2017 +0530
@@ -206,7 +206,7 @@ changes made to the parameters for auto-
     /* x265_get_ref_frame_list:
      *     returns negative on error, 0 when access unit were output.
      *     This API must be called after(poc >= lookaheadDepth + bframes + 2) condition check */
-     int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int);
+     int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int, int*, int*);
  
 **x265_encoder_ctu_info** may be used to provide additional CTU-specific information to the encoder::
 
--- a/source/CMakeLists.txt	Thu Dec 07 09:19:11 2017 +0100
+++ b/source/CMakeLists.txt	Tue Dec 12 18:04:04 2017 +0530
@@ -29,7 +29,7 @@ option(NATIVE_BUILD "Target the build CP
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 147)
+set(X265_BUILD 148)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
--- a/source/encoder/api.cpp	Thu Dec 07 09:19:11 2017 +0100
+++ b/source/encoder/api.cpp	Tue Dec 12 18:04:04 2017 +0530
@@ -356,13 +356,13 @@ int x265_get_slicetype_poc_and_scenecut(
     return -1;
 }
 
-int x265_get_ref_frame_list(x265_encoder *enc, x265_picyuv** l0, x265_picyuv** l1, int sliceType, int poc)
+int x265_get_ref_frame_list(x265_encoder *enc, x265_picyuv** l0, x265_picyuv** l1, int sliceType, int poc, int* pocL0, int* pocL1)
 {
     if (!enc)
         return -1;
 
     Encoder *encoder = static_cast<Encoder*>(enc);
-    return encoder->getRefFrameList((PicYuv**)l0, (PicYuv**)l1, sliceType, poc);
+    return encoder->getRefFrameList((PicYuv**)l0, (PicYuv**)l1, sliceType, poc, pocL0, pocL1);
 }
 
 int x265_set_analysis_data(x265_encoder *enc, x265_analysis_data *analysis_data, int poc, uint32_t cuBytes)
--- a/source/encoder/encoder.cpp	Thu Dec 07 09:19:11 2017 +0100
+++ b/source/encoder/encoder.cpp	Tue Dec 12 18:04:04 2017 +0530
@@ -448,7 +448,7 @@ int Encoder::copySlicetypePocAndSceneCut
     return 0;
 }
 
-int Encoder::getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc)
+int Encoder::getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc, int* pocL0, int* pocL1)
 {
     if (!(IS_X265_TYPE_I(sliceType)))
     {
@@ -460,6 +460,7 @@ int Encoder::getRefFrameList(PicYuv** l0
                 if (framePtr->m_encData->m_slice->m_refFrameList[0][j] && framePtr->m_encData->m_slice->m_refFrameList[0][j]->m_reconPic != NULL)
                 {
                     int l0POC = framePtr->m_encData->m_slice->m_refFrameList[0][j]->m_poc;
+                    pocL0[j] = l0POC;
                     Frame* l0Fp = m_dpb->m_picList.getPOC(l0POC);
                     while (l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].get() == 0)
                         l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */
@@ -471,6 +472,7 @@ int Encoder::getRefFrameList(PicYuv** l0
                 if (framePtr->m_encData->m_slice->m_refFrameList[1][j] && framePtr->m_encData->m_slice->m_refFrameList[1][j]->m_reconPic != NULL)
                 {
                     int l1POC = framePtr->m_encData->m_slice->m_refFrameList[1][j]->m_poc;
+                    pocL1[j] = l1POC;
                     Frame* l1Fp = m_dpb->m_picList.getPOC(l1POC);
                     while (l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].get() == 0)
                         l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */
--- a/source/encoder/encoder.h	Thu Dec 07 09:19:11 2017 +0100
+++ b/source/encoder/encoder.h	Tue Dec 12 18:04:04 2017 +0530
@@ -208,7 +208,7 @@ public:
 
     int copySlicetypePocAndSceneCut(int *slicetype, int *poc, int *sceneCut);
 
-    int getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc);
+    int getRefFrameList(PicYuv** l0, PicYuv** l1, int sliceType, int poc, int* pocL0, int* pocL1);
 
     int setAnalysisDataAfterZScan(x265_analysis_data *analysis_data, Frame* curFrame);
 
--- a/source/x265.h	Thu Dec 07 09:19:11 2017 +0100
+++ b/source/x265.h	Tue Dec 12 18:04:04 2017 +0530
@@ -1746,7 +1746,7 @@ int x265_get_slicetype_poc_and_scenecut(
 /* x265_get_ref_frame_list:
  *     returns negative on error, 0 when access unit were output.
  *     This API must be called after(poc >= lookaheadDepth + bframes + 2) condition check */
-int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int);
+int x265_get_ref_frame_list(x265_encoder *encoder, x265_picyuv**, x265_picyuv**, int, int, int*, int*);
 
 /* x265_set_analysis_data:
  *     set the analysis data. The incoming analysis_data structure is assumed to be AVC-sized blocks.
@@ -1823,7 +1823,7 @@ typedef struct x265_api
     int           (*encoder_intra_refresh)(x265_encoder*);
     int           (*encoder_ctu_info)(x265_encoder*, int, x265_ctu_info_t**);
     int           (*get_slicetype_poc_and_scenecut)(x265_encoder*, int*, int*, int*);
-    int           (*get_ref_frame_list)(x265_encoder*, x265_picyuv**, x265_picyuv**, int, int);
+    int           (*get_ref_frame_list)(x265_encoder*, x265_picyuv**, x265_picyuv**, int, int, int*, int*);
     FILE*         (*csvlog_open)(const x265_param*);
     void          (*csvlog_frame)(const x265_param*, const x265_picture*);
     void          (*csvlog_encode)(x265_encoder*, const x265_stats*, int, char**);