Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unkown UL for SMPTE-ST-2084 #135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 56 additions & 57 deletions src/asdcp-info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,18 +372,20 @@ class FileInfoWrapper

if ( m_PictureEssenceCoding.HasValue() )
{
const char *encoding_ul_type = "**UNKNOWN**";

if ( m_PictureEssenceCoding == UL(P_HFR_UL_2K) )
encoding_ul_type = "P-HFR-2K";
else if ( m_PictureEssenceCoding == UL(P_HFR_UL_4K) )
encoding_ul_type = "**P-HFR-4K**";
else if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_2K) )
encoding_ul_type = "ST-429-4-2K";
else if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_4K) )
encoding_ul_type = "ST-429-4-4K";

fprintf(stream, "PictureEssenceCoding: %s (%s)\n", m_PictureEssenceCoding.EncodeString(buf, 64), encoding_ul_type);
const char *encoding_ul_type = "**UNKNOWN**";

if ( m_PictureEssenceCoding == UL(P_HFR_UL_2K) )
encoding_ul_type = "P-HFR-2K";
else if ( m_PictureEssenceCoding == UL(P_HFR_UL_4K) )
encoding_ul_type = "**P-HFR-4K**";
else if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_2K) )
encoding_ul_type = "ST-429-4-2K";
else if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_4K) )
encoding_ul_type = "ST-429-4-4K";
else if (m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_TransferCharacteristic_SMPTEST2084) )
encoding_ul_type = "SMPTE-ST-2084";

fprintf(stream, "PictureEssenceCoding: %s (%s)\n", m_PictureEssenceCoding.EncodeString(buf, 64), encoding_ul_type);
}
}

Expand All @@ -399,62 +401,59 @@ class FileInfoWrapper

if ( m_PictureEssenceCoding == UL(P_HFR_UL_2K) )
{
if ( m_Desc.StoredWidth > 2048 ) // 4k
{
fprintf(stream, "4k images marked as 2k HFR.\n");
++errors;
}

if ( m_Desc.SampleRate < ASDCP::EditRate_96 )
{
fprintf(stream, "HFR UL used for fps < 96.\n");
++errors;
}

if ( ! Options.max_bitrate_flag )
max_bitrate = p_hfr_max_bitrate;
if ( m_Desc.StoredWidth > 2048 ) // 4k
{
fprintf(stream, "4k images marked as 2k HFR.\n");
++errors;
}

if ( m_Desc.SampleRate < ASDCP::EditRate_96 )
{
fprintf(stream, "HFR UL used for fps < 96.\n");
++errors;
}

if ( ! Options.max_bitrate_flag )
max_bitrate = p_hfr_max_bitrate;
}
else if ( m_PictureEssenceCoding == UL(P_HFR_UL_4K) )
{
fprintf(stream, "4k HFR support undefined.\n");
++errors;

if ( m_Desc.StoredWidth <= 2048 ) // 2k
{
fprintf(stream, "2k images marked as 4k HFR.\n");
++errors;
}
fprintf(stream, "4k HFR support undefined.\n");
++errors;

if ( m_Desc.StoredWidth <= 2048 ) // 2k
{
fprintf(stream, "2k images marked as 4k HFR.\n");
++errors;
}
}
else if ( m_PictureEssenceCoding != DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_2K)
&& m_PictureEssenceCoding != DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_4K) )
else if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_2K) )
{
fprintf(stream, "Unknown PictureEssenceCoding UL value.\n");
++errors;
if ( m_Desc.StoredWidth > 2048 ) // 4k
{
fprintf(stream, "4k images marked as 2k ST 429-4.\n");
++errors;
}
}
else
else if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_4K) )
{
if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_2K) )
{
if ( m_Desc.StoredWidth > 2048 ) // 4k
{
fprintf(stream, "4k images marked as 2k ST 429-4.\n");
++errors;
}
}
else if ( m_PictureEssenceCoding == DefaultCompositeDict().ul(MDD_JP2KEssenceCompression_4K) )
{
if ( m_Desc.StoredWidth <= 2048 ) // 2k
{
fprintf(stream, "2k images marked as 4k ST 429-4.\n");
++errors;
}
}
if ( m_Desc.StoredWidth <= 2048 ) // 2k
{
fprintf(stream, "2k images marked as 4k ST 429-4.\n");
++errors;
}
}
else if ( m_PictureEssenceCoding != DefaultCompositeDict().ul(MDD_TransferCharacteristic_SMPTEST2084) )
{
fprintf(stream, "Unknown PictureEssenceCoding UL value.\n");
++errors;
}


if ( m_MaxBitrate > max_bitrate )
{
fprintf(stream, "Bitrate %0.0f exceeds maximum %0.0f (see option -r).\n", m_MaxBitrate, max_bitrate);
++errors;
fprintf(stream, "Bitrate %0.0f exceeds maximum %0.0f (see option -r).\n", m_MaxBitrate, max_bitrate);
++errors;
}

return errors ? RESULT_FAIL : RESULT_OK;
Expand Down
Loading