TUT HEVC Encoder
kvazaar.h
Go to the documentation of this file.
1#ifndef KVAZAAR_H_
2#define KVAZAAR_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 <stdint.h>
42#include <stdio.h>
43
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49#if defined(KVZ_DLL_EXPORTS)
50 #if !defined(PIC)
51 // Building static kvazaar library.
52 #define KVZ_PUBLIC
53 #elif defined(_WIN32) || defined(__CYGWIN__)
54 // Building kvazaar DLL on Windows.
55 #define KVZ_PUBLIC __declspec(dllexport)
56 #elif defined(__GNUC__)
57 // Building kvazaar shared library with GCC.
58 #define KVZ_PUBLIC __attribute__ ((visibility ("default")))
59 #else
60 #define KVZ_PUBLIC
61 #endif
62#else
63 #if defined(KVZ_STATIC_LIB)
64 // Using static kvazaar library.
65 #define KVZ_PUBLIC
66 #elif defined(_WIN32) || defined(__CYGWIN__)
67 // Using kvazaar DLL on Windows.
68 #define KVZ_PUBLIC __declspec(dllimport)
69 #else
70 // Using kvazaar shared library and not on Windows.
71 #define KVZ_PUBLIC
72 #endif
73#endif
74
78#define KVZ_MAX_GOP_LENGTH 32
79
83#define KVZ_MAX_GOP_LAYERS 6
84
88#define KVZ_DATA_CHUNK_SIZE 4096
89
90#ifndef KVZ_BIT_DEPTH
91#define KVZ_BIT_DEPTH 8
92#endif
93
94#if KVZ_BIT_DEPTH == 8
95typedef uint8_t kvz_pixel;
96#else
97typedef uint16_t kvz_pixel;
98#endif
99
100typedef int16_t kvz_pixel_im; // For intermediate precision (interpolation/bipred).
101
106
118 KVZ_IME_DIA = 7, // Experimental. TODO: change into a proper doc comment
119};
120
126{
128 KVZ_INTERLACING_TFF = 1, // top field first
129 KVZ_INTERLACING_BFF = 2, // bottom field first
130};
131
137{
139 KVZ_MV_CONSTRAIN_FRAME = 1, // Don't refer outside the frame.
140 KVZ_MV_CONSTRAIN_TILE = 2, // Don't refer to other tiles.
141 KVZ_MV_CONSTRAIN_FRAME_AND_TILE = 3, // Don't refer outside the tile.
142 KVZ_MV_CONSTRAIN_FRAME_AND_TILE_MARGIN = 4, // Keep enough margin for fractional pixel margins not to refer outside the tile.
143};
144
150{
154};
155
161{
165
172 KVZ_CRYPTO_MVs = (1 << 0),
177 KVZ_CRYPTO_ON = (1 << 5) - 1,
178};
179
185{
190
191
203};
204
214};
215
222 KVZ_SLICES_TILES = (1 << 0),
223 KVZ_SLICES_WPP = (1 << 1),
224};
225
230 KVZ_SAO_FULL = 3
232
237};
238
240{
244};
245
247{
252
254{
256 KVZ_ROI_BIN = 1
258
259// Map from input format to chroma format.
260#define KVZ_FORMAT2CSP(format) ((enum kvz_chroma_format)"\0\1\2\3"[format])
261
265typedef struct kvz_gop_config {
266 double qp_factor;
267 int8_t qp_offset;
268 int8_t poc_offset;
269 int8_t layer;
270 int8_t is_ref;
272 int8_t ref_pos[16];
274 int8_t ref_neg[16];
278
286typedef struct kvz_config
287{
288 int32_t qp;
289 int32_t intra_period;
300 int32_t vps_period;
301
302 int32_t width;
303 int32_t height;
304 double framerate;
309 int32_t rdoq_enable;
311 int32_t smp_enable;
312 int32_t amp_enable;
313 int32_t rdo;
318 int32_t fme_level;
320 int32_t bipred;
321 int32_t deblock_beta;
322 int32_t deblock_tc;
323 struct
324 {
325 int32_t sar_width;
326 int32_t sar_height;
327 int8_t overscan;
328 int8_t videoformat;
329 int8_t fullrange;
330 int8_t colorprim;
331 int8_t transfer;
332 int8_t colormatrix;
333 int32_t chroma_loc;
335 int32_t aud_enable;
336 int32_t ref_frames;
337 char * cqmfile;
344 int wpp;
345 int owf;
346
347 int32_t slice_count;
349
350 int32_t threads;
351 int32_t cpuid;
352
353 struct {
357
359 int8_t gop_len;
364
365 int8_t mv_rdo;
366 int8_t calc_psnr;
374 uint8_t *optional_key;
375
377 int32_t intra_rdo_et;
379 int32_t lossless;
381 int32_t tmvp_enable;
383 int32_t rdoq_skip;
388 struct {
389 unsigned d; // depth
390 unsigned t; // temporal
392
395 struct {
398 } roi;
400 unsigned slices;
405 int32_t erp_aqp;
406
408 uint8_t level;
410 uint8_t force_level;
412 uint8_t high_tier;
414 uint32_t max_bitrate;
415
417 uint32_t me_max_steps;
418
423
426
429
431 int8_t open_gop;
432
433 int32_t vaq;
437
439 uint8_t max_merge;
440
442 uint8_t early_skip;
443
446
448 struct {
449 uint8_t startCTU_x;
450 uint8_t startCTU_y;
451 uint16_t fullWidth;
452 uint16_t fullHeight;
454
457
460
463
466
468
470
477
483
485
489
490 uint8_t force_inter;
491
493
494 uint8_t fast_bipred;
495
498
504typedef struct kvz_picture {
507
512
513 int32_t width;
514 int32_t height;
515
516 int32_t stride;
517
519 int32_t refcount;
520
521 int64_t pts;
522 int64_t dts;
523
526
527 int32_t ref_pocs[16];
528
529 struct
530 {
531 int width;
533 int8_t *roi_array;
535
537
544
545 // Trailing pictures
546
549
552
555
556 // Leading pictures
557
560
563
564 // Reserved non-IRAP RSV_VCL_N/R 10-15
565
566 // Intra random access point pictures
567
571
574
576
577 // Reserved IRAP
578
581
582 // Reserved non-IRAP RSV_VCL 24-32
583
584 // non-VCL
585
589
594
597
598 // Reserved RSV_NVCL 41-47
599 // Unspecified UNSPEC 48-63
600};
601
606};
607
611typedef struct kvz_frame_info {
612
616 int32_t poc;
617
621 int8_t qp;
622
627
632
639 int ref_list[2][16];
640
645
647
653typedef struct kvz_data_chunk {
656
658 uint32_t len;
659
663
664typedef struct kvz_api {
665
673 kvz_config * (*config_alloc)(void);
674
685
695
704 int (*config_parse)(kvz_config *cfg, const char *name, const char *value);
705
715 kvz_picture * (*picture_alloc)(int32_t width, int32_t height);
716
724
731 void (*chunk_free)(kvz_data_chunk *chunk);
732
743 kvz_encoder * (*encoder_open)(const kvz_config *cfg);
744
751 void (*encoder_close)(kvz_encoder *encoder);
752
770 kvz_data_chunk **data_out,
771 uint32_t *len_out);
772
807 kvz_picture *pic_in,
808 kvz_data_chunk **data_out,
809 uint32_t *len_out,
810 kvz_picture **pic_out,
811 kvz_picture **src_out,
812 kvz_frame_info *info_out);
813
825 kvz_picture * (*picture_alloc_csp)(enum kvz_chroma_format chroma_fomat, int32_t width, int32_t height);
827
828
829KVZ_PUBLIC const kvz_api * kvz_api_get(int bit_depth);
830
831#ifdef __cplusplus
832}
833#endif
834
835#endif // KVAZAAR_H_
kvz_input_format
Format the pixels are read in.
Definition: kvazaar.h:198
@ KVZ_FORMAT_P420
Definition: kvazaar.h:200
@ KVZ_FORMAT_P422
Definition: kvazaar.h:201
@ KVZ_FORMAT_P400
Definition: kvazaar.h:199
@ KVZ_FORMAT_P444
Definition: kvazaar.h:202
uint8_t kvz_pixel
Definition: kvazaar.h:95
kvz_roi_format
Definition: kvazaar.h:254
@ KVZ_ROI_TXT
Definition: kvazaar.h:255
@ KVZ_ROI_BIN
Definition: kvazaar.h:256
kvz_sao
Definition: kvazaar.h:226
@ KVZ_SAO_OFF
Definition: kvazaar.h:227
@ KVZ_SAO_FULL
Definition: kvazaar.h:230
@ KVZ_SAO_EDGE
Definition: kvazaar.h:228
@ KVZ_SAO_BAND
Definition: kvazaar.h:229
kvz_slice_type
Definition: kvazaar.h:602
@ KVZ_SLICE_B
Definition: kvazaar.h:603
@ KVZ_SLICE_I
Definition: kvazaar.h:605
@ KVZ_SLICE_P
Definition: kvazaar.h:604
struct kvz_data_chunk kvz_data_chunk
A linked list of chunks of data.
struct kvz_gop_config kvz_gop_config
GoP picture configuration.
#define KVZ_PUBLIC
Definition: kvazaar.h:71
kvz_me_early_termination
me early termination mode
Definition: kvazaar.h:185
@ KVZ_ME_EARLY_TERMINATION_ON
Definition: kvazaar.h:187
@ KVZ_ME_EARLY_TERMINATION_OFF
Definition: kvazaar.h:186
@ KVZ_ME_EARLY_TERMINATION_SENSITIVE
Definition: kvazaar.h:188
kvz_slices
Chroma subsampling format used for encoding.
Definition: kvazaar.h:220
@ KVZ_SLICES_TILES
Put each tile in a slice.
Definition: kvazaar.h:222
@ KVZ_SLICES_WPP
Put each row in a slice.
Definition: kvazaar.h:223
@ KVZ_SLICES_NONE
Definition: kvazaar.h:221
kvz_file_format
Definition: kvazaar.h:247
@ KVZ_FORMAT_Y4M
Definition: kvazaar.h:249
@ KVZ_FORMAT_YUV
Definition: kvazaar.h:250
@ KVZ_FORMAT_AUTO
Definition: kvazaar.h:248
struct kvz_picture kvz_picture
Struct which contains all picture data.
#define KVZ_MAX_GOP_LENGTH
Maximum length of a GoP structure.
Definition: kvazaar.h:78
int16_t kvz_pixel_im
Definition: kvazaar.h:100
kvz_interlacing
Interlacing methods.
Definition: kvazaar.h:126
@ KVZ_INTERLACING_TFF
Definition: kvazaar.h:128
@ KVZ_INTERLACING_NONE
Definition: kvazaar.h:127
@ KVZ_INTERLACING_BFF
Definition: kvazaar.h:129
kvz_ime_algorithm
Integer motion estimation algorithms.
Definition: kvazaar.h:110
@ KVZ_IME_FULL32
Definition: kvazaar.h:116
@ KVZ_IME_FULL64
Definition: kvazaar.h:117
@ KVZ_IME_FULL8
Definition: kvazaar.h:114
@ KVZ_IME_FULL16
Definition: kvazaar.h:115
@ KVZ_IME_DIA
Definition: kvazaar.h:118
@ KVZ_IME_FULL
Definition: kvazaar.h:113
@ KVZ_IME_HEXBS
Definition: kvazaar.h:111
@ KVZ_IME_TZ
Definition: kvazaar.h:112
kvz_scalinglist
Definition: kvazaar.h:233
@ KVZ_SCALING_LIST_CUSTOM
Definition: kvazaar.h:235
@ KVZ_SCALING_LIST_OFF
Definition: kvazaar.h:234
@ KVZ_SCALING_LIST_DEFAULT
Definition: kvazaar.h:236
const kvz_api * kvz_api_get(int bit_depth)
Definition: kvazaar.c:421
struct kvz_config kvz_config
Struct which contains all configuration data.
kvz_chroma_format
Chroma subsampling format used for encoding.
Definition: kvazaar.h:209
@ KVZ_CSP_400
Definition: kvazaar.h:210
@ KVZ_CSP_420
Definition: kvazaar.h:211
@ KVZ_CSP_422
Definition: kvazaar.h:212
@ KVZ_CSP_444
Definition: kvazaar.h:213
kvz_cu_split_termination
cu split termination mode
Definition: kvazaar.h:161
@ KVZ_CU_SPLIT_TERMINATION_ZERO
Definition: kvazaar.h:162
@ KVZ_CU_SPLIT_TERMINATION_OFF
Definition: kvazaar.h:163
kvz_nal_unit_type
NAL unit type codes.
Definition: kvazaar.h:543
@ KVZ_NAL_RSV_IRAP_VCL23
Definition: kvazaar.h:580
@ KVZ_NAL_PPS_NUT
Definition: kvazaar.h:588
@ KVZ_NAL_BLA_W_RADL
Definition: kvazaar.h:569
@ KVZ_NAL_AUD_NUT
Definition: kvazaar.h:590
@ KVZ_NAL_BLA_N_LP
Definition: kvazaar.h:570
@ KVZ_NAL_RASL_N
Definition: kvazaar.h:561
@ KVZ_NAL_FD_NUT
Definition: kvazaar.h:593
@ KVZ_NAL_STSA_N
Definition: kvazaar.h:553
@ KVZ_NAL_RASL_R
Definition: kvazaar.h:562
@ KVZ_NAL_RADL_N
Definition: kvazaar.h:558
@ KVZ_NAL_TRAIL_N
Definition: kvazaar.h:547
@ KVZ_NAL_IDR_W_RADL
Definition: kvazaar.h:572
@ KVZ_NAL_STSA_R
Definition: kvazaar.h:554
@ KVZ_NAL_TSA_N
Definition: kvazaar.h:550
@ KVZ_NAL_RADL_R
Definition: kvazaar.h:559
@ KVZ_NAL_IDR_N_LP
Definition: kvazaar.h:573
@ KVZ_NAL_BLA_W_LP
Definition: kvazaar.h:568
@ KVZ_NAL_EOB_NUT
Definition: kvazaar.h:592
@ KVZ_NAL_VPS_NUT
Definition: kvazaar.h:586
@ KVZ_NAL_TSA_R
Definition: kvazaar.h:551
@ KVZ_NAL_SUFFIX_SEI_NUT
Definition: kvazaar.h:596
@ KVZ_NAL_CRA_NUT
Definition: kvazaar.h:575
@ KVZ_NAL_SPS_NUT
Definition: kvazaar.h:587
@ KVZ_NAL_EOS_NUT
Definition: kvazaar.h:591
@ KVZ_NAL_PREFIX_SEI_NUT
Definition: kvazaar.h:595
@ KVZ_NAL_RSV_IRAP_VCL22
Definition: kvazaar.h:579
@ KVZ_NAL_TRAIL_R
Definition: kvazaar.h:548
kvz_mv_constraint
Constrain movement vectors.
Definition: kvazaar.h:137
@ KVZ_MV_CONSTRAIN_FRAME
Definition: kvazaar.h:139
@ KVZ_MV_CONSTRAIN_FRAME_AND_TILE_MARGIN
Definition: kvazaar.h:142
@ KVZ_MV_CONSTRAIN_NONE
Definition: kvazaar.h:138
@ KVZ_MV_CONSTRAIN_FRAME_AND_TILE
Definition: kvazaar.h:141
@ KVZ_MV_CONSTRAIN_TILE
Definition: kvazaar.h:140
#define KVZ_MAX_GOP_LAYERS
Maximum amount of GoP layers.
Definition: kvazaar.h:83
kvz_hash
Constrain movement vectors.
Definition: kvazaar.h:150
@ KVZ_HASH_NONE
Definition: kvazaar.h:151
@ KVZ_HASH_MD5
Definition: kvazaar.h:153
@ KVZ_HASH_CHECKSUM
Definition: kvazaar.h:152
struct kvz_frame_info kvz_frame_info
Other information about an encoded frame.
#define KVZ_DATA_CHUNK_SIZE
Size of data chunks.
Definition: kvazaar.h:88
kvz_rc_algorithm
Definition: kvazaar.h:240
@ KVZ_LAMBDA
Definition: kvazaar.h:242
@ KVZ_OBA
Definition: kvazaar.h:243
@ KVZ_NO_RC
Definition: kvazaar.h:241
struct kvz_api kvz_api
kvz_crypto_features
Enable and disable crypto features.
Definition: kvazaar.h:170
@ KVZ_CRYPTO_MVs
Definition: kvazaar.h:172
@ KVZ_CRYPTO_ON
Definition: kvazaar.h:177
@ KVZ_CRYPTO_TRANSF_COEFFS
Definition: kvazaar.h:174
@ KVZ_CRYPTO_MV_SIGNS
Definition: kvazaar.h:173
@ KVZ_CRYPTO_INTRA_MODE
Definition: kvazaar.h:176
@ KVZ_CRYPTO_TRANSF_COEFF_SIGNS
Definition: kvazaar.h:175
@ KVZ_CRYPTO_OFF
Definition: kvazaar.h:171
Definition: kvazaar.h:664
int(* config_parse)(kvz_config *cfg, const char *name, const char *value)
Set an option.
Definition: kvazaar.h:704
void(* picture_free)(kvz_picture *pic)
Deallocate a kvz_picture.
Definition: kvazaar.h:723
int(* encoder_headers)(kvz_encoder *encoder, kvz_data_chunk **data_out, uint32_t *len_out)
Get parameter sets.
Definition: kvazaar.h:769
int(* encoder_encode)(kvz_encoder *encoder, kvz_picture *pic_in, kvz_data_chunk **data_out, uint32_t *len_out, kvz_picture **pic_out, kvz_picture **src_out, kvz_frame_info *info_out)
Encode one frame.
Definition: kvazaar.h:806
void(* encoder_close)(kvz_encoder *encoder)
Deallocate an encoder.
Definition: kvazaar.h:751
int(* config_destroy)(kvz_config *cfg)
Deallocate a kvz_config structure.
Definition: kvazaar.h:684
void(* chunk_free)(kvz_data_chunk *chunk)
Deallocate a list of data chunks.
Definition: kvazaar.h:731
int(* config_init)(kvz_config *cfg)
Initialize a config structure.
Definition: kvazaar.h:694
Struct which contains all configuration data.
Definition: kvazaar.h:287
unsigned d
Definition: kvazaar.h:389
uint8_t intra_bit_allocation
whether to use hadamard based bit allocation for intra frames or not
Definition: kvazaar.h:465
enum kvz_mv_constraint mv_constraint
Constrain movement vectors.
Definition: kvazaar.h:368
int32_t full_intra_search
If true, don't skip modes in intra search.
Definition: kvazaar.h:314
int8_t gop_lowdelay
specifies that the GOP does not use future pictures
Definition: kvazaar.h:360
int32_t framerate_num
Framerate numerator.
Definition: kvazaar.h:305
struct kvz_config::@14 roi
Specify delta QPs for region of interest coding.
int32_t height
frame height, must be a multiple of 8
Definition: kvazaar.h:303
enum kvz_sao sao_type
Flag to enable sample adaptive offset filter.
Definition: kvazaar.h:308
uint8_t enable_logging_output
May be used to disable the logging output to stderr. Default: on.
Definition: kvazaar.h:496
uint8_t clip_neighbour
Definition: kvazaar.h:467
uint32_t me_max_steps
Maximum steps that hexagonal and diagonal motion estimation can use.
Definition: kvazaar.h:417
char * fast_coeff_table_fn
Pointer to fast coeff table filename.
Definition: kvazaar.h:472
int32_t deblock_enable
Flag to enable deblocking filter.
Definition: kvazaar.h:307
int32_t deblock_tc
(deblocking) tc offset (div 2), range -6...6
Definition: kvazaar.h:322
int32_t vps_period
How often the VPS, SPS and PPS are re-sent.
Definition: kvazaar.h:300
uint8_t fast_bipred
Definition: kvazaar.h:494
uint8_t zero_coeff_rdo
Always consider CU without any quantized residual.
Definition: kvazaar.h:456
uint8_t startCTU_x
Definition: kvazaar.h:449
uint8_t intra_chroma_search
Definition: kvazaar.h:492
int wpp
Definition: kvazaar.h:344
int32_t deblock_beta
(deblocking) beta offset (div 2), range -6...6
Definition: kvazaar.h:321
struct kvz_config::@12 pu_depth_inter
uint8_t force_inter
Definition: kvazaar.h:490
int owf
Definition: kvazaar.h:345
int32_t ref_frames
number of reference frames to use
Definition: kvazaar.h:336
int8_t frame_allocation
Currently unused parameter for OBA rc.
Definition: kvazaar.h:459
int32_t bipred
Bi-prediction (0: disabled, 1: enabled).
Definition: kvazaar.h:320
uint8_t max_merge
Maximum number of merge cadidates.
Definition: kvazaar.h:439
int32_t trskip_enable
Flag to enable transform skip (for 4x4 blocks).
Definition: kvazaar.h:315
int8_t colormatrix
Color matrix coefficients.
Definition: kvazaar.h:332
int32_t max[6]
Definition: kvazaar.h:355
unsigned t
Definition: kvazaar.h:390
struct kvz_config::@11 vui
int32_t tr_depth_intra
Maximum transform depth for intra.
Definition: kvazaar.h:316
int8_t intra_qp_offset
Offset to add to QP for intra frames.
Definition: kvazaar.h:420
enum kvz_file_format file_format
Definition: kvazaar.h:469
enum kvz_me_early_termination me_early_termination
Mode of me early termination.
Definition: kvazaar.h:376
uint8_t ml_pu_depth_intra
Enable Machine learning CU depth prediction for Intra encoding.
Definition: kvazaar.h:445
int8_t calc_psnr
Print PSNR in CLI.
Definition: kvazaar.h:366
int32_t * slice_addresses_in_ts
Definition: kvazaar.h:348
int32_t tiles_height_count
number of tiles separation in y direction
Definition: kvazaar.h:340
int32_t width
frame width, must be a multiple of 8
Definition: kvazaar.h:302
int32_t aud_enable
Flag to use access unit delimiters.
Definition: kvazaar.h:335
uint8_t fastrd_accuracy_check_on
Definition: kvazaar.h:482
uint8_t startCTU_y
Definition: kvazaar.h:450
double framerate
Deprecated, will be removed.
Definition: kvazaar.h:304
uint8_t early_skip
Enable Early Skip Mode Decision.
Definition: kvazaar.h:442
int32_t fme_level
Fractional pixel motion estimation level (0: disabled, 1: enabled).
Definition: kvazaar.h:318
int32_t * tiles_width_split
tiles split x coordinates (dimension: tiles_width_count)
Definition: kvazaar.h:341
int8_t rc_algorithm
used rc scheme, 0 for QP
Definition: kvazaar.h:462
int8_t transfer
Transfer characteristics.
Definition: kvazaar.h:331
uint16_t fullHeight
Definition: kvazaar.h:452
int32_t vaq
Definition: kvazaar.h:433
int32_t min[6]
Definition: kvazaar.h:354
int32_t rdoq_enable
Flag to enable RD optimized quantization.
Definition: kvazaar.h:309
int32_t threads
Definition: kvazaar.h:350
struct kvz_config::@15 partial_coding
Used for partial frame encoding.
int32_t framerate_denom
Framerate denominator.
Definition: kvazaar.h:306
enum kvz_crypto_features crypto_features
Definition: kvazaar.h:373
int32_t rdo
RD-calculation level (0..2)
Definition: kvazaar.h:313
int32_t input_bitdepth
Use Temporal Motion Vector Predictors.
Definition: kvazaar.h:386
uint8_t * optional_key
Definition: kvazaar.h:374
int32_t sar_width
the horizontal size of the sample aspect ratio (in arbitrary units)
Definition: kvazaar.h:325
int32_t target_bitrate
Definition: kvazaar.h:363
enum kvz_roi_format format
Definition: kvazaar.h:397
int32_t erp_aqp
Use adaptive QP for 360 video with equirectangular projection.
Definition: kvazaar.h:405
int8_t colorprim
Color primaries.
Definition: kvazaar.h:330
uint8_t force_level
Whether we ignore and just warn from all of the errors about the output not conforming to the level's...
Definition: kvazaar.h:410
enum kvz_input_format input_format
Use Temporal Motion Vector Predictors.
Definition: kvazaar.h:385
kvz_gop_config gop[32]
Array of GOP settings.
Definition: kvazaar.h:361
int32_t qp
Quantization parameter.
Definition: kvazaar.h:288
int8_t videoformat
Video format.
Definition: kvazaar.h:328
uint8_t high_tier
Whether we use the high tier bitrates.
Definition: kvazaar.h:412
char * file_path
Definition: kvazaar.h:396
int32_t smp_enable
Flag to enable SMP blocks.
Definition: kvazaar.h:311
int32_t chroma_loc
Chroma sample location.
Definition: kvazaar.h:333
uint16_t fullWidth
Definition: kvazaar.h:451
int8_t fullrange
Flag to indicate full-range.
Definition: kvazaar.h:329
int8_t overscan
Crop overscan setting.
Definition: kvazaar.h:327
int32_t intra_rdo_et
Use early termination in intra rdo.
Definition: kvazaar.h:377
int8_t open_gop
Flag to enable/disable open GOP configuration.
Definition: kvazaar.h:431
int32_t slice_count
Definition: kvazaar.h:347
uint8_t fastrd_sampling_on
whether we're running in normal mode, sampling TBs and their cost for fast estimation training,...
Definition: kvazaar.h:481
struct kvz_config::@13 gop_lp_definition
uint8_t rdo_cost_sampling_mode_on
whether we're sampling TBs and their costs for fast cost estimation training
Definition: kvazaar.h:476
struct kvz_config::@12 pu_depth_intra
uint8_t level
The HEVC level.
Definition: kvazaar.h:408
int8_t fast_residual_cost_limit
Minimum QP that uses CABAC for residual cost instead of a fast estimate.
Definition: kvazaar.h:425
int32_t intra_period
the period of intra frames in stream
Definition: kvazaar.h:289
int32_t sar_height
the vertical size of the sample aspect ratio (in the same arbitrary units as sar_width).
Definition: kvazaar.h:326
enum kvz_cu_split_termination cu_split_termination
Mode of cu split termination.
Definition: kvazaar.h:371
int32_t rdoq_skip
Use Temporal Motion Vector Predictors.
Definition: kvazaar.h:383
int32_t tmvp_enable
Definition: kvazaar.h:381
int8_t set_qp_in_cu
Set QP at CU level keeping pic_init_qp_minus26 in PPS zero.
Definition: kvazaar.h:428
enum kvz_ime_algorithm ime_algorithm
Integer motion estimation algorithm.
Definition: kvazaar.h:317
int32_t add_encoder_info
Definition: kvazaar.h:358
int8_t scaling_list
Enable variance adaptive quantization.
Definition: kvazaar.h:436
uint8_t combine_intra_cus
whether to try combining intra cus at the lower depth when search is not performed at said depth
Definition: kvazaar.h:488
uint32_t max_bitrate
The maximum allowed bitrate for this level and tier.
Definition: kvazaar.h:414
int8_t mv_rdo
MV RDO calculation in search (0: estimation, 1: RDO).
Definition: kvazaar.h:365
int8_t gop_len
length of GOP for the video sequence
Definition: kvazaar.h:359
enum kvz_hash hash
What hash algorithm to use.
Definition: kvazaar.h:369
int32_t signhide_enable
Flag to enable sign hiding.
Definition: kvazaar.h:310
int32_t tiles_width_count
number of tiles separation in x direction
Definition: kvazaar.h:339
int32_t implicit_rdpcm
Enable implicit residual DPCM.
Definition: kvazaar.h:393
char * stats_file_prefix
Definition: kvazaar.h:471
int32_t amp_enable
Flag to enable AMP blocks.
Definition: kvazaar.h:312
unsigned slices
How to map slices to frame.
Definition: kvazaar.h:400
int32_t * tiles_height_split
tiles split y coordinates (dimension: tiles_height_count)
Definition: kvazaar.h:342
int8_t source_scan_type
Source scan type (0: progressive, 1: top field first, 2: bottom field first).
Definition: kvazaar.h:319
int32_t cpuid
Definition: kvazaar.h:351
uint8_t intra_qp_offset_auto
Select intra QP Offset based on GOP length.
Definition: kvazaar.h:422
int32_t lossless
Use lossless coding.
Definition: kvazaar.h:379
char * cqmfile
Pointer to custom quantization matrices filename.
Definition: kvazaar.h:337
char * fastrd_learning_outdir_fn
Definition: kvazaar.h:484
A linked list of chunks of data.
Definition: kvazaar.h:653
uint32_t len
Number of bytes filled in this chunk.
Definition: kvazaar.h:658
uint8_t data[4096]
Buffer for the data.
Definition: kvazaar.h:655
struct kvz_data_chunk * next
Next chunk in the list.
Definition: kvazaar.h:661
Definition: kvazaar_internal.h:51
Other information about an encoded frame.
Definition: kvazaar.h:611
int ref_list_len[2]
Lengths of the reference picture lists.
Definition: kvazaar.h:644
int8_t qp
Quantization parameter.
Definition: kvazaar.h:621
enum kvz_nal_unit_type nal_unit_type
Type of the NAL VCL unit.
Definition: kvazaar.h:626
int32_t poc
Picture order count.
Definition: kvazaar.h:616
int ref_list[2][16]
Reference picture lists.
Definition: kvazaar.h:639
enum kvz_slice_type slice_type
Type of the slice.
Definition: kvazaar.h:631
GoP picture configuration.
Definition: kvazaar.h:265
double qp_model_offset
Definition: kvazaar.h:275
int8_t ref_neg[16]
reference picture offset list
Definition: kvazaar.h:274
int8_t ref_pos[16]
reference picture offset list
Definition: kvazaar.h:272
int8_t is_ref
Flag if this picture is used as a reference.
Definition: kvazaar.h:270
int8_t ref_pos_count
Reference picture count.
Definition: kvazaar.h:271
int8_t layer
Current layer.
Definition: kvazaar.h:269
int8_t qp_offset
QP offset.
Definition: kvazaar.h:267
int8_t poc_offset
POC offset.
Definition: kvazaar.h:268
int8_t ref_neg_count
Reference picture count.
Definition: kvazaar.h:273
double qp_factor
Definition: kvazaar.h:266
double qp_model_scale
Definition: kvazaar.h:276
Struct which contains all picture data.
Definition: kvazaar.h:504
kvz_pixel * fulldata
Allocated buffer portion that's actually used.
Definition: kvazaar.h:506
kvz_pixel * v
Pointer to chroma V pixel array.
Definition: kvazaar.h:510
struct kvz_picture * base_image
Pointer to the picture which owns the pixels.
Definition: kvazaar.h:518
int width
Definition: kvazaar.h:531
int64_t pts
Presentation timestamp. Should be set for input frames.
Definition: kvazaar.h:521
int64_t dts
Decompression timestamp.
Definition: kvazaar.h:522
int32_t ref_pocs[16]
Definition: kvazaar.h:527
int32_t width
Luma pixel array width.
Definition: kvazaar.h:513
int8_t * roi_array
Definition: kvazaar.h:533
kvz_pixel * u
Pointer to chroma U pixel array.
Definition: kvazaar.h:509
int32_t height
Luma pixel array height.
Definition: kvazaar.h:514
kvz_pixel * fulldata_buf
Allocated buffer with padding (only used in the base_image)
Definition: kvazaar.h:505
int height
Definition: kvazaar.h:532
enum kvz_chroma_format chroma_format
Definition: kvazaar.h:525
int32_t refcount
Number of references to the picture.
Definition: kvazaar.h:519
kvz_pixel * data[3]
Alternate access method to same data.
Definition: kvazaar.h:511
kvz_pixel * y
Pointer to luma pixel array.
Definition: kvazaar.h:508
enum kvz_interlacing interlacing
Field order for interlaced pictures.
Definition: kvazaar.h:524
int32_t stride
Luma pixel array width for the full picture (should be used as stride)
Definition: kvazaar.h:516
struct kvz_picture::@16 roi