Skip to content

Commit

Permalink
DTS-UHD: Add LKFS reporting, update
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMartinez committed Jul 13, 2023
1 parent 1af3cf4 commit 8668fc2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Source/MediaInfo/Audio/File_DtsUhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ enum RepType {
};

// Section 5.2.2.2: Long Term Loudness Measure Table
static constexpr char const* LongTermLoudnessMeasure[] =
static constexpr float LongTermLoudnessMeasure[] =
{
"-40.00", "-39.00", "-38.00", "-37.00", "-36.00", "-35.00", "-34.00", "-33.00",
"-32.00", "-31.00", "-30.00", "-29.50", "-29.00", "-28.50", "-28.00", "-27.50",
"-27.00", "-26.75", "-26.50", "-26.25", "-26.00", "-25.75", "-25.50", "-25.25",
"-25.00", "-24.75", "-24.50", "-24.25", "-24.00", "-23.75", "-23.50", "-23.25",
"-23.00", "-22.75", "-22.50", "-22.25", "-22.00", "-21.75", "-21.50", "-21.25",
"-21.00", "-20.50", "-20.00", "-19.50", "-19.00", "-18.00", "-17.00", "-16.00",
"-15.00", "-14.00", "-13.00", "-12.00", "-11.00", "-10.00", "-9.00", "-8.00",
"-7.00", "-6.00", "-5.00", "-4.00", "-3.00", "-2.00", "-1.00", "0.00",
-40.00, -39.00, -38.00, -37.00, -36.00, -35.00, -34.00, -33.00,
-32.00, -31.00, -30.00, -29.50, -29.00, -28.50, -28.00, -27.50,
-27.00, -26.75, -26.50, -26.25, -26.00, -25.75, -25.50, -25.25,
-25.00, -24.75, -24.50, -24.25, -24.00, -23.75, -23.50, -23.25,
-23.00, -22.75, -22.50, -22.25, -22.00, -21.75, -21.50, -21.25,
-21.00, -20.50, -20.00, -19.50, -19.00, -18.00, -17.00, -16.00,
-15.00, -14.00, -13.00, -12.00, -11.00, -10.00, -9.00, -8.00,
-7.00, -6.00, -5.00, -4.00, -3.00, -2.00, -1.00, 0.00,
};

static int CountBits(int32u Mask)
Expand Down Expand Up @@ -1401,7 +1401,10 @@ void File_DtsUhd::Streams_Fill()
Fill(Stream_Audio, 0, Audio_SamplingRate, SampleRate);

if (LongTermLoudnessIndex<64)
Fill(Stream_Audio, 0, "Long Term Loudness", std::string(LongTermLoudnessMeasure[LongTermLoudnessIndex])+" LKFS");
{
Fill(Stream_Audio, 0, "Loudness", "Yes", Unlimited, true, true);
Fill_Measure(Stream_Audio, 0, "Loudness LongTermLoudness", Ztring::ToZtring(LongTermLoudnessMeasure[LongTermLoudnessIndex], 2), __T(" LKFS"));
}

if (FrameDescriptor.ChannelMask)
{
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/MediaInfo_Config_Automatic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"LinkedTo_TrackFormat_Pos;Track format #s\n"
"LinkedTo_TrackUID_Pos;Track UID #s\n"
"List;List\n"
"LongTermLoudness;Long term loudness\n"
"LoRoCenterMixGain;LoRo center mix gain\n"
"LoRoSurroundMixGain;LoRo surround mix gain\n"
"Loudness_Anchor;Anchor loudness\n"
Expand Down
1 change: 1 addition & 0 deletions Source/Resource/Text/Language/DefaultLanguage.csv
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ LinkedTo_Substream_Pos;Substream #s
LinkedTo_TrackFormat_Pos;Track format #s
LinkedTo_TrackUID_Pos;Track UID #s
List;List
LongTermLoudness;Long term loudness
LoRoCenterMixGain;LoRo center mix gain
LoRoSurroundMixGain;LoRo surround mix gain
Loudness_Anchor;Anchor loudness
Expand Down

0 comments on commit 8668fc2

Please sign in to comment.