Colour element: Matrix renamed to MatrixCoefficients.

Change-Id: I148e81be6c23f0d0e61dc5820a1ae80f685af57f
This commit is contained in:
Tom Finegan 2016-02-18 10:08:11 -08:00
parent e0b11351fb
commit f2fc28e044
7 changed files with 19 additions and 17 deletions

View File

@ -1003,8 +1003,8 @@ bool Colour::Write(IMkvWriter* writer) const {
if (!WriteEbmlMasterElement(writer, kMkvColour, size)) if (!WriteEbmlMasterElement(writer, kMkvColour, size))
return false; return false;
if (matrix != kUnspecifiedColourValue && if (matrix_coefficients != kUnspecifiedColourValue &&
!WriteEbmlElement(writer, kMkvMatrix, matrix)) { !WriteEbmlElement(writer, kMkvMatrixCoefficients, matrix_coefficients)) {
return false; return false;
} }
if (bits_per_channel != kUnspecifiedColourValue && if (bits_per_channel != kUnspecifiedColourValue &&
@ -1087,8 +1087,8 @@ bool Colour::SetMasteringMetadata(const MasteringMetadata& mastering_metadata) {
uint64 Colour::PayloadSize() const { uint64 Colour::PayloadSize() const {
uint64 size = 0; uint64 size = 0;
if (matrix != kUnspecifiedColourValue) if (matrix_coefficients != kUnspecifiedColourValue)
size += EbmlElementSize(kMkvMatrix, matrix); size += EbmlElementSize(kMkvMatrixCoefficients, matrix_coefficients);
if (bits_per_channel != kUnspecifiedColourValue) if (bits_per_channel != kUnspecifiedColourValue)
size += EbmlElementSize(kMkvBitsPerChannel, bits_per_channel); size += EbmlElementSize(kMkvBitsPerChannel, bits_per_channel);
if (chroma_subsampling_horz != kUnspecifiedColourValue) if (chroma_subsampling_horz != kUnspecifiedColourValue)
@ -1248,7 +1248,7 @@ bool VideoTrack::SetColour(const Colour& colour) {
return false; return false;
} }
colour_ptr->matrix = colour.matrix; colour_ptr->matrix_coefficients = colour.matrix_coefficients;
colour_ptr->bits_per_channel = colour.bits_per_channel; colour_ptr->bits_per_channel = colour.bits_per_channel;
colour_ptr->chroma_subsampling_horz = colour.chroma_subsampling_horz; colour_ptr->chroma_subsampling_horz = colour.chroma_subsampling_horz;
colour_ptr->chroma_subsampling_vert = colour.chroma_subsampling_vert; colour_ptr->chroma_subsampling_vert = colour.chroma_subsampling_vert;

View File

@ -394,7 +394,7 @@ class Colour {
public: public:
static const uint64 kUnspecifiedColourValue; static const uint64 kUnspecifiedColourValue;
Colour() Colour()
: matrix(kUnspecifiedColourValue), : matrix_coefficients(kUnspecifiedColourValue),
bits_per_channel(kUnspecifiedColourValue), bits_per_channel(kUnspecifiedColourValue),
chroma_subsampling_horz(kUnspecifiedColourValue), chroma_subsampling_horz(kUnspecifiedColourValue),
chroma_subsampling_vert(kUnspecifiedColourValue), chroma_subsampling_vert(kUnspecifiedColourValue),
@ -421,7 +421,7 @@ class Colour {
return mastering_metadata_; return mastering_metadata_;
} }
uint64 matrix; uint64 matrix_coefficients;
uint64 bits_per_channel; uint64 bits_per_channel;
uint64 chroma_subsampling_horz; uint64 chroma_subsampling_horz;
uint64 chroma_subsampling_vert; uint64 chroma_subsampling_vert;

View File

@ -5111,9 +5111,10 @@ bool Colour::Parse(IMkvReader* reader, long long colour_start,
if (status < 0) if (status < 0)
return false; return false;
if (child_id == mkvmuxer::kMkvMatrix) { if (child_id == mkvmuxer::kMkvMatrixCoefficients) {
colour_ptr->matrix = UnserializeUInt(reader, read_pos, child_size); colour_ptr->matrix_coefficients =
if (colour_ptr->matrix < 0) UnserializeUInt(reader, read_pos, child_size);
if (colour_ptr->matrix_coefficients < 0)
return false; return false;
} else if (child_id == mkvmuxer::kMkvBitsPerChannel) { } else if (child_id == mkvmuxer::kMkvBitsPerChannel) {
colour_ptr->bits_per_channel = colour_ptr->bits_per_channel =

View File

@ -437,7 +437,7 @@ struct Colour {
// Unless otherwise noted all values assigned upon construction are the // Unless otherwise noted all values assigned upon construction are the
// equivalent of unspecified/default. // equivalent of unspecified/default.
Colour() Colour()
: matrix(kValueNotPresent), : matrix_coefficients(kValueNotPresent),
bits_per_channel(kValueNotPresent), bits_per_channel(kValueNotPresent),
chroma_subsampling_horz(kValueNotPresent), chroma_subsampling_horz(kValueNotPresent),
chroma_subsampling_vert(kValueNotPresent), chroma_subsampling_vert(kValueNotPresent),
@ -459,7 +459,7 @@ struct Colour {
static bool Parse(IMkvReader* reader, long long element_start, static bool Parse(IMkvReader* reader, long long element_start,
long long element_size, Colour** colour); long long element_size, Colour** colour);
long long matrix; long long matrix_coefficients;
long long bits_per_channel; long long bits_per_channel;
long long chroma_subsampling_horz; long long chroma_subsampling_horz;
long long chroma_subsampling_vert; long long chroma_subsampling_vert;

View File

@ -238,8 +238,9 @@ int main(int argc, char* argv[]) {
const mkvparser::Colour* const colour = pVideoTrack->GetColour(); const mkvparser::Colour* const colour = pVideoTrack->GetColour();
if (colour) { if (colour) {
printf("\t\tVideo Colour:\n"); printf("\t\tVideo Colour:\n");
if (ColourValuePresent(colour->matrix)) if (ColourValuePresent(colour->matrix_coefficients))
printf("\t\t\tMatrix: %lld\n", colour->matrix); printf("\t\t\tMatrixCoefficients: %lld\n",
colour->matrix_coefficients);
if (ColourValuePresent(colour->bits_per_channel)) if (ColourValuePresent(colour->bits_per_channel))
printf("\t\t\tBitsPerChannel: %lld\n", colour->bits_per_channel); printf("\t\t\tBitsPerChannel: %lld\n", colour->bits_per_channel);
if (ColourValuePresent(colour->chroma_subsampling_horz)) if (ColourValuePresent(colour->chroma_subsampling_horz))

View File

@ -201,8 +201,8 @@ bool CopyColour(const mkvparser::Colour& parser_colour,
if (!muxer_colour) if (!muxer_colour)
return false; return false;
if (ColourValuePresent(parser_colour.matrix)) if (ColourValuePresent(parser_colour.matrix_coefficients))
muxer_colour->matrix = parser_colour.matrix; muxer_colour->matrix_coefficients = parser_colour.matrix_coefficients;
if (ColourValuePresent(parser_colour.bits_per_channel)) if (ColourValuePresent(parser_colour.bits_per_channel))
muxer_colour->bits_per_channel = parser_colour.bits_per_channel; muxer_colour->bits_per_channel = parser_colour.bits_per_channel;
if (ColourValuePresent(parser_colour.chroma_subsampling_horz)) if (ColourValuePresent(parser_colour.chroma_subsampling_horz))

View File

@ -97,7 +97,7 @@ enum MkvId {
// end video // end video
// colour // colour
kMkvColour = 0x55B0, kMkvColour = 0x55B0,
kMkvMatrix = 0x55B1, kMkvMatrixCoefficients = 0x55B1,
kMkvBitsPerChannel = 0x55B2, kMkvBitsPerChannel = 0x55B2,
kMkvChromaSubsamplingHorz = 0x55B3, kMkvChromaSubsamplingHorz = 0x55B3,
kMkvChromaSubsamplingVert = 0x55B4, kMkvChromaSubsamplingVert = 0x55B4,