TUT HEVC Encoder
Loading...
Searching...
No Matches
strategies-quant.h
Go to the documentation of this file.
1#ifndef STRATEGIES_QUANT_H_
2#define STRATEGIES_QUANT_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 "kvazaar.h"
45#include "tables.h"
46
47struct kvz_sh_rates_t;
48// Declare function pointers.
49typedef void (quant_func)(const encoder_state_t * const state, coeff_t *coef, coeff_t *q_coef, int32_t width,
52 const cu_info_t *const cur_cu, const int width, const color_t color,
54 const int in_stride, const int out_stride,
55 const kvz_pixel *const ref_in, const kvz_pixel *const pred_in,
57 bool early_skip);
58typedef void (dequant_func)(const encoder_state_t * const state, coeff_t *q_coef, coeff_t *coef, int32_t width,
59 int32_t height, int8_t type, int8_t block_type);
61
63
66
67// Declare function pointers.
68extern quant_func * kvz_quant;
74
75int kvz_strategy_register_quant(void* opaque, uint8_t bitdepth);
76
77
78#define STRATEGIES_QUANT_EXPORTS \
79 {"quant", (void**) &kvz_quant}, \
80 {"quantize_residual", (void**) &kvz_quantize_residual}, \
81 {"dequant", (void**) &kvz_dequant}, \
82 {"coeff_abs_sum", (void**) &kvz_coeff_abs_sum}, \
83 {"fast_coeff_cost", (void**) &kvz_fast_coeff_cost}, \
84 {"find_last_scanpos", (void**) &kvz_find_last_scanpos}, \
85
86
87
88#endif //STRATEGIES_QUANT_H_
Coding Unit data structure and related functions.
Top level of the encoder implementation.
Header that is included in every other header.
color_t
Definition global.h:302
#define MAX_TILES_PER_DIM
Definition global.h:232
int16_t coeff_t
Definition global.h:115
This file defines the public API of Kvazaar when used as a library.
uint8_t kvz_pixel
Definition kvazaar.h:95
double() fast_coeff_cost_func(const coeff_t *coeff, int32_t width, uint64_t weights)
Definition strategies-quant.h:60
void() quant_func(const encoder_state_t *const state, coeff_t *coef, coeff_t *q_coef, int32_t width, int32_t height, int8_t type, int8_t scan_idx, int8_t block_type)
Definition strategies-quant.h:49
fast_coeff_cost_func * kvz_fast_coeff_cost
Definition strategies-quant.c:45
int kvz_strategy_register_quant(void *opaque, uint8_t bitdepth)
Definition strategies-quant.c:49
coeff_abs_sum_func * kvz_coeff_abs_sum
Definition strategies-quant.c:44
uint32_t() coeff_abs_sum_func(const coeff_t *coeffs, size_t length)
Definition strategies-quant.h:62
quant_func * kvz_quant
Definition strategies-quant.c:41
void() find_last_scanpos_func(coeff_t *coef, coeff_t *dest_coeff, int8_t type, int32_t q_bits, const coeff_t *quant_coeff, struct kvz_sh_rates_t *sh_rates, const uint32_t cg_size, uint16_t *ctx_set, const uint32_t *scan, int32_t *cg_last_scanpos, int32_t *last_scanpos, uint32_t cg_num, int32_t *cg_scanpos, int32_t width, int8_t scan_mode)
Definition strategies-quant.h:64
void() dequant_func(const encoder_state_t *const state, coeff_t *q_coef, coeff_t *coef, int32_t width, int32_t height, int8_t type, int8_t block_type)
Definition strategies-quant.h:58
find_last_scanpos_func * kvz_find_last_scanpos
Definition strategies-quant.c:46
int32_t() quant_residual_func(encoder_state_t *const state, const cu_info_t *const cur_cu, const int width, const color_t color, const coeff_scan_order_t scan_order, const int use_trskip, const int in_stride, const int out_stride, const kvz_pixel *const ref_in, const kvz_pixel *const pred_in, kvz_pixel *rec_out, coeff_t *coeff_out, bool early_skip)
Definition strategies-quant.h:51
dequant_func * kvz_dequant
Definition strategies-quant.c:43
quant_residual_func * kvz_quantize_residual
Definition strategies-quant.c:42
Struct for CU info.
Definition cu.h:130
Definition encoderstate.h:274
Definition rdo.h:49
Various tables.
coeff_scan_order_t
Definition tables.h:93