TUT HEVC Encoder
Loading...
Searching...
No Matches
search.h
Go to the documentation of this file.
1#ifndef SEARCH_H_
2#define SEARCH_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 "constraint.h"
46
47#define MAX_UNIT_STATS_MAP_SIZE MAX(MAX_REF_PIC_COUNT, MRG_MAX_NUM_CANDS)
48
49 // Modify weight of luma SSD.
50#ifndef KVZ_LUMA_MULT
51# define KVZ_LUMA_MULT 0.8
52#endif
53// Modify weight of chroma SSD.
54#ifndef KVZ_CHROMA_MULT
55# define KVZ_CHROMA_MULT 1.5
56#endif
57
75
78
79void kvz_search_lcu(encoder_state_t *state, int x, int y, const yuv_t *hor_buf, const yuv_t *ver_buf);
80
81double kvz_cu_rd_cost_luma(const encoder_state_t *const state,
82 const int x_px, const int y_px, const int depth,
83 const cu_info_t *const pred_cu,
84 lcu_t *const lcu);
85double kvz_cu_rd_cost_chroma(const encoder_state_t *const state,
86 const int x_px, const int y_px, const int depth,
87 const cu_info_t *const pred_cu,
88 lcu_t *const lcu);
89void kvz_lcu_fill_trdepth(lcu_t *lcu, int x_px, int y_px, int depth, int tr_depth);
90
91void kvz_intra_recon_lcu_luma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu);
92void kvz_intra_recon_lcu_chroma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu);
93
94#endif
Coding Unit data structure and related functions.
Top level of the encoder implementation.
Header that is included in every other header.
#define MAX_TILES_PER_DIM
Definition global.h:232
A reference counted YUV pixel buffer.
#define MAX_UNIT_STATS_MAP_SIZE
Definition search.h:47
void kvz_sort_keys_by_cost(unit_stats_map_t *__restrict map)
Sort keys (indices) to ascending order according to costs.
Definition search.c:611
void kvz_sort_modes(int8_t *__restrict modes, double *__restrict costs, uint8_t length)
Sort modes and costs to ascending order according to costs.
Definition search.c:587
double kvz_cu_rd_cost_luma(const encoder_state_t *const state, const int x_px, const int y_px, const int depth, const cu_info_t *const pred_cu, lcu_t *const lcu)
Calculate RD cost for a Coding Unit.
Definition search.c:241
void kvz_intra_recon_lcu_chroma(encoder_state_t *const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu)
void kvz_search_lcu(encoder_state_t *state, int x, int y, const yuv_t *hor_buf, const yuv_t *ver_buf)
Search LCU for modes.
Definition search.c:1188
double kvz_cu_rd_cost_chroma(const encoder_state_t *const state, const int x_px, const int y_px, const int depth, const cu_info_t *const pred_cu, lcu_t *const lcu)
Definition search.c:348
void kvz_lcu_fill_trdepth(lcu_t *lcu, int x_px, int y_px, int depth, int tr_depth)
Definition search.c:124
void kvz_intra_recon_lcu_luma(encoder_state_t *const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu)
Struct for CU info.
Definition cu.h:130
Definition encoderstate.h:274
Definition cu.h:299
Data collected during search processes.
Definition search.h:67
double cost[(((16)>(5))?(16):(5))]
list of matching RD costs
Definition search.h:70
int8_t keys[(((16)>(5))?(16):(5))]
list of keys (indices) to elements in the other arrays
Definition search.h:72
int size
number of active elements in the lists
Definition search.h:73
cu_info_t unit[(((16)>(5))?(16):(5))]
list of searched units
Definition search.h:69
double bits[(((16)>(5))?(16):(5))]
list of matching bit costs
Definition search.h:71
Definition image.h:54