Skip to content

Commit

Permalink
Support of non conforming packing value 3
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMartinez committed Nov 13, 2024
1 parent a9d4f4e commit 284244e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Project/GNU/CLI/test/test1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Formats/DPX/Flavors/Y_10_FilledB_BE/Y_10_FilledB_BE_Modified_9x4_Scanity.dpx
Formats/DPX/Flavors/Y_12_Packed_BE/086400.dpx pass
Formats/DPX/Flavors/Y_16_FilledA_BE/0000001.dpx pass
Formats/DPX/Flavors/Y_16_Packed_BE/FFmpeg_gray16be.dpx pass
Formats/DPX/Flavors/Y_16_Packed_BE/pack3.dpx pass
Formats/DPX/Flavors/Y_16_Packed_LE/FFmpeg_gray16le.dpx pass
Formats/DPX/Conformance/0004_OffsetToImageData/0004_OffsetToImageData_000000.dpx fail
Formats/DPX/Conformance/0008_VersionNumber/0008_VersionNumber_null.dpx pass
Expand Down
10 changes: 9 additions & 1 deletion Source/Lib/Uncompressed/DPX/DPX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ static const char* MessageText[] =
"ditto key",
"ditto key is set to \"same as the previous frame\" but header data differs",
"number of image elements",
"packing field value",
};

enum code : uint8_t
Expand All @@ -106,6 +107,7 @@ enum code : uint8_t
DittoKey,
DittoKey_NotSame,
NumberOfElements,
Packing,
Max
};

Expand Down Expand Up @@ -134,6 +136,7 @@ enum class packing : uint8_t
Packed,
FilledA,
FilledB,
Pack3,
};
enum flags : uint8_t
{
Expand Down Expand Up @@ -223,6 +226,8 @@ struct dpx_also DPX_Also[] =
{ { colorspace::Y , 8, endianness::BE, packing::FilledA }, dpx::flavor::Raw_Y_8 },
{ { colorspace::Y , 16, endianness::LE, packing::FilledA }, dpx::flavor::Raw_Y_16_LE },
{ { colorspace::Y , 16, endianness::BE, packing::FilledA }, dpx::flavor::Raw_Y_16_BE },
{ { colorspace::Y , 16, endianness::LE, packing::Pack3 }, dpx::flavor::Raw_Y_16_LE },
{ { colorspace::Y , 16, endianness::BE, packing::Pack3 }, dpx::flavor::Raw_Y_16_BE },
};

//***************************************************************************
Expand Down Expand Up @@ -670,7 +675,10 @@ void dpx::ConformanceCheck()
bool HasEncoding = false;
for (uint16_t i = 0; i < NumberOfElements; i++)
{
uint32_t Encoding = Get_X4();
uint16_t Packing = Get_X2();
if (Packing > (uint16_t)packing::FilledB)
Invalid(invalid::Packing);
uint16_t Encoding = Get_X2();
if (!HasEncoding && Encoding)
HasEncoding = true;
uint32_t OffsetToData = Get_X4();
Expand Down

0 comments on commit 284244e

Please sign in to comment.