<div dir="ltr">Pushed to default.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 9, 2020 at 2:30 PM Aruna Matheswaran <<a href="mailto:aruna@multicorewareinc.com">aruna@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Aruna <<a href="mailto:aruna@multicorewareinc.com" target="_blank">aruna@multicorewareinc.com</a>><br>
# Date 1586417955 -19800<br>
#      Thu Apr 09 13:09:15 2020 +0530<br>
# Node ID 6bb2d88029c2e13fa13b5b053aa725d4fa84a084<br>
# Parent  479b96e84e98d54ad19a396769b2ec54d4c44660<br>
app: Fix encode errors with multi-lib builds.<br>
<br>
Enables the application to use the correct version of API based on the internal<br>
bit-depth specified run-time.<br>
<br>
Fixes issue #539<br>
<br>
diff -r 479b96e84e98 -r 6bb2d88029c2 source/abrEncApp.cpp<br>
--- a/source/abrEncApp.cpp      Wed Apr 01 19:49:11 2020 -0700<br>
+++ b/source/abrEncApp.cpp      Thu Apr 09 13:09:15 2020 +0530<br>
@@ -256,13 +256,13 @@<br>
         }<br>
<br>
         if (m_param)<br>
-            m_encoder = x265_encoder_open(m_param);<br>
+            m_encoder = m_cliopt.api->encoder_open(m_param);<br>
         if (!m_encoder)<br>
         {<br>
             x265_log(NULL, X265_LOG_ERROR, "x265_encoder_open() failed for Enc, \n");<br>
             return -1;<br>
         }<br>
-        x265_encoder_parameters(m_encoder, m_param);<br>
+        m_cliopt.api->encoder_parameters(m_encoder, m_param);<br>
         return 1;<br>
     }<br>
<br>
@@ -567,7 +567,7 @@<br>
 #endif<br>
         /* This allows muxers to modify bitstream format */<br>
         m_cliopt.output->setParam(m_param);<br>
-<br>
+        const x265_api* api = m_cliopt.api;<br>
         ReconPlay* reconPlay = NULL;<br>
         if (m_cliopt.reconPlayCmd)<br>
             reconPlay = new ReconPlay(m_cliopt.reconPlayCmd, *m_param);<br>
@@ -595,7 +595,7 @@<br>
<br>
         if (!m_param->bRepeatHeaders && !m_param->bEnableSvtHevc)<br>
         {<br>
-            if (x265_encoder_headers(m_encoder, &p_nal, &nal) < 0)<br>
+            if (api->encoder_headers(m_encoder, &p_nal, &nal) < 0)<br>
             {<br>
                 x265_log(m_param, X265_LOG_ERROR, "Failure generating stream headers %d\n", m_id);<br>
                 goto fail;<br>
@@ -606,14 +606,14 @@<br>
<br>
         if (m_param->bField && m_param->interlaceMode)<br>
         {<br>
-            x265_picture_init(m_param, &picField1);<br>
-            x265_picture_init(m_param, &picField2);<br>
+            api->picture_init(m_param, &picField1);<br>
+            api->picture_init(m_param, &picField2);<br>
             // return back the original height of input<br>
             m_param->sourceHeight *= 2;<br>
-            x265_picture_init(m_param, &pic_orig);<br>
+            api->picture_init(m_param, &pic_orig);<br>
         }<br>
         else<br>
-            x265_picture_init(m_param, &pic_orig);<br>
+            api->picture_init(m_param, &pic_orig);<br>
<br>
         if (m_param->dolbyProfile && m_cliopt.dolbyVisionRpu)<br>
         {<br>
@@ -756,7 +756,7 @@<br>
                 else<br>
                     picInput = pic_in;<br>
<br>
-                int numEncoded = x265_encoder_encode(m_encoder, &p_nal, &nal, picInput, pic_recon);<br>
+                int numEncoded = api->encoder_encode(m_encoder, &p_nal, &nal, picInput, pic_recon);<br>
<br>
                 int idx = (inFrameCount - 1) % m_parent->m_queueSize;<br>
                 m_parent->m_picIdxReadCnt[m_id][idx].incr();<br>
@@ -802,7 +802,7 @@<br>
         /* Flush the encoder */<br>
         while (!b_ctrl_c)<br>
         {<br>
-            int numEncoded = x265_encoder_encode(m_encoder, &p_nal, &nal, NULL, pic_recon);<br>
+            int numEncoded = api->encoder_encode(m_encoder, &p_nal, &nal, NULL, pic_recon);<br>
             if (numEncoded < 0)<br>
                 break;<br>
<br>
@@ -856,12 +856,12 @@<br>
<br>
         delete reconPlay;<br>
<br>
-        x265_encoder_get_stats(m_encoder, &stats, sizeof(stats));<br>
+        api->encoder_get_stats(m_encoder, &stats, sizeof(stats));<br>
         if (m_param->csvfn && !b_ctrl_c)<br>
 #if ENABLE_LIBVMAF<br>
-            x265_vmaf_encoder_log(encoder, argc, argv, param, vmafdata);<br>
+            api->vmaf_encoder_log(encoder, argc, argv, param, vmafdata);<br>
 #else<br>
-            x265_encoder_log(m_encoder, 0, NULL);<br>
+            api->encoder_log(m_encoder, 0, NULL);<br>
 #endif<br>
<br>
         int64_t second_largest_pts = 0;<br>
@@ -882,8 +882,9 @@<br>
<br>
     void PassEncoder::close()<br>
     {<br>
-        x265_param_free(m_param);<br>
-        x265_encoder_close(m_encoder);<br>
+        const x265_api* api = m_cliopt.api;<br>
+        api->param_free(m_param);<br>
+        api->encoder_close(m_encoder);<br>
     }<br>
<br>
     void PassEncoder::destroy()<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="georgia, serif">Regards,</font><div><b><font face="georgia, serif">Aruna Matheswaran,</font></b></div><div><font face="georgia, serif">Video Codec Engineer,</font></div><div><font face="georgia, serif">Media & AI analytics BU,</font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" width="96" height="36" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><font face="georgia, serif"><br></font></div></div></div></div></div></div></div></div></div>