xref: /aosp_15_r20/external/intel-media-driver/media_driver/linux/common/codec/ddi/media_libvpx_vp9.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2017, Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22 //!
23 //! \file     media_libvpx_vp9.h
24 //! \brief    Defines the VP9 structure/function that is from libvpx
25 //!
26 
27 /*
28  * This file declares some vp9 function, and
29  * they are ported from libvpx (https://github.com/webmproject/libvpx/).
30  * The original copyright and licence statement as below.
31  */
32 
33 /*
34  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
35  *
36  *  Use of this source code is governed by a BSD-style license
37  *  that can be found in the media_libvpx.LICENSE file in the root of the source
38  *  tree. An additional intellectual property rights grant can be found
39  *  in the file media_libvpx.PATENTS.  All contributing project authors may
40  *  be found in the media_libvpx.AUTHORS file in the root of the source tree.
41  */
42 
43 #ifndef _MEDIA_LIBVPX_VP9_H
44 #define _MEDIA_LIBVPX_VP9_H
45 
46 #include <stdbool.h>
47 #include <stdint.h>
48 
49 #define VP9_PROFILE_0 0
50 #define VP9_PROFILE_1 1
51 #define VP9_PROFILE_2 2
52 #define VP9_PROFILE_3 3
53 
54 struct _DDI_ENCODE_CONTEXT;
55 
56 typedef struct _vp9_header_bitoffset_ {
57     uint32_t    bit_offset_ref_lf_delta;
58     uint32_t    bit_offset_mode_lf_delta;
59     uint32_t    bit_offset_lf_level;
60     uint32_t    bit_offset_qindex;
61     uint32_t    bit_offset_first_partition_size;
62     uint32_t    bit_offset_segmentation;
63     uint32_t    bit_size_segmentation;
64 } vp9_header_bitoffset;
65 
66 extern bool Vp9WriteUncompressHeader(struct _DDI_ENCODE_CONTEXT *ddiContext,
67                                        uint32_t codecProfile,
68                                        uint8_t  *headerData,
69                                        uint32_t *headerLen,
70                                        vp9_header_bitoffset *headerBitoffset);
71 
72 #endif /*MEDIA_LIBVPX_VP9_H */
73