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 upmix object number for AC4 level 4. #978

Merged
Merged
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
5 changes: 3 additions & 2 deletions Source/C++/Core/Ap4Dac4Atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,12 @@ AP4_Dac4Atom::Ac4Dsi::SubStream::ParseSubStreamInfoAjoc(AP4_BitReader &bits,
// oamd_common_data()
ParseOamdCommonData(bits);
}
n_umx_objects_minus1 = bits.ReadBits(4);
int nFullbandUpmixSignals = n_umx_objects_minus1 + 1;
int nFullbandUpmixSignalsMinus = bits.ReadBits(4);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what the intent of this change is? It seems that it does exactly the same as before, just with a new local variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC-4 level 4 supports up to 20.1 indicating the n_umx_objects_minus1 could be 21. the old calculation only read 4 bits, didn't add 3 variable bits to n_umx_objects_minus1, the max number of n_umx_objects_minus1 is 15. New calculation adds the additional 3 bits.

int nFullbandUpmixSignals = nFullbandUpmixSignalsMinus + 1;
if (nFullbandUpmixSignals == 16) {
nFullbandUpmixSignals += AP4_Ac4VariableBits(bits, 3);
}
n_umx_objects_minus1 = nFullbandUpmixSignals - 1;

BedDynObjAssignment(bits, nFullbandUpmixSignals, true);
ParseDsiSfMutiplier(bits, fs_idx);
Expand Down
Loading