TUT HEVC Encoder
Loading...
Searching...
No Matches
search_inter.h
Go to the documentation of this file.
1#ifndef SEARCH_INTER_H_
2#define SEARCH_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 "inter.h"
45#include "kvazaar.h"
46
47#define KVZ_LUMA_FILTER_TAPS 8
48#define KVZ_LUMA_FILTER_OFFSET 3
49#define KVZ_CHROMA_FILTER_TAPS 4
50#define KVZ_CHROMA_FILTER_OFFSET 1
51
52 // Maximum extra width a block needs to filter
53 // a fractional pixel with positive fractional mv.x and mv.y
54#define KVZ_EXT_PADDING_LUMA (KVZ_LUMA_FILTER_TAPS - 1)
55#define KVZ_EXT_PADDING_CHROMA (KVZ_CHROMA_FILTER_TAPS - 1)
56
57 // Maximum block width for extended block
58#define KVZ_EXT_BLOCK_W_LUMA (LCU_WIDTH + KVZ_EXT_PADDING_LUMA)
59#define KVZ_EXT_BLOCK_W_CHROMA (LCU_WIDTH_C + KVZ_EXT_PADDING_CHROMA)
60
66
67typedef double kvz_mvd_cost_func(const encoder_state_t *state,
68 int x, int y,
69 int mv_shift,
70 int16_t mv_cand[2][2],
72 int16_t num_cand,
73 int32_t ref_idx,
74 double *bitcost);
75
76void kvz_search_cu_inter(encoder_state_t * const state,
77 int x, int y, int depth,
78 lcu_t *lcu,
79 double *inter_cost,
80 double* inter_bitcost);
81
82void kvz_search_cu_smp(encoder_state_t * const state,
83 int x, int y,
84 int depth,
85 part_mode_t part_mode,
86 lcu_t *lcu,
87 double *inter_cost,
88 double* inter_bitcost);
89
90
92 const lcu_t *lcu,
93 int x,
94 int y);
96 int x, int y, int depth,
97 cu_info_t* cur_cu,
98 lcu_t* lcu,
99 double* inter_cost,
100 double* inter_bitcost);
101
102int kvz_get_skip_context(int x, int y, lcu_t* const lcu, cu_array_t* const cu_a);
103
104#endif // SEARCH_INTER_H_
Coding Unit data structure and related functions.
part_mode_t
Definition cu.h:57
Top level of the encoder implementation.
Header that is included in every other header.
#define MRG_MAX_NUM_CANDS
Definition global.h:197
Inter prediction.
This file defines the public API of Kvazaar when used as a library.
void kvz_cu_cost_inter_rd2(encoder_state_t *const state, int x, int y, int depth, cu_info_t *cur_cu, lcu_t *lcu, double *inter_cost, double *inter_bitcost)
Calculate inter coding cost for luma and chroma CBs (–rd=2 accuracy).
Definition search_inter.c:2070
void kvz_search_cu_smp(encoder_state_t *const state, int x, int y, int depth, part_mode_t part_mode, lcu_t *lcu, double *inter_cost, double *inter_bitcost)
Update CU to have best modes at this depth.
Definition search_inter.c:2283
int kvz_get_skip_context(int x, int y, lcu_t *const lcu, cu_array_t *const cu_a)
Definition search_inter.c:1165
void kvz_search_cu_inter(encoder_state_t *const state, int x, int y, int depth, lcu_t *lcu, double *inter_cost, double *inter_bitcost)
Update CU to have best modes at this depth.
Definition search_inter.c:2174
unsigned kvz_inter_satd_cost(const encoder_state_t *state, const lcu_t *lcu, int x, int y)
double kvz_mvd_cost_func(const encoder_state_t *state, int x, int y, int mv_shift, int16_t mv_cand[2][2], inter_merge_cand_t merge_cand[5], int16_t num_cand, int32_t ref_idx, double *bitcost)
Definition search_inter.h:67
hpel_position
Definition search_inter.h:61
@ HPEL_POS_HOR
Definition search_inter.h:62
@ HPEL_POS_VER
Definition search_inter.h:63
@ HPEL_POS_DIA
Definition search_inter.h:64
Definition cu.h:196
Struct for CU info.
Definition cu.h:130
Definition encoderstate.h:274
Definition inter.h:48
Definition cu.h:299