TUT HEVC Encoder
strategies-sao.h
Go to the documentation of this file.
1#ifndef STRATEGIES_SAO_H_
2#define STRATEGIES_SAO_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 "encoder.h"
42#include "encoderstate.h"
43#include "global.h" // IWYU pragma: keep
44#include "kvazaar.h"
45#include "sao.h"
46
47
48// Declare function pointers.
49typedef int (sao_edge_ddistortion_func)(const kvz_pixel *orig_data, const kvz_pixel *rec_data,
50 int block_width, int block_height,
51 int eo_class, int offsets[NUM_SAO_EDGE_CATEGORIES]);
52
53typedef void (calc_sao_edge_dir_func)(const kvz_pixel *orig_data, const kvz_pixel *rec_data,
54 int eo_class, int block_width, int block_height,
55 int cat_sum_cnt[2][NUM_SAO_EDGE_CATEGORIES]);
56
57typedef void (sao_reconstruct_color_func)(const encoder_control_t * const encoder,
58 const kvz_pixel *rec_data, kvz_pixel *new_rec_data,
59 const sao_info_t *sao,
60 int stride, int new_stride,
61 int block_width, int block_height,
62 color_t color_i);
63
64typedef int (sao_band_ddistortion_func)(const encoder_state_t * const state, const kvz_pixel *orig_data, const kvz_pixel *rec_data,
65 int block_width, int block_height,
66 int band_pos, const int sao_bands[4]);
67
68// Declare function pointers.
73
74int kvz_strategy_register_sao(void* opaque, uint8_t bitdepth);
75
76
77#define STRATEGIES_SAO_EXPORTS \
78 {"sao_edge_ddistortion", (void**) &kvz_sao_edge_ddistortion}, \
79 {"calc_sao_edge_dir", (void**) &kvz_calc_sao_edge_dir}, \
80 {"sao_reconstruct_color", (void**) &kvz_sao_reconstruct_color}, \
81 {"sao_band_ddistortion", (void**) &kvz_sao_band_ddistortion}, \
82
83
84
85#endif //STRATEGIES_SAO_H_
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
This file defines the public API of Kvazaar when used as a library.
uint8_t kvz_pixel
Definition: kvazaar.h:95
Sample Adaptive Offset filter.
@ NUM_SAO_EDGE_CATEGORIES
Definition: sao.h:52
void() calc_sao_edge_dir_func(const kvz_pixel *orig_data, const kvz_pixel *rec_data, int eo_class, int block_width, int block_height, int cat_sum_cnt[2][NUM_SAO_EDGE_CATEGORIES])
Definition: strategies-sao.h:53
int() sao_edge_ddistortion_func(const kvz_pixel *orig_data, const kvz_pixel *rec_data, int block_width, int block_height, int eo_class, int offsets[NUM_SAO_EDGE_CATEGORIES])
Definition: strategies-sao.h:49
int kvz_strategy_register_sao(void *opaque, uint8_t bitdepth)
Definition: strategies-sao.c:46
calc_sao_edge_dir_func * kvz_calc_sao_edge_dir
Definition: strategies-sao.c:41
sao_band_ddistortion_func * kvz_sao_band_ddistortion
Definition: strategies-sao.c:43
int() sao_band_ddistortion_func(const encoder_state_t *const state, const kvz_pixel *orig_data, const kvz_pixel *rec_data, int block_width, int block_height, int band_pos, const int sao_bands[4])
Definition: strategies-sao.h:64
sao_edge_ddistortion_func * kvz_sao_edge_ddistortion
Definition: strategies-sao.c:40
sao_reconstruct_color_func * kvz_sao_reconstruct_color
Definition: strategies-sao.c:42
void() sao_reconstruct_color_func(const encoder_control_t *const encoder, const kvz_pixel *rec_data, kvz_pixel *new_rec_data, const sao_info_t *sao, int stride, int new_stride, int block_width, int block_height, color_t color_i)
Definition: strategies-sao.h:57
Definition: encoder.h:49
Definition: encoderstate.h:274
Definition: sao.h:55