TUT HEVC Encoder
transform.h
Go to the documentation of this file.
1#ifndef TRANSFORM_H_
2#define TRANSFORM_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 "encoder.h"
43#include "encoderstate.h"
44#include "global.h" // IWYU pragma: keep
45
46extern const uint8_t kvz_g_chroma_scale[58];
47extern const int16_t kvz_g_inv_quant_scales[6];
48
49void kvz_transformskip(const encoder_control_t *encoder, int16_t *block,int16_t *coeff, int8_t block_size);
50void kvz_itransformskip(const encoder_control_t *encoder, int16_t *block,int16_t *coeff, int8_t block_size);
51
52void kvz_transform2d(const encoder_control_t * const encoder,
53 int16_t *block,
54 int16_t *coeff,
55 int8_t block_size,
56 color_t color,
57 cu_type_t type);
58void kvz_itransform2d(const encoder_control_t * const encoder,
59 int16_t *block,
60 int16_t *coeff,
61 int8_t block_size,
62 color_t color,
63 cu_type_t type);
64
65int32_t kvz_get_scaled_qp(int8_t type, int8_t qp, int8_t qp_offset);
66
68 bool luma,
69 bool chroma,
70 int32_t x,
71 int32_t y,
72 uint8_t depth,
73 cu_info_t *cur_cu,
74 lcu_t* lcu,
75 bool early_skip);
76
77#endif
Coding Unit data structure and related functions.
cu_type_t
Definition: cu.h:50
Initialization of encoder_control_t.
Top level of the encoder implementation.
Header that is included in every other header.
color_t
Definition: global.h:309
Struct for CU info.
Definition: cu.h:130
Definition: encoder.h:49
Definition: encoderstate.h:274
Definition: cu.h:299
const uint8_t kvz_g_chroma_scale[58]
Definition: transform.c:56
const int16_t kvz_g_inv_quant_scales[6]
Definition: scalinglist.c:79
void kvz_transform2d(const encoder_control_t *const encoder, int16_t *block, int16_t *coeff, int8_t block_size, color_t color, cu_type_t type)
forward transform (2D)
Definition: transform.c:202
void kvz_itransformskip(const encoder_control_t *encoder, int16_t *block, int16_t *coeff, int8_t block_size)
inverse transform skip
Definition: transform.c:182
void kvz_transformskip(const encoder_control_t *encoder, int16_t *block, int16_t *coeff, int8_t block_size)
NxN inverse transform (2D)
Definition: transform.c:163
int32_t kvz_get_scaled_qp(int8_t type, int8_t qp, int8_t qp_offset)
Get scaled QP used in quantization.
Definition: transform.c:141
void kvz_itransform2d(const encoder_control_t *const encoder, int16_t *block, int16_t *coeff, int8_t block_size, color_t color, cu_type_t type)
Definition: transform.c:213
void kvz_quantize_lcu_residual(encoder_state_t *state, bool luma, bool chroma, int32_t x, int32_t y, uint8_t depth, cu_info_t *cur_cu, lcu_t *lcu, bool early_skip)
This function calculates the residual coefficients for a region of the LCU (defined by x,...
Definition: transform.c:439