<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 16, 2018 at 1:50 PM,  <span dir="ltr"><<a href="mailto:bhavna@multicorewareinc.com" target="_blank">bhavna@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 Bhavna Hariharan <<a href="mailto:bhavna@multicorewareinc.com">bhavna@multicorewareinc.com</a>><br>
# Date 1518761265 -19800<br>
#      Fri Feb 16 11:37:45 2018 +0530<br>
# Node ID a92fd62210b87f112f5fe087ede1a0<wbr>e8f0eb8027<br>
# Parent  36ab263cc891e0cb5d3dd5ce2c80e3<wbr>5faa0ce996<br>
dhdr: comply to HDR10+ LLC spec<br>
<br>
This patch does the following -<br>
1) Consider Json files without Bezier Curve data as valid and inject them<br>
correctly without errors.<br>
2) The numWindows values is now taken from the numWindows JSON value, instead<br>
of taking it from 1+ellipsesNum. Add numWindows to the dictionary.<br>
3) Changed hardcoded applicationVersion value to 1 due to LLC requirement.<br>
<br>
diff -r 36ab263cc891 -r a92fd62210b8 source/dynamicHDR10/<wbr>SeiMetadataDictionary.cpp<br>
--- a/source/dynamicHDR10/<wbr>SeiMetadataDictionary.cpp     Wed Feb 14 15:45:29 2018 +0530<br>
+++ b/source/dynamicHDR10/<wbr>SeiMetadataDictionary.cpp     Fri Feb 16 11:37:45 2018 +0530<br>
@@ -28,6 +28,7 @@<br>
<br>
 const std::string JsonDataKeys::LocalParameters = std::string("LocalParameters")<wbr>;<br>
 const std::string JsonDataKeys::<wbr>TargetDisplayLuminance = std::string("<wbr>TargetedSystemDisplayMaximumLu<wbr>minance");<br>
+const std::string JsonDataKeys::NumberOfWindows = std::string("NumberOfWindows")<wbr>;<br>
<br>
 const std::string BezierCurveNames::TagName = std::string("BezierCurveData")<wbr>;<br>
 const std::string BezierCurveNames::<wbr>NumberOfAnchors = std::string("NumberOfAnchors")<wbr>;<br>
diff -r 36ab263cc891 -r a92fd62210b8 source/dynamicHDR10/<wbr>SeiMetadataDictionary.h<br>
--- a/source/dynamicHDR10/<wbr>SeiMetadataDictionary.h       Wed Feb 14 15:45:29 2018 +0530<br>
+++ b/source/dynamicHDR10/<wbr>SeiMetadataDictionary.h       Fri Feb 16 11:37:45 2018 +0530<br>
@@ -37,6 +37,7 @@<br>
         public:<br>
         static const std::string LocalParameters;<br>
         static const std::string TargetDisplayLuminance;<br>
+        static const std::string NumberOfWindows;<br>
     };<br>
<br>
     //Bezier Curve Data<br>
diff -r 36ab263cc891 -r a92fd62210b8 source/dynamicHDR10/<wbr>metadataFromJson.cpp<br>
--- a/source/dynamicHDR10/<wbr>metadataFromJson.cpp  Wed Feb 14 15:45:29 2018 +0530<br>
+++ b/source/dynamicHDR10/<wbr>metadataFromJson.cpp  Fri Feb 16 11:37:45 2018 +0530<br>
@@ -372,7 +372,7 @@<br>
     const uint16_t terminalProviderCode = 0x003C;<br>
     const uint16_t terminalProviderOrientedCode = 0x0001;<br>
     const uint8_t applicationIdentifier = 4;<br>
-    const uint8_t applicationVersion = 0;<br>
+    const uint8_t applicationVersion = 1;<br>
<br>
     mPimpl->appendBits(metadata, countryCode, 8);<br>
     mPimpl->appendBits(metadata, terminalProviderCode, 16);<br>
@@ -384,9 +384,7 @@<br>
     //Note: Validated only add up to two local selections, ignore the rest<br>
     JsonArray jsonArray = fileData[frame][JsonDataKeys::<wbr>LocalParameters].array_items()<wbr>;<br>
     int ellipsesNum = static_cast<int>(jsonArray.<wbr>size() > 2 ? 2 : jsonArray.size());<br>
-<br>
-    uint16_t numWindows = 1 + static_cast<uint16_t>(<wbr>ellipsesNum);<br>
-<br>
+    uint16_t numWindows = (uint16_t)fileData[frame][<wbr>JsonDataKeys::NumberOfWindows]<wbr>.int_value();<br>
     mPimpl->appendBits(metadata, numWindows, 2);<br>
     for (int i = 0; i < ellipsesNum; ++i)<br>
     {<br>
@@ -426,16 +424,15 @@<br>
<br>
         mPimpl->appendBits(metadata, semimajorExternalAxis, 16);<br>
         mPimpl->appendBits(metadata, semiminorExternalAxis, 16);<br>
-        /*bool*/ uint8_t overlapProcessOption = static_cast<uint8_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>OverlapProcessOption].int_<wbr>value()); //1;<br>
+        uint8_t overlapProcessOption = static_cast<uint8_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>OverlapProcessOption].int_<wbr>value());<br>
         //TODO: Uses Layering method, the value is "1"<br>
         mPimpl->appendBits(metadata, overlapProcessOption, 1);<br>
     }<br>
     /* Targeted System Display Data */<br>
-    uint32_t TEMPmonitorPeak = fileData[frame][JsonDataKeys::<wbr>TargetDisplayLuminance].int_<wbr>value();     //500;<br>
-    mPimpl->appendBits(metadata, TEMPmonitorPeak, 27);<br>
-<br>
+    uint32_t monitorPeak = fileData[frame][JsonDataKeys::<wbr>TargetDisplayLuminance].int_<wbr>value();     //500;<br>
+    mPimpl->appendBits(metadata, monitorPeak, 27);<br>
     //NOTE: Set as false for now, as requested<br>
-    /*bool*/uint8_t targetedSystemDisplayActualPea<wbr>kLuminanceFlag = 0; /*false*/<br>
+    uint8_t targetedSystemDisplayActualPea<wbr>kLuminanceFlag = 0;<br>
     mPimpl->appendBits(metadata, targetedSystemDisplayActualPea<wbr>kLuminanceFlag, 1);<br>
     if (<wbr>targetedSystemDisplayActualPea<wbr>kLuminanceFlag)<br>
     {<br>
@@ -463,7 +460,6 @@<br>
         mPimpl->appendBits(metadata, static_cast<uint16_t>((int)<wbr>luminanceData.maxGLuminance & 0xFFFF), 16);<br>
         mPimpl->appendBits(metadata, static_cast<uint8_t>(((int)<wbr>luminanceData.maxBLuminance & 0x10000) >> 16), 1);<br>
         mPimpl->appendBits(metadata, static_cast<uint16_t>((int)<wbr>luminanceData.maxBLuminance & 0xFFFF), 16);<br>
-        /* changed from maxRGBLuminance to average luminance to match stms implementation */<br>
         mPimpl->appendBits(metadata, static_cast<uint8_t>(((int)<wbr>luminanceData.averageLuminance & 0x10000) >> 16), 1);<br>
         mPimpl->appendBits(metadata, static_cast<uint16_t>((int)<wbr>luminanceData.averageLuminance & 0xFFFF), 16);<br>
<br>
@@ -478,7 +474,7 @@<br>
             uint8_t distributionMaxrgbPercentage = static_cast<uint8_t>(<wbr>percentilPercentages.at(i));<br>
             mPimpl->appendBits(metadata, distributionMaxrgbPercentage, 7);<br>
<br>
-            // 17bits: 1bit then 16<br>
+            /* 17bits: 1bit then 16 */<br>
             unsigned int ithPercentile = <a href="http://luminanceData.percentiles.at" rel="noreferrer" target="_blank">luminanceData.percentiles.at</a>(<wbr>i);<br>
             uint8_t highValue = static_cast<uint8_t>((<wbr>ithPercentile & 0x10000) >> 16);<br>
             uint16_t lowValue = static_cast<uint16_t>(<wbr>ithPercentile & 0xFFFF);<br>
@@ -499,33 +495,32 @@<br>
     {<br>
         //TODO<br>
     }<br>
-    // BEZIER CURVE DATA<br>
+    /* Bezier Curve Data */<br>
     for (int w = 0; w < numWindows; ++w)<br>
     {<br>
-        //TODO:<br>
         uint8_t toneMappingFlag = 1;<br>
+               /* Check if the window contains tone mapping bezier curve data and set toneMappingFlag appropriately */<br>
+               //Json bezierData = fileData[frame][<wbr>BezierCurveNames::TagName];<br>
+        BezierCurveData curveData;<br>
+               /* Select curve data based on global window */<br>
+        if (w == 0)<br>
+        {<br>
+            if (!mPimpl->bezierCurveFromJson(<wbr>fileData[frame][<wbr>BezierCurveNames::TagName], curveData))<br>
+            {<br>
+                               toneMappingFlag = 0;<br>
+            }<br>
+        }<br>
+           /* Select curve data based on local window */<br>
+        else<br>
+        {<br>
+            if (!mPimpl->bezierCurveFromJson(<wbr>jsonArray[w - 1][BezierCurveNames::TagName], curveData))<br>
+            {<br>
+                               toneMappingFlag = 0;<br>
+            }<br>
+        }<br>
         mPimpl->appendBits(metadata, toneMappingFlag, 1);<br>
         if (toneMappingFlag)<br>
         {<br>
-            Json bezierData = fileData[frame][<wbr>BezierCurveNames::TagName];<br>
-            BezierCurveData curveData;<br>
-<br>
-            /* Select curve data based on global window or local window */<br>
-            if (w == 0)<br>
-            {<br>
-                if (!mPimpl->bezierCurveFromJson(<wbr>bezierData, curveData))<br>
-                {<br>
-                    std::cout << "error parsing bezierCurve frame: " << w << std::endl;<br>
-                }<br>
-            }<br>
-            else<br>
-            {<br>
-                if (!mPimpl->bezierCurveFromJson(<wbr>jsonArray[w - 1][BezierCurveNames::TagName], curveData))<br>
-                {<br>
-                    std::cout << "error parsing bezierCurve ellipse: " << w - 1 << std::endl;<br>
-                }<br>
-            }<br>
-<br>
             uint16_t kneePointX = static_cast<uint16_t>(<wbr>curveData.sPx);<br>
             mPimpl->appendBits(metadata, kneePointX, 12);<br>
             uint16_t kneePointY = static_cast<uint16_t>(<wbr>curveData.sPy);<br>
@@ -541,7 +536,7 @@<br>
                 mPimpl->appendBits(metadata, anchor, 10);<br>
             }<br>
         }<br>
-    }<br>
+       }<br>
     /* Set to false as requested */<br>
     bool colorSaturationMappingFlag = 0;<br>
     mPimpl->appendBits(metadata, colorSaturationMappingFlag, 1);<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>
<br></blockquote></div><br></div><div class="gmail_extra">Pushed.</div></div>