<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 12, 2018 at 5:54 PM, <span dir="ltr"><<a href="mailto:ashok@multicorewareinc.com" target="_blank">ashok@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 Ashok Kumar Mishra <<a href="mailto:ashok@multicorewareinc.com">ashok@multicorewareinc.com</a>><br>
# Date 1531377840 -19800<br>
# Thu Jul 12 12:14:00 2018 +0530<br>
# Node ID 7763d20f092a208904b3ae3ec17624<wbr>41d1573696<br>
# Parent 8bf51aa8a1708fa106c225db2d6671<wbr>ede0ad29b0<br>
Added support for the new HDR10+ LLC JSON format injection inside dynamicHDR10 library.<br>
<br>
diff -r 8bf51aa8a170 -r 7763d20f092a source/dynamicHDR10/<wbr>SeiMetadataDictionary.cpp<br>
--- a/source/dynamicHDR10/<wbr>SeiMetadataDictionary.cpp Thu Jul 12 17:23:26 2018 +0800<br>
+++ b/source/dynamicHDR10/<wbr>SeiMetadataDictionary.cpp Thu Jul 12 12:14:00 2018 +0530<br>
@@ -34,6 +34,7 @@<br>
const std::string BezierCurveNames::<wbr>NumberOfAnchors = std::string("NumberOfAnchors")<wbr>;<br>
const std::string BezierCurveNames::KneePointX = std::string("KneePointX");<br>
const std::string BezierCurveNames::KneePointY = std::string("KneePointY");<br>
+const std::string BezierCurveNames::AnchorsTag = std::string("Anchors");<br>
const std::string BezierCurveNames::Anchors[] = {std::string("Anchor0"),<br>
std::string("Anchor1"),<br>
std::string("Anchor2"),<br>
@@ -69,6 +70,8 @@<br>
<br>
const std::string PercentileNames::TagName = std::string("<wbr>PercentileLuminance");<br>
const std::string PercentileNames::<wbr>NumberOfPercentiles = std::string("<wbr>NumberOfPercentiles");<br>
+const std::string PercentileNames::<wbr>DistributionIndex = std::string("<wbr>DistributionIndex");<br>
+const std::string PercentileNames::<wbr>DistributionValues = std::string("<wbr>DistributionValues");<br>
const std::string PercentileNames::<wbr>PercentilePercentageValue[] = {std::string("<wbr>PercentilePercentage0"),<br>
std::string("<wbr>PercentilePercentage1"),<br>
std::string("<wbr>PercentilePercentage2"),<br>
@@ -104,7 +107,9 @@<br>
<br>
<br>
const std::string LuminanceNames::TagName = std::string("<wbr>LuminanceParameters");<br>
+const std::string LuminanceNames::LlcTagName = std::string("<wbr>LuminanceDistributions");<br>
const std::string LuminanceNames::AverageRGB = std::string("AverageRGB");<br>
+const std::string LuminanceNames::MaxSCL = std::string("MaxScl");<br>
const std::string LuminanceNames::MaxSCL0 = std::string("MaxScl0");<br>
const std::string LuminanceNames::MaxSCL1 = std::string("MaxScl1");<br>
const std::string LuminanceNames::MaxSCL2 = std::string("MaxScl2");<br>
diff -r 8bf51aa8a170 -r 7763d20f092a source/dynamicHDR10/<wbr>SeiMetadataDictionary.h<br>
--- a/source/dynamicHDR10/<wbr>SeiMetadataDictionary.h Thu Jul 12 17:23:26 2018 +0800<br>
+++ b/source/dynamicHDR10/<wbr>SeiMetadataDictionary.h Thu Jul 12 12:14:00 2018 +0530<br>
@@ -48,6 +48,7 @@<br>
static const std::string NumberOfAnchors;<br>
static const std::string KneePointX;<br>
static const std::string KneePointY;<br>
+ static const std::string AnchorsTag;<br>
static const std::string Anchors[14];<br>
};<br>
//Ellipse Selection Data<br>
@@ -79,6 +80,8 @@<br>
public:<br>
static const std::string TagName;<br>
static const std::string NumberOfPercentiles;<br>
+ static const std::string DistributionIndex;<br>
+ static const std::string DistributionValues;<br>
static const std::string PercentilePercentageValue[15];<br>
static const std::string PercentileLuminanceValue[15];<br>
};<br>
@@ -87,7 +90,9 @@<br>
{<br>
public:<br>
static const std::string TagName;<br>
+ static const std::string LlcTagName;<br>
static const std::string AverageRGB;<br>
+ static const std::string MaxSCL;<br>
static const std::string MaxSCL0;<br>
static const std::string MaxSCL1;<br>
static const std::string MaxSCL2;<br>
diff -r 8bf51aa8a170 -r 7763d20f092a source/dynamicHDR10/<wbr>metadataFromJson.cpp<br>
--- a/source/dynamicHDR10/<wbr>metadataFromJson.cpp Thu Jul 12 17:23:26 2018 +0800<br>
+++ b/source/dynamicHDR10/<wbr>metadataFromJson.cpp Thu Jul 12 12:14:00 2018 +0530<br>
@@ -51,14 +51,13 @@<br>
JsonObject lumJsonData = data.object_items();<br>
if(!lumJsonData.empty())<br>
{<br>
- JsonObject percentileData = lumJsonData[PercentileNames::<wbr>TagName].object_items();<br>
- obj.order = percentileData[<wbr>PercentileNames::<wbr>NumberOfPercentiles].int_<wbr>value();<br>
-<br>
obj.averageLuminance = static_cast<float>(<wbr>lumJsonData[LuminanceNames::<wbr>AverageRGB].number_value());<br>
obj.maxRLuminance = static_cast<float>(<wbr>lumJsonData[LuminanceNames::<wbr>MaxSCL0].number_value());<br>
obj.maxGLuminance = static_cast<float>(<wbr>lumJsonData[LuminanceNames::<wbr>MaxSCL1].number_value());<br>
obj.maxBLuminance = static_cast<float>(<wbr>lumJsonData[LuminanceNames::<wbr>MaxSCL2].number_value());<br>
<br>
+ JsonObject percentileData = lumJsonData[PercentileNames::<wbr>TagName].object_items();<br>
+ obj.order = percentileData[<wbr>PercentileNames::<wbr>NumberOfPercentiles].int_<wbr>value();<br>
if(!percentileData.empty())<br>
{<br>
obj.percentiles.resize(obj.<wbr>order);<br>
@@ -69,7 +68,33 @@<br>
obj.percentiles[i] = static_cast<unsigned int>(percentileData[<wbr>percentileTag].int_value());<br>
}<br>
}<br>
+ return true;<br>
+ }<br>
+ return false;<br>
+ }<br>
<br>
+ bool luminanceParamFromLLCJson(<wbr>const Json &data, LuminanceParameters &obj)<br>
+ {<br>
+ JsonObject lumJsonData = data.object_items();<br>
+ if(!lumJsonData.empty())<br>
+ {<br>
+ obj.averageLuminance = static_cast<float>(<wbr>lumJsonData[LuminanceNames::<wbr>AverageRGB].number_value());<br>
+ JsonArray maxScl = lumJsonData[LuminanceNames::<wbr>MaxSCL].array_items();<br>
+ obj.maxRLuminance = static_cast<float>(maxScl[0].<wbr>number_value());<br>
+ obj.maxGLuminance = static_cast<float>(maxScl[1].<wbr>number_value());<br>
+ obj.maxBLuminance = static_cast<float>(maxScl[2].<wbr>number_value());<br>
+<br>
+ JsonObject percentileData = lumJsonData[LuminanceNames::<wbr>LlcTagName].object_items();<br>
+ if(!percentileData.empty())<br>
+ {<br>
+ JsonArray distributionValues = percentileData[<wbr>PercentileNames::<wbr>DistributionValues].array_<wbr>items();<br>
+ obj.order = distributionValues.size();<br>
+ obj.percentiles.resize(obj.<wbr>order);<br>
+ for(int i = 0; i < obj.order; ++i)<br>
+ {<br>
+ obj.percentiles[i] = static_cast<unsigned int>(distributionValues[i].<wbr>int_value());<br>
+ }<br>
+ }<br>
return true;<br>
}<br>
return false;<br>
@@ -82,33 +107,33 @@<br>
{<br>
JsonObject percentileData = jsonData[PercentileNames::<wbr>TagName].object_items();<br>
int order = percentileData[<wbr>PercentileNames::<wbr>NumberOfPercentiles].int_<wbr>value();<br>
-<br>
percentages.resize(order);<br>
for(int i = 0; i < order; ++i)<br>
{<br>
std::string percentileTag = PercentileNames::<wbr>PercentilePercentageValue[i];<br>
percentages[i] = static_cast<unsigned int>(percentileData[<wbr>percentileTag].int_value());<br>
}<br>
-<br>
return true;<br>
}<br>
return false;<br>
}<br>
<br>
- bool percentagesFromJson(const Json &data, unsigned int *percentages)<br>
+ bool percentagesFromLLCJson(const Json &data, std::vector<unsigned int> &percentages)<br>
{<br>
- JsonObject jsonData = data.object_items();<br>
- if(!jsonData.empty())<br>
- {<br>
- JsonObject percentileData = jsonData[PercentileNames::<wbr>TagName].object_items();<br>
- int order = percentileData[<wbr>PercentileNames::<wbr>NumberOfPercentiles].int_<wbr>value();<br>
-<br>
- for(int i = 0; i < order; ++i)<br>
+ JsonObject lumJsonData = data.object_items();<br>
+ if(!lumJsonData.empty())<br>
+ { <br>
+ JsonObject percentileData = lumJsonData[LuminanceNames::<wbr>LlcTagName].object_items();<br>
+ if(!percentileData.empty())<br>
{<br>
- std::string percentileTag = PercentileNames::<wbr>PercentilePercentageValue[i];<br>
- percentages[i] = static_cast<unsigned int>(percentileData[<wbr>percentileTag].int_value());<br>
+ JsonArray percentageValues = percentileData[<wbr>PercentileNames::<wbr>DistributionIndex].array_<wbr>items();<br>
+ int order = percentageValues.size();<br>
+ percentages.resize(order);<br>
+ for(int i = 0; i < order; ++i)<br>
+ {<br>
+ percentages[i] = static_cast<unsigned int>(percentageValues[i].int_<wbr>value());<br>
+ }<br>
}<br>
-<br>
return true;<br>
}<br>
return false;<br>
@@ -119,15 +144,33 @@<br>
JsonObject jsonData = data.object_items();<br>
if(!jsonData.empty())<br>
{<br>
+ obj.sPx = jsonData[BezierCurveNames::<wbr>KneePointX].int_value();<br>
+ obj.sPy = jsonData[BezierCurveNames::<wbr>KneePointY].int_value();<br>
obj.order = jsonData[BezierCurveNames::<wbr>NumberOfAnchors].int_value();<br>
obj.coeff.resize(obj.order);<br>
- obj.sPx = jsonData[BezierCurveNames::<wbr>KneePointX].int_value();<br>
- obj.sPy = jsonData[BezierCurveNames::<wbr>KneePointY].int_value();<br>
for(int i = 0; i < obj.order; ++i)<br>
{<br>
obj.coeff[i] = jsonData[BezierCurveNames::<wbr>Anchors[i]].int_value();<br>
}<br>
+ return true;<br>
+ }<br>
+ return false;<br>
+ }<br>
<br>
+ bool bezierCurveFromLLCJson(const Json &data, BezierCurveData &obj)<br>
+ {<br>
+ JsonObject jsonData = data.object_items();<br>
+ if(!jsonData.empty())<br>
+ {<br>
+ obj.sPx = jsonData[BezierCurveNames::<wbr>KneePointX].int_value();<br>
+ obj.sPy = jsonData[BezierCurveNames::<wbr>KneePointY].int_value();<br>
+ JsonArray anchorValues = data[BezierCurveNames::<wbr>AnchorsTag].array_items();<br>
+ obj.order = anchorValues.size();<br>
+ obj.coeff.resize(obj.order);<br>
+ for(int i = 0; i < obj.order; ++i)<br>
+ {<br>
+ obj.coeff[i] = anchorValues[i].int_value();<br>
+ }<br>
return true;<br>
}<br>
return false;<br>
@@ -162,9 +205,7 @@<br>
void setPayloadSize(uint8_t *dataStream, int positionOnStream, int payload)<br>
{<br>
int payloadBytes = 1;<br>
-<br>
for(;payload >= 0xFF; payload -= 0xFF, ++payloadBytes);<br>
-<br>
if(payloadBytes > 1)<br>
{<br>
shiftData(dataStream, payloadBytes-1, mCurrentStreamByte, positionOnStream);<br>
@@ -196,8 +237,6 @@<br>
}<br>
}<br>
<br>
-// const std::string LocalParameters = std::string("LocalParameters")<wbr>;<br>
-// const std::string TargetDisplayLuminance = std::string("<wbr>TargetedSystemDisplayMaximumLu<wbr>minance");<br>
};<br>
<br>
metadataFromJson::<wbr>metadataFromJson() :<br>
@@ -211,17 +250,17 @@<br>
delete mPimpl;<br>
}<br>
<br>
-<br>
bool metadataFromJson::<wbr>frameMetadataFromJson(const char* filePath,<br>
int frame,<br>
uint8_t *&metadata)<br>
{<br>
std::string path(filePath);<br>
JsonArray fileData = JsonHelper::readJsonArray(<wbr>path);<br>
-<br>
+ bool isLLCJson = false;<br>
if(fileData.empty())<br>
{<br>
- return false;<br>
+ isLLCJson = true;<br>
+ fileData = JsonHelper::readJson(filePath)<wbr>.at("SceneInfo").array_items()<wbr>;<br>
}<br>
<br>
// frame = frame + 1; //index on the array start at 0 frames starts at 1<br>
@@ -233,7 +272,6 @@<br>
}<br>
<br>
int mSEIBytesToRead = 509;<br>
-<br>
if(metadata)<br>
{<br>
delete(metadata);<br>
@@ -241,13 +279,9 @@<br>
metadata = new uint8_t[mSEIBytesToRead];<br>
mPimpl->mCurrentStreamBit = 8;<br>
mPimpl->mCurrentStreamByte = 1;<br>
+ memset(metadata, 0, mSEIBytesToRead);<br>
<br>
- for(int j = 0; j < mSEIBytesToRead; ++j)<br>
- {<br>
- (metadata)[j] = 0;<br>
- }<br>
-<br>
- fillMetadataArray(fileData, frame, metadata);<br>
+ fillMetadataArray(fileData, frame, isLLCJson, metadata);<br>
mPimpl->setPayloadSize(<wbr>metadata, 0, mPimpl->mCurrentStreamByte);<br>
return true;<br>
}<br>
@@ -256,9 +290,12 @@<br>
{<br>
std::string path(filePath);<br>
JsonArray fileData = JsonHelper::readJsonArray(<wbr>path);<br>
+ bool isLLCJson = false;<br>
+<br>
if (fileData.empty())<br>
{<br>
- return -1;<br>
+ isLLCJson = true;<br>
+ fileData = JsonHelper::readJson(filePath)<wbr>.at("SceneInfo").array_items()<wbr>;<br>
}<br>
<br>
int numFrames = static_cast<int>(fileData.<wbr>size());<br>
@@ -266,17 +303,12 @@<br>
for (int frame = 0; frame < numFrames; ++frame)<br>
{<br>
metadata[frame] = new uint8_t[509];<br>
- for (int i = 0; i < 509; ++i)<br>
- {<br>
- metadata[frame][i] = 0;<br>
- }<br>
+ memset(metadata[frame], 0, 509);<br>
mPimpl->mCurrentStreamBit = 8;<br>
mPimpl->mCurrentStreamByte = 1;<br>
<br>
- fillMetadataArray(fileData, frame, metadata[frame]);<br>
-<br>
+ fillMetadataArray(fileData, frame, isLLCJson, metadata[frame]);<br>
mPimpl->setPayloadSize(<wbr>metadata[frame], 0, mPimpl->mCurrentStreamByte);<br>
-<br>
}<br>
<br>
return numFrames;<br>
@@ -321,7 +353,7 @@<br>
/* NOTE: We leave TWO BYTES of space for the payload */<br>
mPimpl->mCurrentStreamByte += 2;<br>
<br>
- fillMetadataArray(fileData, frame, metadata);<br>
+ fillMetadataArray(fileData, frame, false, metadata);<br>
<br>
/* Set payload in bytes 2 & 3 as indicated in Extended InfoFrame Type syntax */<br>
metadata[2] = (mPimpl->mCurrentStreamByte & 0xFF00) >> 8;<br>
@@ -331,7 +363,7 @@<br>
<br>
int metadataFromJson::<wbr>movieExtendedInfoFrameMetadata<wbr>FromJson(const char* filePath, uint8_t **&metadata)<br>
{<br>
- std::string path(filePath);<br>
+ std::string path(filePath);<br>
JsonArray fileData = JsonHelper::readJsonArray(<wbr>path);<br>
if(fileData.empty())<br>
{<br>
@@ -344,9 +376,9 @@<br>
{<br>
metadata[frame] = new uint8_t[509];<br>
for(int i = 0; i < 509; ++i) <br>
- {<br>
- metadata[frame][i] = 0;<br>
- }<br>
+ {<br>
+ metadata[frame][i] = 0;<br>
+ }<br>
mPimpl->mCurrentStreamBit = 8;<br>
mPimpl->mCurrentStreamByte = 0;<br>
<br>
@@ -356,7 +388,7 @@<br>
/* NOTE: We leave TWO BYTES of space for the payload */<br>
mPimpl->mCurrentStreamByte += 2;<br>
<br>
- fillMetadataArray(fileData, frame, metadata[frame]);<br>
+ fillMetadataArray(fileData, frame, false, metadata[frame]);<br>
<br>
/* Set payload in bytes 2 & 3 as indicated in Extended InfoFrame Type syntax */<br>
metadata[frame][2] = (mPimpl->mCurrentStreamByte & 0xFF00) >> 8;<br>
@@ -366,7 +398,7 @@<br>
return numFrames;<br>
}<br>
<br>
-void metadataFromJson::<wbr>fillMetadataArray(const JsonArray &fileData, int frame, uint8_t *&metadata)<br>
+void metadataFromJson::<wbr>fillMetadataArray(const JsonArray &fileData, int frame, const bool isLLCJson, uint8_t *&metadata)<br>
{<br>
const uint8_t countryCode = 0xB5;<br>
const uint16_t terminalProviderCode = 0x003C;<br>
@@ -381,57 +413,68 @@<br>
mPimpl->appendBits(metadata, applicationIdentifier, 8);<br>
mPimpl->appendBits(metadata, applicationVersion, 8);<br>
<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>
- 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>
+ uint16_t numWindows = 0;<br>
+ /* HDR10+ LLC doesn't consider local windows */<br>
+ if(isLLCJson)<br>
{<br>
- mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
- [EllipseSelectionNames::<wbr>WindowUpperLeftCornerX].int_<wbr>value(), 16);<br>
- mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
- [EllipseSelectionNames::<wbr>WindowUpperLeftCornerY].int_<wbr>value(), 16);<br>
- mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
- [EllipseSelectionNames::<wbr>WindowLowerRightCornerX].int_<wbr>value(), 16);<br>
- mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
- [EllipseSelectionNames::<wbr>WindowLowerRightCornerY].int_<wbr>value(), 16);<br>
-<br>
- JsonObject ellipseJsonObject = jsonArray[i][EllipseNames::<wbr>TagName].object_items();<br>
-<br>
- mPimpl->appendBits(metadata,<br>
- static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>CenterOfEllipseX].int_value())<wbr>,<br>
- 16);<br>
+ numWindows = 1;<br>
+ mPimpl->appendBits(metadata, numWindows, 2);<br>
+ }<br>
+ else<br>
+ {<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>
+ 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>
+ mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
+ [EllipseSelectionNames::<wbr>WindowUpperLeftCornerX].int_<wbr>value(), 16);<br>
+ mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
+ [EllipseSelectionNames::<wbr>WindowUpperLeftCornerY].int_<wbr>value(), 16);<br>
+ mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
+ [EllipseSelectionNames::<wbr>WindowLowerRightCornerX].int_<wbr>value(), 16);<br>
+ mPimpl->appendBits(metadata, jsonArray[i][<wbr>EllipseSelectionNames::<wbr>WindowData]<br>
+ [EllipseSelectionNames::<wbr>WindowLowerRightCornerY].int_<wbr>value(), 16);<br>
<br>
- mPimpl->appendBits(metadata,<br>
- static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>CenterOfEllipseY].int_value())<wbr>,<br>
- 16);<br>
-<br>
- int angle = ellipseJsonObject[<wbr>EllipseNames::RotationAngle].<wbr>int_value();<br>
- uint8_t rotationAngle = static_cast<uint8_t>((angle > 180.0) ? angle - 180.0 : angle);<br>
- mPimpl->appendBits(metadata, rotationAngle, 8);<br>
-<br>
- uint16_t semimajorExternalAxis =<br>
- static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>SemiMajorAxisExternalEllipse].<wbr>int_value());<br>
-<br>
- uint16_t semiminorExternalAxis =<br>
- static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>SemiMinorAxisExternalEllipse].<wbr>int_value());<br>
+ JsonObject ellipseJsonObject = jsonArray[i][EllipseNames::<wbr>TagName].object_items();<br>
<br>
- uint16_t semimajorInternalEllipse =<br>
- static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>SemiMajorAxisInternalEllipse].<wbr>int_value());<br>
-<br>
- mPimpl->appendBits(metadata, semimajorInternalEllipse, 16);<br>
+ mPimpl->appendBits(metadata,<br>
+ static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>CenterOfEllipseX].int_value())<wbr>,<br>
+ 16);<br>
<br>
- mPimpl->appendBits(metadata, semimajorExternalAxis, 16);<br>
- mPimpl->appendBits(metadata, semiminorExternalAxis, 16);<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>
+ mPimpl->appendBits(metadata,<br>
+ static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>CenterOfEllipseY].int_value())<wbr>,<br>
+ 16);<br>
+<br>
+ int angle = ellipseJsonObject[<wbr>EllipseNames::RotationAngle].<wbr>int_value();<br>
+ uint8_t rotationAngle = static_cast<uint8_t>((angle > 180.0) ? angle - 180.0 : angle);<br>
+ mPimpl->appendBits(metadata, rotationAngle, 8);<br>
+<br>
+ uint16_t semimajorExternalAxis =<br>
+ static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>SemiMajorAxisExternalEllipse].<wbr>int_value());<br>
+<br>
+ uint16_t semiminorExternalAxis =<br>
+ static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>SemiMinorAxisExternalEllipse].<wbr>int_value());<br>
+<br>
+ uint16_t semimajorInternalEllipse =<br>
+ static_cast<uint16_t>(<wbr>ellipseJsonObject[<wbr>EllipseNames::<wbr>SemiMajorAxisInternalEllipse].<wbr>int_value());<br>
+<br>
+ mPimpl->appendBits(metadata, semimajorInternalEllipse, 16);<br>
+<br>
+ mPimpl->appendBits(metadata, semimajorExternalAxis, 16);<br>
+ mPimpl->appendBits(metadata, semiminorExternalAxis, 16);<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>
}<br>
+<br>
/* Targeted System Display Data */<br>
- uint32_t monitorPeak = fileData[frame][JsonDataKeys::<wbr>TargetDisplayLuminance].int_<wbr>value(); //500;<br>
+ uint32_t monitorPeak = fileData[frame][JsonDataKeys::<wbr>TargetDisplayLuminance].int_<wbr>value();<br>
mPimpl->appendBits(metadata, monitorPeak, 27);<br>
- //NOTE: Set as false for now, as requested<br>
+<br>
uint8_t targetedSystemDisplayActualPea<wbr>kLuminanceFlag = 0;<br>
mPimpl->appendBits(metadata, targetedSystemDisplayActualPea<wbr>kLuminanceFlag, 1);<br>
if (<wbr>targetedSystemDisplayActualPea<wbr>kLuminanceFlag)<br>
@@ -439,21 +482,21 @@<br>
//TODO<br>
}<br>
<br>
- /* Max rgb values (maxScl)*/<br>
+ /* Max RGB values (maxScl)*/<br>
/* Luminance values/percentile for each window */<br>
for (int w = 0; w < numWindows; ++w)<br>
{<br>
Json lumObj = fileData[frame][<wbr>LuminanceNames::TagName];<br>
LuminanceParameters luminanceData;<br>
- if (!mPimpl-><wbr>luminanceParamFromJson(lumObj, luminanceData))<br>
+ if(!((isLLCJson && mPimpl-><wbr>luminanceParamFromLLCJson(<wbr>lumObj, luminanceData)) ||<br>
+ !(isLLCJson && mPimpl-><wbr>luminanceParamFromJson(lumObj, luminanceData))))<br>
{<br>
std::cout << "error parsing luminance parameters frame: " << w << std::endl;<br>
}<br>
<br>
- /* NOTE: Maxscl from 0 t 100,000 based on data that says in values of 0.00001<br>
+ /* NOTE: Maxscl from 0 to 100,000 based on data that says in values of 0.00001<br>
* one for each channel R,G,B<br>
*/<br>
-<br>
mPimpl->appendBits(metadata, static_cast<uint8_t>(((int)<wbr>luminanceData.maxRLuminance & 0x10000) >> 16), 1);<br>
mPimpl->appendBits(metadata, static_cast<uint16_t>((int)<wbr>luminanceData.maxRLuminance & 0xFFFF), 16);<br>
mPimpl->appendBits(metadata, static_cast<uint8_t>(((int)<wbr>luminanceData.maxGLuminance & 0x10000) >> 16), 1);<br>
@@ -467,11 +510,21 @@<br>
uint8_t numDistributionMaxrgbPercentil<wbr>es = static_cast<uint8_t>(<wbr>luminanceData.order);<br>
mPimpl->appendBits(metadata, numDistributionMaxrgbPercentil<wbr>es, 4);<br>
<br>
- std::vector<unsigned int>percentilPercentages;<br>
- mPimpl->percentagesFromJson(<wbr>lumObj, percentilPercentages);<br>
+ std::vector<unsigned int>percentilePercentages;<br>
+<br>
+ if(isLLCJson)<br>
+ {<br>
+ mPimpl-><wbr>percentagesFromLLCJson(lumObj, percentilePercentages);<br>
+ }<br>
+ else<br>
+ {<br>
+ mPimpl->percentagesFromJson(<wbr>lumObj, percentilePercentages);<br>
+ }<br>
+<br>
+<br>
for (int i = 0; i < numDistributionMaxrgbPercentil<wbr>es; ++i)<br>
{<br>
- uint8_t distributionMaxrgbPercentage = static_cast<uint8_t>(<wbr>percentilPercentages.at(i));<br>
+ uint8_t distributionMaxrgbPercentage = static_cast<uint8_t>(<wbr>percentilePercentages.at(i));<br>
mPimpl->appendBits(metadata, distributionMaxrgbPercentage, 7);<br>
<br>
/* 17bits: 1bit then 16 */<br>
@@ -483,7 +536,7 @@<br>
}<br>
<br>
/* 10bits: Fraction bright pixels */<br>
- uint16_t fractionBrightPixels = 1;<br>
+ uint16_t fractionBrightPixels = 0;<br>
mPimpl->appendBits(metadata, fractionBrightPixels, 10);<br>
<br>
}<br>
@@ -505,17 +558,20 @@<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>
+ if(!((isLLCJson && mPimpl-><wbr>bezierCurveFromLLCJson(<wbr>fileData[frame][<wbr>BezierCurveNames::TagName], curveData)) ||<br>
+ !(isLLCJson && mPimpl->bezierCurveFromJson(<wbr>fileData[frame][<wbr>BezierCurveNames::TagName], curveData))))<br>
{<br>
- toneMappingFlag = 0;<br>
+ toneMappingFlag = 0;<br>
}<br>
}<br>
- /* Select curve data based on local window */<br>
+<br>
+ /* Select curve data based on local window */<br>
else<br>
{<br>
+ JsonArray jsonArray = fileData[frame][JsonDataKeys::<wbr>LocalParameters].array_items()<wbr>;<br>
if (!mPimpl->bezierCurveFromJson(<wbr>jsonArray[w - 1][BezierCurveNames::TagName], curveData))<br>
{<br>
- toneMappingFlag = 0;<br>
+ toneMappingFlag = 0;<br>
}<br>
} <br>
mPimpl->appendBits(metadata, toneMappingFlag, 1);<br>
diff -r 8bf51aa8a170 -r 7763d20f092a source/dynamicHDR10/<wbr>metadataFromJson.h<br>
--- a/source/dynamicHDR10/<wbr>metadataFromJson.h Thu Jul 12 17:23:26 2018 +0800<br>
+++ b/source/dynamicHDR10/<wbr>metadataFromJson.h Thu Jul 12 12:14:00 2018 +0530<br>
@@ -98,7 +98,7 @@<br>
<br>
class DynamicMetaIO;<br>
DynamicMetaIO *mPimpl;<br>
- void fillMetadataArray(const JsonArray &fileData, int frame, uint8_t *&metadata);<br>
+ void fillMetadataArray(const JsonArray &fileData, int frame, const bool isLLCJson, uint8_t *&metadata);<br>
};<br>
<br>
#endif // METADATAFROMJSON_H<br>
</blockquote></div><br></div><div class="gmail_extra">Pushed.</div></div>