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

Support of non conforming packing value 3 #447

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
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
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
Loading