TUT HEVC Encoder
inter.h
Go to the documentation of this file.
1#ifndef INTER_H_
2#define INTER_H_
3/*****************************************************************************
4 * This file is part of Kvazaar HEVC encoder.
5 *
6 * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without modification,
10 * are permitted provided that the following conditions are met:
11 *
12 * * Redistributions of source code must retain the above copyright notice, this
13 * list of conditions and the following disclaimer.
14 *
15 * * Redistributions in binary form must reproduce the above copyright notice, this
16 * list of conditions and the following disclaimer in the documentation and/or
17 * other materials provided with the distribution.
18 *
19 * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
30 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
33 ****************************************************************************/
34
41#include "cu.h"
42#include "encoderstate.h"
43#include "global.h" // IWYU pragma: keep
44#include "image.h"
45#include "kvazaar.h"
46
47
48typedef struct {
49 uint8_t dir;
50 uint8_t ref[2]; // index to L0/L1
51 int16_t mv[2][2];
52
54
55void kvz_inter_recon_cu(const encoder_state_t * const state,
56 lcu_t *lcu,
57 int32_t x,
58 int32_t y,
59 int32_t width,
60 bool predict_luma,
61 bool predict_chroma);
62
63void kvz_inter_pred_pu(const encoder_state_t * const state,
64 lcu_t *lcu,
65 int32_t x,
66 int32_t y,
67 int32_t width,
68 bool predict_luma,
69 bool predict_chroma,
70 int i_pu);
71
72void kvz_inter_recon_bipred(const encoder_state_t * const state,
73 const kvz_picture * ref1,
74 const kvz_picture * ref2,
75 int32_t xpos,
76 int32_t ypos,
77 int32_t width,
78 int32_t height,
79 int16_t mv_param[2][2],
80 lcu_t* lcu,
81 bool predict_luma,
82 bool predict_chroma);
83
84
85void kvz_inter_get_mv_cand(const encoder_state_t * const state,
86 int32_t x,
87 int32_t y,
88 int32_t width,
89 int32_t height,
90 int16_t mv_cand[2][2],
91 const cu_info_t* cur_cu,
92 lcu_t *lcu,
93 int8_t reflist);
94
95void kvz_inter_get_mv_cand_cua(const encoder_state_t * const state,
96 int32_t x,
97 int32_t y,
98 int32_t width,
99 int32_t height,
100 int16_t mv_cand[2][2],
101 const cu_info_t* cur_cu,
102 int8_t reflist);
103
104uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
105 int32_t x, int32_t y,
106 int32_t width, int32_t height,
107 bool use_a1, bool use_b1,
109 lcu_t *lcu);
110#endif
Coding Unit data structure and related functions.
Top level of the encoder implementation.
Header that is included in every other header.
#define MRG_MAX_NUM_CANDS
Definition: global.h:197
A reference counted YUV pixel buffer.
uint8_t kvz_inter_get_merge_cand(const encoder_state_t *const state, int32_t x, int32_t y, int32_t width, int32_t height, bool use_a1, bool use_b1, inter_merge_cand_t mv_cand[5], lcu_t *lcu)
Get merge predictions for current block.
Definition: inter.c:1440
void kvz_inter_recon_cu(const encoder_state_t *const state, lcu_t *lcu, int32_t x, int32_t y, int32_t width, bool predict_luma, bool predict_chroma)
Reconstruct a single CU.
Definition: inter.c:575
void kvz_inter_recon_bipred(const encoder_state_t *const state, const kvz_picture *ref1, const kvz_picture *ref2, int32_t xpos, int32_t ypos, int32_t width, int32_t height, int16_t mv_param[2][2], lcu_t *lcu, bool predict_luma, bool predict_chroma)
Reconstruct bi-pred inter PU.
Definition: inter.c:504
void kvz_inter_get_mv_cand(const encoder_state_t *const state, int32_t x, int32_t y, int32_t width, int32_t height, int16_t mv_cand[2][2], const cu_info_t *cur_cu, lcu_t *lcu, int8_t reflist)
Get MV prediction for current block.
Definition: inter.c:1332
void kvz_inter_get_mv_cand_cua(const encoder_state_t *const state, int32_t x, int32_t y, int32_t width, int32_t height, int16_t mv_cand[2][2], const cu_info_t *cur_cu, int8_t reflist)
Get MV prediction for current block using state->tile->frame->cu_array.
Definition: inter.c:1365
void kvz_inter_pred_pu(const encoder_state_t *const state, lcu_t *lcu, int32_t x, int32_t y, int32_t width, bool predict_luma, bool predict_chroma, int i_pu)
Predict a single PU.
Definition: inter.c:604
This file defines the public API of Kvazaar when used as a library.
Struct for CU info.
Definition: cu.h:130
Definition: encoderstate.h:274
Definition: inter.h:48
uint8_t dir
Definition: inter.h:49
Struct which contains all picture data.
Definition: kvazaar.h:504
Definition: cu.h:299