<div dir="ltr">FrameEncoder and compressFrame needs to be refactored for mallocs and failures to be handled correctly. <br><div><div><div id="__tbSetup"></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Sep 19, 2013 at 1:31 PM, Gopu Govindaswamy <span dir="ltr"><<a href="mailto:gopu@multicorewareinc.com" target="_blank">gopu@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 Gopu Govindaswamy <<a href="mailto:gopu@multicorewareinc.com">gopu@multicorewareinc.com</a>><br>
# Date 1379577682 -19800<br>
# Node ID 92e1ac03b081eccd8bc797142cc22033c87d475d<br>
# Parent  26d6f155f8df69147f40f4945d99c29a52988c56<br>
do not use std;:list for the class AccessUnit<br>
<br>
Removed std::list from encoder and nalunits<br>
<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/Lib/TLibCommon/NAL.h<br>
--- a/source/Lib/TLibCommon/NAL.h       Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/Lib/TLibCommon/NAL.h       Thu Sep 19 13:31:22 2013 +0530<br>
@@ -114,6 +114,7 @@<br>
      * emulation_prevention_three_byte symbols.<br>
      */<br>
     NALUnitEBSP(OutputNALUnit& nalu);<br>
+    void init(OutputNALUnit& nalu);<br>
 };<br>
 }<br>
 //! \}<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/Lib/TLibEncoder/NALwrite.h<br>
--- a/source/Lib/TLibEncoder/NALwrite.h Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/Lib/TLibEncoder/NALwrite.h Thu Sep 19 13:31:22 2013 +0530<br>
@@ -83,6 +83,14 @@<br>
     write(m_nalUnitData, nalu, m_packetSize);<br>
 }<br>
<br>
+inline void NALUnitEBSP::init(OutputNALUnit& nalu)<br>
+{<br>
+    m_nalUnitType = nalu.m_nalUnitType;<br>
+    m_temporalId = nalu.m_temporalId;<br>
+    m_reservedZero6Bits = nalu.m_reservedZero6Bits;<br>
+    write(m_nalUnitData, nalu, m_packetSize);<br>
+}<br>
+<br>
 void copyNaluData(OutputNALUnit& naluDest, const OutputNALUnit& naluSrc);<br>
 }<br>
<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/Lib/TLibEncoder/TEncTop.cpp<br>
--- a/source/Lib/TLibEncoder/TEncTop.cpp        Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/Lib/TLibEncoder/TEncTop.cpp        Thu Sep 19 13:31:22 2013 +0530<br>
@@ -114,7 +114,7 @@<br>
         for (int i = 0; i < param.frameNumThreads; i++)<br>
         {<br>
             // Ensure frame encoder is idle before destroying it<br>
-            AccessUnit tmp;<br>
+            NALUnitEBSP **tmp = NULL;<br>
             m_frameEncoder[i].getEncodedPicture(tmp);<br>
             m_frameEncoder[i].destroy();<br>
         }<br>
@@ -155,19 +155,19 @@<br>
     }<br>
 }<br>
<br>
-int TEncTop::getStreamHeaders(AccessUnit& accessUnit)<br>
+int TEncTop::getStreamHeaders(NALUnitEBSP **nalunits)<br>
 {<br>
-    return m_frameEncoder->getStreamHeaders(accessUnit);<br>
+    return m_frameEncoder->getStreamHeaders(nalunits);<br>
 }<br>
<br>
 /**<br>
  \param   flush               force encoder to encode a frame<br>
  \param   pic_in              input original YUV picture or NULL<br>
  \param   pic_out             pointer to reconstructed picture struct<br>
- \param   accessUnitsOut      output bitstream<br>
+ \param   nalunits            output bitstream<br>
  \retval                      number of encoded pictures<br>
  */<br>
-int TEncTop::encode(bool flush, const x265_picture_t* pic_in, x265_picture_t *pic_out, AccessUnit& accessUnitOut)<br>
+int TEncTop::encode(bool flush, const x265_picture_t* pic_in, x265_picture_t *pic_out, NALUnitEBSP **nalunits)<br>
 {<br>
     if (pic_in)<br>
     {<br>
@@ -207,7 +207,7 @@<br>
     // getEncodedPicture() should block until the FrameEncoder has completed<br>
     // encoding the frame.  This is how back-pressure through the API is<br>
     // accomplished when the encoder is full.<br>
-    TComPic *out = curEncoder->getEncodedPicture(accessUnitOut);<br>
+    TComPic *out = curEncoder->getEncodedPicture(nalunits);<br>
<br>
     if (!out && flush)<br>
     {<br>
@@ -221,7 +221,7 @@<br>
         {<br>
             curEncoder = &m_frameEncoder[m_curEncoder];<br>
             m_curEncoder = (m_curEncoder + 1) % param.frameNumThreads;<br>
-            out = curEncoder->getEncodedPicture(accessUnitOut);<br>
+            out = curEncoder->getEncodedPicture(nalunits);<br>
         }<br>
         while (!out && flushed != m_curEncoder);<br>
     }<br>
@@ -253,7 +253,7 @@<br>
             pic_out->stride[2] = recpic->getCStride();<br>
         }<br>
<br>
-        double bits = calculateHashAndPSNR(out, accessUnitOut);<br>
+        double bits = calculateHashAndPSNR(out, nalunits);<br>
         // Allow this frame to be recycled if no frame encoders are using it for reference<br>
         ATOMIC_DEC(&out->m_countRefEncoders);<br>
<br>
@@ -481,7 +481,7 @@<br>
<br>
 /* Returns Number of bits in current encoded pic */<br>
<br>
-double TEncTop::calculateHashAndPSNR(TComPic* pic, AccessUnit& accessUnit)<br>
+double TEncTop::calculateHashAndPSNR(TComPic* pic, NALUnitEBSP **nalunits)<br>
 {<br>
     TComPicYuv* recon = pic->getPicYuvRec();<br>
     TComPicYuv* orig  = pic->getPicYuvOrg();<br>
@@ -537,8 +537,12 @@<br>
         OutputNALUnit onalu(NAL_UNIT_SUFFIX_SEI, 0);<br>
         m_frameEncoder->m_seiWriter.writeSEImessage(onalu.m_Bitstream, sei_recon_picture_digest, pic->getSlice()->getSPS());<br>
         writeRBSPTrailingBits(onalu.m_Bitstream);<br>
-<br>
-        accessUnit.insert(accessUnit.end(), new NALUnitEBSP(onalu));<br>
+<br>
+        int count = 0;<br>
+        while(nalunits[count] != NULL)<br>
+            count++;<br>
+        nalunits[count] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1);<br>
+        nalunits[count]->init(onalu);<br>
     }<br>
<br>
     /* calculate the size of the access unit, excluding:<br>
@@ -546,13 +550,14 @@<br>
      *  - SEI NAL units<br>
      */<br>
     UInt numRBSPBytes = 0;<br>
-    for (AccessUnit::const_iterator it = accessUnit.begin(); it != accessUnit.end(); it++)<br>
+    UInt count = 0;<br>
+    for (; nalunits[count] != NULL; count++)<br>
     {<br>
-        UInt numRBSPBytes_nal = (*it)->m_packetSize;<br>
+        UInt numRBSPBytes_nal = nalunits[count]->m_packetSize;<br>
 #if VERBOSE_RATE<br>
         printf("*** %6s numBytesInNALunit: %u\n", nalUnitTypeToString((*it)->m_nalUnitType), numRBSPBytes_nal);<br>
 #endif<br>
-        if ((*it)->m_nalUnitType != NAL_UNIT_PREFIX_SEI && (*it)->m_nalUnitType != NAL_UNIT_SUFFIX_SEI)<br>
+        if (nalunits[count]->m_nalUnitType != NAL_UNIT_PREFIX_SEI && nalunits[count]->m_nalUnitType != NAL_UNIT_SUFFIX_SEI)<br>
         {<br>
             numRBSPBytes += numRBSPBytes_nal;<br>
         }<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/Lib/TLibEncoder/TEncTop.h<br>
--- a/source/Lib/TLibEncoder/TEncTop.h  Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/Lib/TLibEncoder/TEncTop.h  Thu Sep 19 13:31:22 2013 +0530<br>
@@ -101,9 +101,9 @@<br>
     void xInitSPS(TComSPS *sps);<br>
     void xInitPPS(TComPPS *pps);<br>
<br>
-    int encode(bool bEos, const x265_picture_t* pic, x265_picture_t *pic_out, AccessUnit& accessUnit);<br>
+    int encode(bool bEos, const x265_picture_t* pic, x265_picture_t *pic_out, NALUnitEBSP **nalunits);<br>
<br>
-    int getStreamHeaders(AccessUnit& accessUnit);<br>
+    int getStreamHeaders(NALUnitEBSP **nalunits);<br>
<br>
     double printSummary();<br>
<br>
@@ -113,7 +113,7 @@<br>
<br>
 protected:<br>
<br>
-    double calculateHashAndPSNR(TComPic* pic, AccessUnit&); // Returns total number of bits for encoded pic<br>
+    double calculateHashAndPSNR(TComPic* pic, NALUnitEBSP **nalunits); // Returns total number of bits for encoded pic<br>
 };<br>
 }<br>
 //! \}<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp        Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/encoder/encoder.cpp        Thu Sep 19 13:31:22 2013 +0530<br>
@@ -47,7 +47,7 @@<br>
<br>
     void configure(x265_param_t *param);<br>
     void determineLevelAndProfile(x265_param_t *param);<br>
-    void extract_naldata(AccessUnit &au, size_t &nalcount);<br>
+    void extract_naldata(NALUnitEBSP **nalunits, size_t &nalcount);<br>
 };<br>
<br>
 x265_t::x265_t()<br>
@@ -356,18 +356,23 @@<br>
<br>
 int x265_encoder_headers(x265_t *encoder, x265_nal_t **pp_nal, int *pi_nal)<br>
 {<br>
-    // there is a lot of duplicated code here, see x265_encoder_encode()<br>
     if (!pp_nal)<br>
         return 0;<br>
<br>
-    AccessUnit au;<br>
-    if (encoder->getStreamHeaders(au) == 0)<br>
+    NALUnitEBSP *nalunits[X265_NAL_UNITS] = { 0, 0, 0, 0, 0 };<br>
+    if (encoder->getStreamHeaders(nalunits) == 0)<br>
     {<br>
         size_t nalcount;<br>
-        encoder->extract_naldata( au, nalcount);<br>
+        encoder->extract_naldata(nalunits, nalcount);<br>
<br>
         *pp_nal = &encoder->m_nals[0];<br>
         if (pi_nal) *pi_nal = (int)nalcount;<br>
+<br>
+        for (nalcount = 0; nalcount < X265_NAL_UNITS; nalcount++)<br>
+        {<br>
+            if (nalunits[nalcount])<br>
+                X265_FREE(nalunits[nalcount]);<br>
+        }<br>
         return 0;<br>
     }<br>
     else<br>
@@ -377,17 +382,22 @@<br>
 extern "C"<br>
 int x265_encoder_encode(x265_t *encoder, x265_nal_t **pp_nal, int *pi_nal, x265_picture_t *pic_in, x265_picture_t *pic_out)<br>
 {<br>
-    AccessUnit au;<br>
-<br>
-    int numEncoded = encoder->encode(!pic_in, pic_in, pic_out, au);<br>
+    NALUnitEBSP *nalunits[X265_NAL_UNITS] = { 0, 0, 0, 0, 0 };<br>
+    int numEncoded = encoder->encode(!pic_in, pic_in, pic_out, nalunits);<br>
<br>
     if (pp_nal && numEncoded)<br>
     {<br>
         size_t nalcount;<br>
-        encoder->extract_naldata( au, nalcount);<br>
+        encoder->extract_naldata(nalunits, nalcount);<br>
<br>
         *pp_nal = &encoder->m_nals[0];<br>
         if (pi_nal) *pi_nal =(int) nalcount;<br>
+<br>
+        for (nalcount = 0; nalcount < X265_NAL_UNITS; nalcount++)<br>
+        {<br>
+            if (nalunits[nalcount])<br>
+                X265_FREE(nalunits[nalcount]);<br>
+        }<br>
     }<br>
     else if (pi_nal)<br>
         *pi_nal = 0;<br>
@@ -417,15 +427,14 @@<br>
     BitCost::destroy();<br>
 }<br>
<br>
-void x265_t::extract_naldata( AccessUnit &au, size_t &nalcount)<br>
+void x265_t::extract_naldata(NALUnitEBSP **nalunits, size_t &nalcount)<br>
 {<br>
         UInt memsize = 0;<br>
         nalcount = 0;<br>
-        for (AccessUnit::const_iterator t = au.begin(); t != au.end(); t++)<br>
+        for (; nalunits[nalcount] != NULL; nalcount++)<br>
         {<br>
-            const NALUnitEBSP& temp = **t;<br>
+            const NALUnitEBSP& temp = *nalunits[nalcount];<br>
             memsize += temp.m_packetSize + 4;<br>
-            nalcount++;<br>
         }<br>
<br>
         if (m_packetData)<br>
@@ -440,13 +449,13 @@<br>
         memsize = 0;<br>
<br>
         /* Copy NAL output packets into x265_nal_t structures */<br>
-        for (AccessUnit::const_iterator it = au.begin(); it != au.end(); it++)<br>
+        for (; nalunits[nalcount] != NULL; nalcount++)<br>
         {<br>
-            const NALUnitEBSP& nalu = **it;<br>
+            const NALUnitEBSP& nalu = *nalunits[nalcount];<br>
             int size = 0; /* size of annexB unit in bytes */<br>
<br>
             static const char start_code_prefix[] = { 0, 0, 0, 1 };<br>
-            if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)<br>
+            if (nalcount == 0 || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)<br>
             {<br>
                 /* From AVC, When any of the following conditions are fulfilled, the<br>
                     * zero_byte syntax element shall be present:<br>
@@ -472,7 +481,6 @@<br>
<br>
             m_nals[nalcount].i_type = nalu.m_nalUnitType;<br>
             m_nals[nalcount].i_payload = size;<br>
-            nalcount++;<br>
             free(nalu.m_nalUnitData);<br>
         }<br>
<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/encoder/frameencoder.cpp<br>
--- a/source/encoder/frameencoder.cpp   Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/encoder/frameencoder.cpp   Thu Sep 19 13:31:22 2013 +0530<br>
@@ -55,7 +55,12 @@<br>
     , m_cfg(NULL)<br>
     , m_pic(NULL)<br>
     , m_rows(NULL)<br>
-{}<br>
+{<br>
+    for (int i = 0; i < 5; i++)<br>
+        m_accessUnit[i] = NULL;<br>
+<br>
+    m_nalcount = 0;<br>
+}<br>
<br>
 void FrameEncoder::setThreadPool(ThreadPool *p)<br>
 {<br>
@@ -158,30 +163,40 @@<br>
     start();<br>
 }<br>
<br>
-int FrameEncoder::getStreamHeaders(AccessUnit& accessUnit)<br>
+int FrameEncoder::getStreamHeaders(NALUnitEBSP **nalunits)<br>
 {<br>
     TEncEntropy* entropyCoder = getEntropyCoder(0);<br>
<br>
     entropyCoder->setEntropyCoder(&m_cavlcCoder, NULL);<br>
+    int count = 0;<br>
<br>
     /* headers for start of bitstream */<br>
     OutputNALUnit nalu(NAL_UNIT_VPS);<br>
     entropyCoder->setBitstream(&nalu.m_Bitstream);<br>
     entropyCoder->encodeVPS(m_cfg->getVPS());<br>
     writeRBSPTrailingBits(nalu.m_Bitstream);<br>
-    accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+    if ((nalunits[count] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1)) == NULL)<br>
+        return -1;<br>
+    nalunits[count]->init(nalu);<br>
+    count++;<br>
<br>
     nalu = NALUnit(NAL_UNIT_SPS);<br>
     entropyCoder->setBitstream(&nalu.m_Bitstream);<br>
     entropyCoder->encodeSPS(&m_sps);<br>
     writeRBSPTrailingBits(nalu.m_Bitstream);<br>
-    accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+    if ((nalunits[count] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1)) == NULL)<br>
+        return -1;<br>
+    nalunits[count]->init(nalu);<br>
+    count++;<br>
<br>
     nalu = NALUnit(NAL_UNIT_PPS);<br>
     entropyCoder->setBitstream(&nalu.m_Bitstream);<br>
     entropyCoder->encodePPS(&m_pps);<br>
     writeRBSPTrailingBits(nalu.m_Bitstream);<br>
-    accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+    if ((nalunits[count] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1)) == NULL)<br>
+        return -1;<br>
+    nalunits[count]->init(nalu);<br>
+    count++;<br>
<br>
     if (m_cfg->getActiveParameterSetsSEIEnabled())<br>
     {<br>
@@ -195,7 +210,10 @@<br>
         entropyCoder->setBitstream(&nalu.m_Bitstream);<br>
         m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei, &m_sps);<br>
         writeRBSPTrailingBits(nalu.m_Bitstream);<br>
-        accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+        if ((nalunits[count] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1)) == NULL)<br>
+            return -1;<br>
+        nalunits[count]->init(nalu);<br>
+        count++;<br>
     }<br>
<br>
     if (m_cfg->getDisplayOrientationSEIAngle())<br>
@@ -210,7 +228,9 @@<br>
         entropyCoder->setBitstream(&nalu.m_Bitstream);<br>
         m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei, &m_sps);<br>
         writeRBSPTrailingBits(nalu.m_Bitstream);<br>
-        accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+        if ((nalunits[count] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1)) == NULL)<br>
+            return -1;<br>
+        nalunits[count]->init(nalu);<br>
     }<br>
     return 0;<br>
 }<br>
@@ -275,7 +295,8 @@<br>
 void FrameEncoder::compressFrame()<br>
 {<br>
     PPAScopeEvent(FrameEncoder_compressFrame);<br>
-<br>
+<br>
+    m_nalcount = 0;<br>
     TEncEntropy* entropyCoder = getEntropyCoder(0);<br>
     TComSlice*   slice        = m_pic->getSlice();<br>
<br>
@@ -470,7 +491,9 @@<br>
<br>
             m_seiWriter.writeSEImessage(nalu.m_Bitstream, seiGradualDecodingRefreshInfo, slice->getSPS());<br>
             writeRBSPTrailingBits(nalu.m_Bitstream);<br>
-            m_accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+            m_accessUnit[m_nalcount] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1);<br>
+            m_accessUnit[m_nalcount]->init(nalu);<br>
+            m_nalcount++;<br>
         }<br>
         // Recovery point SEI<br>
         OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);<br>
@@ -482,7 +505,9 @@<br>
<br>
         m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_recovery_point, slice->getSPS());<br>
         writeRBSPTrailingBits(nalu.m_Bitstream);<br>
-        m_accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+        m_accessUnit[m_nalcount] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1);<br>
+        m_accessUnit[m_nalcount]->init(nalu);<br>
+        m_nalcount++;<br>
     }<br>
<br>
     /* use the main bitstream buffer for storing the marshaled picture */<br>
@@ -617,7 +642,9 @@<br>
     entropyCoder->setBitstream(&nalu.m_Bitstream);<br>
     bitstreamRedirect->clear();<br>
<br>
-    m_accessUnit.push_back(new NALUnitEBSP(nalu));<br>
+    m_accessUnit[m_nalcount] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1);<br>
+    m_accessUnit[m_nalcount]->init(nalu);<br>
+    m_nalcount++;<br>
<br>
     if (m_sps.getUseSAO())<br>
     {<br>
@@ -982,7 +1009,7 @@<br>
     }<br>
 }<br>
<br>
-TComPic *FrameEncoder::getEncodedPicture(AccessUnit& accessUnit)<br>
+TComPic *FrameEncoder::getEncodedPicture(NALUnitEBSP **nalunits)<br>
 {<br>
     if (m_pic)<br>
     {<br>
@@ -992,8 +1019,8 @@<br>
         TComPic *ret = m_pic;<br>
         m_pic = NULL;<br>
<br>
-        // move NALs from member variable list to end of user's container<br>
-        accessUnit.splice(accessUnit.end(), m_accessUnit);<br>
+        // move NALs from member variable to end of user's container<br>
+        ::memcpy(nalunits, m_accessUnit, sizeof(NALUnitEBSP) * m_nalcount);<br>
         return ret;<br>
     }<br>
<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/encoder/frameencoder.h<br>
--- a/source/encoder/frameencoder.h     Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/encoder/frameencoder.h     Thu Sep 19 13:31:22 2013 +0530<br>
@@ -135,7 +135,7 @@<br>
         }<br>
     }<br>
<br>
-    int getStreamHeaders(AccessUnit& accessUnitOut);<br>
+    int getStreamHeaders(NALUnitEBSP **nalunits);<br>
<br>
     void initSlice(TComPic* pic);<br>
<br>
@@ -148,7 +148,7 @@<br>
     void encodeSlice(TComOutputBitstream* substreams);<br>
<br>
     /* blocks until worker thread is done, returns encoded picture and bitstream */<br>
-    TComPic *getEncodedPicture(AccessUnit& accessUnit);<br>
+    TComPic *getEncodedPicture(NALUnitEBSP **nalunits);<br>
<br>
     // worker thread<br>
     void threadMain();<br>
@@ -178,7 +178,8 @@<br>
<br>
     /* Picture being encoded, and its output NAL list */<br>
     TComPic*                 m_pic;<br>
-    AccessUnit               m_accessUnit;<br>
+    NALUnitEBSP              *m_accessUnit[X265_NAL_UNITS];<br>
+    int                      m_nalcount;<br>
<br>
     int                      m_numRows;<br>
     int                      m_filterRowDelay;<br>
diff -r 26d6f155f8df -r 92e1ac03b081 source/x265.h<br>
--- a/source/x265.h     Wed Sep 18 16:13:33 2013 -0500<br>
+++ b/source/x265.h     Thu Sep 19 13:31:22 2013 +0530<br>
@@ -173,6 +173,7 @@<br>
 #define X265_TYPE_KEYFRAME      0x0006  /* IDR or I depending on b_open_gop option */<br>
 #define IS_X265_TYPE_I(x) ((x)==X265_TYPE_I || (x)==X265_TYPE_IDR)<br>
 #define IS_X265_TYPE_B(x) ((x)==X265_TYPE_B || (x)==X265_TYPE_BREF)<br>
+#define X265_NAL_UNITS          5<br>
<br>
 /* rate tolerance method */<br>
 typedef enum RcMethod<br>
_______________________________________________<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" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div>