TUT HEVC Encoder
Loading...
Searching...
No Matches
image.h
Go to the documentation of this file.
1#ifndef IMAGE_H_
2#define IMAGE_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 "global.h" // IWYU pragma: keep
42
43#include "kvazaar.h"
45
46
53
54typedef struct {
55 int size;
59} yuv_t;
60
67
68kvz_picture *kvz_image_alloc_420(const int32_t width, const int32_t height);
69kvz_picture *kvz_image_alloc(enum kvz_chroma_format chroma_format, const int32_t width, const int32_t height);
70
72
74
76 const unsigned x_offset,
77 const unsigned y_offset,
78 const unsigned width,
79 const unsigned height);
80
81yuv_t * kvz_yuv_t_alloc(int luma_size, int chroma_size);
82void kvz_yuv_t_free(yuv_t * yuv);
83
84
85//Algorithms
86unsigned kvz_image_calc_sad(const kvz_picture *pic,
87 const kvz_picture *ref,
88 int pic_x,
89 int pic_y,
90 int ref_x,
91 int ref_y,
92 int block_width,
93 int block_height,
94 optimized_sad_func_ptr_t optimized_sad);
95
96
97unsigned kvz_image_calc_satd(const kvz_picture *pic,
98 const kvz_picture *ref,
99 int pic_x,
100 int pic_y,
101 int ref_x,
102 int ref_y,
103 int block_width,
104 int block_height);
105
106
107void kvz_pixels_blit(const kvz_pixel* orig, kvz_pixel *dst,
108 unsigned width, unsigned height,
109 unsigned orig_stride, unsigned dst_stride);
110
111
112#endif
Header that is included in every other header.
#define LCU_LUMA_SIZE
Definition global.h:168
#define LCU_CHROMA_SIZE
Definition global.h:169
unsigned kvz_image_calc_satd(const kvz_picture *pic, const kvz_picture *ref, int pic_x, int pic_y, int ref_x, int ref_y, int block_width, int block_height)
Calculate interpolated SATD between two blocks.
Definition image.c:451
kvz_picture * kvz_image_alloc(enum kvz_chroma_format chroma_format, const int32_t width, const int32_t height)
Allocate a new image.
Definition image.c:56
void kvz_yuv_t_free(yuv_t *yuv)
Definition image.c:218
kvz_picture * kvz_image_copy_ref(kvz_picture *im)
Get a new pointer to an image.
Definition image.c:150
unsigned kvz_image_calc_sad(const kvz_picture *pic, const kvz_picture *ref, int pic_x, int pic_y, int ref_x, int ref_y, int block_width, int block_height, optimized_sad_func_ptr_t optimized_sad)
Calculate interpolated SAD between two blocks.
Definition image.c:407
yuv_t * kvz_yuv_t_alloc(int luma_size, int chroma_size)
Definition image.c:199
void kvz_pixels_blit(const kvz_pixel *orig, kvz_pixel *dst, unsigned width, unsigned height, unsigned orig_stride, unsigned dst_stride)
Definition image.c:547
kvz_picture * kvz_image_alloc_420(const int32_t width, const int32_t height)
Allocate a new image with 420.
Definition image.c:47
kvz_picture * kvz_image_make_subimage(kvz_picture *const orig_image, const unsigned x_offset, const unsigned y_offset, const unsigned width, const unsigned height)
Definition image.c:159
void kvz_image_free(kvz_picture *im)
Free an image.
Definition image.c:118
This file defines the public API of Kvazaar when used as a library.
uint8_t kvz_pixel
Definition kvazaar.h:95
int16_t kvz_pixel_im
Definition kvazaar.h:100
kvz_chroma_format
Chroma subsampling format used for encoding.
Definition kvazaar.h:209
uint32_t(* optimized_sad_func_ptr_t)(const kvz_pixel *const, const kvz_pixel *const, const int32_t, const uint32_t, const uint32_t)
Definition optimized_sad_func_ptr_t.h:13
Struct which contains all picture data.
Definition kvazaar.h:504
Definition image.h:47
enum kvz_chroma_format chroma_format
Definition image.h:51
Definition image.h:61
kvz_pixel_im * u
Definition image.h:64
kvz_pixel_im * v
Definition image.h:65
int size
Definition image.h:62
kvz_pixel_im * y
Definition image.h:63
Definition image.h:54
int size
Definition image.h:55
kvz_pixel * v
Definition image.h:58
kvz_pixel * u
Definition image.h:57
kvz_pixel * y
Definition image.h:56