xref: /aosp_15_r20/external/intel-media-driver/media_softlet/linux/common/codec/ddi/enc/media_libvpx_vp9_next.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2022, 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_next.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_NEXT_H
44 #define _MEDIA_LIBVPX_VP9_NEXT_H
45 
46 #include <stdbool.h>
47 #include <stdint.h>
48 #include "ddi_libva_encoder_specific.h"
49 
50 #define VP9_PROFILE_0 0
51 #define VP9_PROFILE_1 1
52 #define VP9_PROFILE_2 2
53 #define VP9_PROFILE_3 3
54 
55 typedef struct _vp9_header_bitoffset_ {
56     uint32_t    bit_offset_ref_lf_delta;
57     uint32_t    bit_offset_mode_lf_delta;
58     uint32_t    bit_offset_lf_level;
59     uint32_t    bit_offset_qindex;
60     uint32_t    bit_offset_first_partition_size;
61     uint32_t    bit_offset_segmentation;
62     uint32_t    bit_size_segmentation;
63 } vp9_header_bitoffset;
64 
65 bool Vp9WriteUncompressHeader(encode::DDI_ENCODE_CONTEXT *ddiContext,
66                                        uint32_t codecProfile,
67                                        uint8_t  *headerData,
68                                        uint32_t *headerLen,
69                                        vp9_header_bitoffset *headerBitoffset);
70 
71 #endif /*_MEDIA_LIBVPX_VP9_NEXT_H */
72