]> granicus.if.org Git - libvpx/blob - third_party/libwebm/common/hdr_util.h
Merge "Fix high bit depth mask and variance reference function"
[libvpx] / third_party / libwebm / common / hdr_util.h
1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved.
2 //
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the LICENSE file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS.  All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 #ifndef LIBWEBM_COMMON_HDR_UTIL_H_
9 #define LIBWEBM_COMMON_HDR_UTIL_H_
10
11 #include <stdint.h>
12
13 #include <memory>
14
15 #include "mkvmuxer/mkvmuxer.h"
16
17 namespace mkvparser {
18 struct Colour;
19 struct MasteringMetadata;
20 struct PrimaryChromaticity;
21 }  // namespace mkvparser
22
23 namespace libwebm {
24 // Utility types and functions for working with the Colour element and its
25 // children. Copiers return true upon success. Presence functions return true
26 // when the specified element is present.
27
28 // TODO(tomfinegan): These should be moved to libwebm_utils once c++11 is
29 // required by libwebm.
30
31 typedef std::auto_ptr<mkvmuxer::PrimaryChromaticity> PrimaryChromaticityPtr;
32
33 bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
34                              PrimaryChromaticityPtr* muxer_pc);
35
36 bool MasteringMetadataValuePresent(double value);
37
38 bool CopyMasteringMetadata(const mkvparser::MasteringMetadata& parser_mm,
39                            mkvmuxer::MasteringMetadata* muxer_mm);
40
41 bool ColourValuePresent(long long value);
42
43 bool CopyColour(const mkvparser::Colour& parser_colour,
44                 mkvmuxer::Colour* muxer_colour);
45
46 // Returns VP9 profile upon success or 0 upon failure.
47 int ParseVpxCodecPrivate(const uint8_t* private_data, int32_t length);
48
49 }  // namespace libwebm
50
51 #endif  // LIBWEBM_COMMON_HDR_UTIL_H_