libxcoder 5.6.0
Loading...
Searching...
No Matches
ni_av_codec.h
Go to the documentation of this file.
1/*******************************************************************************
2 *
3 * Copyright (C) 2022 NETINT Technologies
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18 * SOFTWARE.
19 *
20 ******************************************************************************/
21
22/*!*****************************************************************************
23 * \file ni_av_codec.h
24 *
25 * \brief Audio/video related utility definitions
26 ******************************************************************************/
27
28#pragma once
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "ni_device_api.h"
35
36// libxcoder API related definitions
37
38#define NI_NUM_PIXEL_ASPECT_RATIO 17
39#define NI_NAL_VPS_BIT (0x01)
40#define NI_NAL_SPS_BIT (0x01 << 1)
41#define NI_NAL_PPS_BIT (0x01 << 2)
42#define NI_GENERATE_ALL_NAL_HEADER_BIT (0x01 << 3)
43static const ni_rational_t
44 ni_h264_pixel_aspect_list[NI_NUM_PIXEL_ASPECT_RATIO] = {
45 {0, 1}, {1, 1}, {12, 11}, {10, 11}, {16, 11}, {40, 33},
46 {24, 11}, {20, 11}, {32, 11}, {80, 33}, {18, 11}, {15, 11},
47 {64, 33}, {160, 99}, {4, 3}, {3, 2}, {2, 1},
48};
49
50#define NI_SEI_TYPE_PPU_RECONFIG 206
52{
53 NI_H264_SEI_TYPE_BUFFERING_PERIOD = 0, // buffering period (H.264, D.1.1)
54 NI_H264_SEI_TYPE_PIC_TIMING = 1, // picture timing
55 NI_H264_SEI_TYPE_PAN_SCAN_RECT = 2, // pan-scan rectangle
58 4, // registered user data as specified by Rec. ITU-T T.35
59 NI_H264_SEI_TYPE_USER_DATA_UNREGISTERED = 5, // unregistered user data
61 6, // recovery point (frame # to decoder sync)
62 NI_H264_SEI_TYPE_FRAME_PACKING = 45, // frame packing arrangement
63 NI_H264_SEI_TYPE_DISPLAY_ORIENTATION = 47, // display orientation
64 NI_H264_SEI_TYPE_GREEN_METADATA = 56, // GreenMPEG information
66 137, // mastering display properties
67 NI_H264_SEI_TYPE_ALTERNATIVE_TRANSFER = 147, // alternative transfer
69
91
118
122{
124 NI_COL_TRC_BT709 = 1, //< also ITU-R BT1361
128 4, //< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
129 NI_COL_TRC_GAMMA28 = 5, //< also ITU-R BT470BG
131 6, //< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
133 NI_COL_TRC_LINEAR = 8, //< "Linear transfer characteristics"
135 9, //< "Logarithmic transfer characteristic (100:1 range)"
137 10, //< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
138 NI_COL_TRC_IEC61966_2_4 = 11, //< IEC 61966-2-4
139 NI_COL_TRC_BT1361_ECG = 12, //< ITU-R BT1361 Extended Colour Gamut
140 NI_COL_TRC_IEC61966_2_1 = 13, //< IEC 61966-2-1 (sRGB or sYCC)
141 NI_COL_TRC_BT2020_10 = 14, //< ITU-R BT2020 for 10-bit system
142 NI_COL_TRC_BT2020_12 = 15, //< ITU-R BT2020 for 12-bit system
144 16, //< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems
146 NI_COL_TRC_SMPTE428 = 17, //< SMPTE ST 428-1
149 18, //< ARIB STD-B67, known as "Hybrid log-gamma"
150 NI_COL_TRC_NB //< Not part of ABI
152
155typedef enum _ni_color_space
156{
158 0, //< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
160 1, //< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
164 4, //< FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
166 5, //< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
168 6, //< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
169 NI_COL_SPC_SMPTE240M = 7, //< functionally identical to above
171 8, //< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
173 NI_COL_SPC_BT2020_NCL = 9, //< ITU-R BT2020 non-constant luminance system
174 NI_COL_SPC_BT2020_CL = 10, //< ITU-R BT2020 constant luminance system
175 NI_COL_SPC_SMPTE2085 = 11, //< SMPTE 2085, Y'D'zD'x
177 12, //< Chromaticity-derived non-constant luminance system
179 13, //< Chromaticity-derived constant luminance system
180 NI_COL_SPC_ICTCP = 14, //< ITU-R BT.2100-0, ICtCp
181 NI_COL_SPC_NB //< Not part of ABI
183
194
195// struct describing HDR10 mastering display metadata
197{
198 // CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
200
201 // CIE 1931 xy chromaticity coords of white point.
203
204 // Min luminance of mastering display (cd/m^2).
206
207 // Max luminance of mastering display (cd/m^2).
209
210 // Flag indicating whether the display primaries (and white point) are set.
212
213 // Flag indicating whether the luminance (min_ and max_) have been set.
216
217#define MASTERING_DISP_CHROMA_DEN 50000 //denominator value to have 0.00002 units
218#define MASTERING_DISP_LUMA_DEN 10000 //denominator value to have 0.0001 units
219
220// struct describing HDR10 Content light level
222{
223 // Max content light level (cd/m^2).
224 uint16_t max_cll;
225
226 // Max average light level per frame (cd/m^2).
227 uint16_t max_fall;
229
230// struct and enum for HDR10+
231// Option for overlapping elliptical pixel selectors in an image.
237
238// struct that represents the percentile at a specific percentage in
239// a distribution.
241{
242 // The percentage value corresponding to a specific percentile linearized
243 // RGB value in the processing window in the scene. The value shall be in
244 // the range of 0 to 100, inclusive.
245 uint8_t percentage;
246
247 // The linearized maxRGB value at a specific percentile in the processing
248 // window in the scene. The value shall be in the range of 0 to 1, inclusive
249 // and in multiples of 0.00001.
252
253// struct describing color transform parameters at a processing window in a
254// dynamic metadata for SMPTE 2094-40.
256{
257 // The relative x coordinate of the top left pixel of the processing
258 // window. The value shall be in the range of 0 and 1, inclusive and
259 // in multiples of 1/(width of Picture - 1). The value 1 corresponds
260 // to the absolute coordinate of width of Picture - 1. The value for
261 // first processing window shall be 0.
263
264 // The relative y coordinate of the top left pixel of the processing
265 // window. The value shall be in the range of 0 and 1, inclusive and
266 // in multiples of 1/(height of Picture - 1). The value 1 corresponds
267 // to the absolute coordinate of height of Picture - 1. The value for
268 // first processing window shall be 0.
270
271 // The relative x coordinate of the bottom right pixel of the processing
272 // window. The value shall be in the range of 0 and 1, inclusive and
273 // in multiples of 1/(width of Picture - 1). The value 1 corresponds
274 // to the absolute coordinate of width of Picture - 1. The value for
275 // first processing window shall be 1.
277
278 // The relative y coordinate of the bottom right pixel of the processing
279 // window. The value shall be in the range of 0 and 1, inclusive and
280 // in multiples of 1/(height of Picture - 1). The value 1 corresponds
281 // to the absolute coordinate of height of Picture - 1. The value for
282 // first processing window shall be 1.
284
285 // The x coordinate of the center position of the concentric internal and
286 // external ellipses of the elliptical pixel selector in the processing
287 // window. The value shall be in the range of 0 to (width of Picture - 1),
288 // inclusive and in multiples of 1 pixel.
290
291 // The y coordinate of the center position of the concentric internal and
292 // external ellipses of the elliptical pixel selector in the processing
293 // window. The value shall be in the range of 0 to (height of Picture - 1),
294 // inclusive and in multiples of 1 pixel.
296
297 // The clockwise rotation angle in degree of arc with respect to the
298 // positive direction of the x-axis of the concentric internal and external
299 // ellipses of the elliptical pixel selector in the processing window. The
300 // value shall be in the range of 0 to 180, inclusive and in multiples of
301 // 1.
303
304 // The semi-major axis value of the internal ellipse of the elliptical
305 // pixel selector in amount of pixels in the processing window. The value
306 // shall be in the range of 1 to 65535, inclusive and in multiples of 1
307 // pixel.
309
310 // The semi-major axis value of the external ellipse of the elliptical
311 // pixel selector in amount of pixels in the processing window. The value
312 // shall not be less than semimajor_axis_internal_ellipse of the current
313 // processing window. The value shall be in the range of 1 to 65535,
314 // inclusive and in multiples of 1 pixel.
316
317 // The semi-minor axis value of the external ellipse of the elliptical
318 // pixel selector in amount of pixels in the processing window. The value
319 // shall be in the range of 1 to 65535, inclusive and in multiples of 1
320 // pixel.
322
323 // Overlap process option indicates one of the two methods of combining
324 // rendered pixels in the processing window in an image with at least one
325 // elliptical pixel selector. For overlapping elliptical pixel selectors
326 // in an image, overlap_process_option shall have the same value.
328
329 // The maximum of the color components of linearized RGB values in the
330 // processing window in the scene. The values should be in the range of 0
331 // to 1, inclusive and in multiples of 0.00001. maxscl[ 0 ], maxscl[ 1 ],
332 // and maxscl[ 2 ] are corresponding to R, G, B color components
333 // respectively.
335
336 // The average of linearized maxRGB values in the processing window in the
337 // scene. The value should be in the range of 0 to 1, inclusive and in
338 // multiples of 0.00001.
340
341 // The number of linearized maxRGB values at given percentiles in the
342 // processing window in the scene. The maximum value shall be 15.
344
345 // The linearized maxRGB values at given percentiles in the
346 // processing window in the scene.
348
349 // The fraction of selected pixels in the image that contains the brightest
350 // pixel in the scene. The value shall be in the range of 0 to 1, inclusive
351 // and in multiples of 0.001.
353
354 // This flag indicates that the metadata for the tone mapping function in
355 // the processing window is present (for value of 1).
357
358 // The x coordinate of the separation point between the linear part and the
359 // curved part of the tone mapping function. The value shall be in the
360 // range of 0 to 1, excluding 0 and in multiples of 1/4095.
362
363 // The y coordinate of the separation point between the linear part and the
364 // curved part of the tone mapping function. The value shall be in the
365 // range of 0 to 1, excluding 0 and in multiples of 1/4095.
367
368 // The number of the intermediate anchor parameters of the tone mapping
369 // function in the processing window. The maximum value shall be 15.
371
372 // The intermediate anchor parameters of the tone mapping function in the
373 // processing window in the scene. The values should be in the range of 0
374 // to 1, inclusive and in multiples of 1/1023.
376
377 // This flag shall be equal to 0 in bitstreams conforming to this version
378 // of this Specification. Other values are reserved for future use.
380
381 // The color saturation gain in the processing window in the scene. The
382 // value shall be in the range of 0 to 63/8, inclusive and in multiples of
383 // 1/8. The default value shall be 1.
386
387// struct representing dynamic metadata for color volume transform -
388// application 4 of SMPTE 2094-40:2016 standard.
390{
391 // Country code by Rec. ITU-T T.35 Annex A. The value shall be 0xB5.
393
394 // Application version in the application defining document in ST-2094
395 // suite. The value shall be set to 0.
397
398 // The number of processing windows. The value shall be in the range
399 // of 1 to 3, inclusive.
400 uint8_t num_windows;
401
402 // The color transform parameters for every processing window.
404
405 // The nominal maximum display luminance of the targeted system display,
406 // in units of 0.0001 candelas per square metre. The value shall be in
407 // the range of 0 to 10000, inclusive.
409
410 // This flag shall be equal to 0 in bit streams conforming to this version
411 // of this Specification. The value 1 is reserved for future use.
413
414 // The number of rows in the targeted system_display_actual_peak_luminance
415 // array. The value shall be in the range of 2 to 25, inclusive.
417
418 // The number of columns in the
419 // targeted_system_display_actual_peak_luminance array. The value shall be
420 // in the range of 2 to 25, inclusive.
422
423 // The normalized actual peak luminance of the targeted system display. The
424 // values should be in the range of 0 to 1, inclusive and in multiples of
425 // 1/15.
427
428 // This flag shall be equal to 0 in bitstreams conforming to this version
429 // of this Specification. The value 1 is reserved for future use.
431
432 // The number of rows in the mastering_display_actual_peak_luminance array.
433 // The value shall be in the range of 2 to 25, inclusive.
435
436 // The number of columns in the mastering_display_actual_peak_luminance
437 // array. The value shall be in the range of 2 to 25, inclusive.
439
440 // The normalized actual peak luminance of the mastering display used for
441 // mastering the image essence. The values should be in the range of 0 to
442 // 1, inclusive and in multiples of 1/15.
445
446// All the fields in the following struct follow the same names and definition
447// as set out by the H264/H265 specifications
448typedef struct _ni_timecode
449{
455 uint16_t n_frames;
456 uint8_t seconds_flag; // ignored when full_timestamp_flag is set
458 uint8_t minutes_flag; // ignored when full_timestamp_flag is set
460 uint8_t hours_flag; // ignored when full_timestamp_flag is set
461 uint8_t hours_value;
465
466/*!*****************************************************************************
467 * \brief Whether SEI should be sent together with this frame to encoder
468 *
469 * \param[in] p_enc_ctx encoder session context
470 * \param[in] pic_type frame type
471 * \param[in] p_param encoder parameters
472 *
473 * \return 1 if yes, 0 otherwise
474 ******************************************************************************/
476 ni_pic_type_t pic_type,
477 ni_xcoder_params_t *p_param);
478
479/*!*****************************************************************************
480 * \brief Retrieve auxiliary data (close caption, various SEI) associated with
481 * this frame that is returned by decoder, convert them to appropriate
482 * format and save them in the frame's auxiliary data storage for
483 * future use by encoding. Usually they would be sent together with
484 * this frame to encoder at encoding.
485 *
486 * \param[in/out] frame that is returned by decoder
487 *
488 * \return NONE
489 ******************************************************************************/
491
492/*!*****************************************************************************
493 * \brief Prepare auxiliary data that should be sent together with this frame
494 * to encoder based on the auxiliary data of the decoded frame.
495 *
496 * \param[in/out] p_enc_ctx encoder session context whose various SEI type
497 * header can be updated as the result of this function
498 * \param[out] p_enc_frame frame to be sent to encoder
499 * \param[in] p_dec_frame frame that is returned by decoder
500 * \param[in] codec_format H.264 or H.265
501 * \param[in] should_send_sei_with_frame if need to send a certain type of
502 * SEI with this frame
503 * \param[out] mdcv_data SEI for HDR mastering display color volume info
504 * \param[out] cll_data SEI for HDR content light level info
505 * \param[out] cc_data SEI for close caption
506 * \param[out] udu_data SEI for User data unregistered
507 * \param[out] hdrp_data SEI for HDR10+
508 *
509 * \return NONE
510 ******************************************************************************/
511LIB_API void
513 ni_frame_t *p_dec_frame, ni_codec_format_t codec_format,
514 int should_send_sei_with_frame, uint8_t *mdcv_data,
515 uint8_t *cll_data, uint8_t *cc_data, uint8_t *udu_data,
516 uint8_t *hdrp_data);
517
518/*!*****************************************************************************
519 * \brief Copy auxiliary data that should be sent together with this frame
520 * to encoder.
521 *
522 * \param[in] p_enc_ctx encoder session context
523 * \param[out] p_enc_frame frame to be sent to encoder
524 * \param[in] p_dec_frame frame returned by decoder
525 * \param[in] codec_format H.264 or H.265
526 * \param[in] mdcv_data SEI for HDR mastering display color volume info
527 * \param[in] cll_data SEI for HDR content light level info
528 * \param[in] cc_data SEI for close caption
529 * \param[in] udu_data SEI for User data unregistered
530 * \param[in] hdrp_data SEI for HDR10+
531 * \param[in] is_hwframe, must be 0 (sw frame) or 1 (hw frame)
532 * \param[in] is_semiplanar, must be 1 (semiplanar frame) or 0 (not)
533 *
534 * \return NONE
535 ******************************************************************************/
536LIB_API void
538 ni_frame_t *p_dec_frame, ni_codec_format_t codec_format,
539 const uint8_t *mdcv_data, const uint8_t *cll_data,
540 const uint8_t *cc_data, const uint8_t *udu_data,
541 const uint8_t *hdrp_data, int is_hwframe,
542 int is_semiplanar);
543
544/*!*****************************************************************************
545 * \brief Insert timecode data into picture timing SEI (H264) or time code SEI (H265)
546 *
547 * \note This function must be callled after all other aux data has been processed by
548 * ni_enc_prep_aux_data and ni_enc_copy_aux_data. Otherwise the timecode SEI data
549 * might be overwritten
550 *
551 * \param[in] p_enc_ctx encoder session context
552 * \param[out] p_enc_frame frame to be sent to encoder
553 * \param[in] p_timecode the timecode data to be written along with the frame
554 *
555 * \return NI_RETCODE_SUCCESS on success, NI_RETCODE_FAILURE on failure
556 ******************************************************************************/
558 ni_timecode_t *p_timecode);
559
560/*!*****************************************************************************
561 * \brief Send an input data frame to the encoder with YUV data given in
562 * the inputs.
563 *
564 * For ideal performance memory should be 4k aligned. If it is not 4K aligned
565 * then a temporary 4k aligned memory will be used to copy data to and from
566 * when writing and reading. This will negatively impact performance.
567 *
568 * Any metadata to be sent with the frame should be attached to p_enc_frame
569 * as aux data (e.g. using ni_frame_new_aux_data()).
570 *
571 * \param[in] p_ctx Encoder session context
572 * \param[in] p_enc_frame Struct holding information about the frame
573 * to be sent to the encoder
574 * \param[in] p_yuv_buffer Caller allocated buffer holding YUV data
575 * for the frame
576 *
577 * \return On success
578 * Total number of bytes written
579 * On failure
580 * NI_RETCODE_INVALID_PARAM
581 * NI_RETCODE_ERROR_MEM_ALOC
582 * NI_RETCODE_ERROR_NVME_CMD_FAILED
583 * NI_RETCODE_ERROR_INVALID_SESSION
584 *****************************************************************************/
586 ni_frame_t *p_enc_frame,
587 uint8_t *p_yuv_buffer);
588
589/*!******************************************************************************
590 * \brief Extract custom sei payload data from pkt_data,
591 * and save it to ni_packet_t
592 *
593 * \param uint8_t *pkt_data - FFmpeg AVPacket data
594 * \param int pkt_size - packet size
595 * \param long index - pkt data index of custom sei first byte after SEI type
596 * \param ni_packet_t *p_packet - libxcoder internal packet
597 * \param uint8_t sei_type - type of SEI
598 * \param int vcl_found - whether got vcl in the pkt data, 1 means got
599 *
600 * \return - 0 on success, non-0 on failure
601 ********************************************************************************/
602LIB_API int ni_extract_custom_sei(uint8_t *pkt_data, int pkt_size, long index,
603 ni_packet_t *p_packet, uint8_t sei_type, int vcl_found);
604
605/*!******************************************************************************
606 * \brief Decode parse packet
607 *
608 * \param[in] p_session_ctx Pointer to a caller allocated
609 * ni_session_context_t struct
610 * \param[in] p_param Pointer to a caller allocated
611 * ni_xcoder_params_t struct
612 * \param[in] *data FFmpeg AVPacket data
613 * \param[in] size packet size
614 * \param[in] p_packet Pointer to a caller allocated
615 * ni_packet_t struct
616 * \param[in] low_delay FFmpeg lowdelay
617 * \param[in] codec_format enum ni_codec_format_t
618 * \param[in] pkt_nal_bitmap pkt_nal_bitmap
619 * \param[in] custom_sei_type custom_sei_type
620 * \param[in] *svct_skip_next_packet svct_skip_next_packet int*
621 * \param[in] *is_lone_sei_pkt is_lone_sei_pkt int*
622 *
623 * \return - 0 on success, non-0 on failure
624 ********************************************************************************/
626 ni_xcoder_params_t *p_param, uint8_t *data, int size,
627 ni_packet_t *p_packet, int low_delay, int codec_format,
628 int pkt_nal_bitmap, int custom_sei_type,
629 int *svct_skip_next_packet, int *is_lone_sei_pkt);
630
631/*!******************************************************************************
632 * \brief Expand frame form src frame
633 *
634 * \param[in] dst Pointer to a caller allocated ni_frame_t struct
635 * \param[in] src Pointer to a caller allocated ni_frame_t struct
636 * \param[in] dst_stride int dst_stride[]
637 * \param[in] raw_width frame width
638 * \param[in] raw_height frame height
639 * \param[in] ni_fmt ni_pix_fmt_t type for ni pix_fmt
640 * \param[in] nb_planes int nb_planes
641 *
642 * \return - 0 on success, NI_RETCODE_FAILURE on failure
643 ********************************************************************************/
644LIB_API int ni_expand_frame(ni_frame_t *dst, ni_frame_t *src, int dst_stride[],
645 int raw_width, int raw_height, int ni_fmt, int nb_planes);
646
647/*!******************************************************************************
648 * \brief Reset decoder ppu resolution
649 *
650 * \param[in] p_session_ctx Pointer to a caller allocated
651 * ni_session_context_t struct
652 * \param[in] p_param Pointer to a caller allocated
653 * ni_xcoder_params_t struct
654 * \param[in] ppu_config Pointer to a caller allocated
655 * ni_ppu_config_t struct
656 *
657 * \return - 0 on success, NI_RETCODE_FAILURE on failure
658 ********************************************************************************/
660 ni_xcoder_params_t *p_param, ni_ppu_config_t *ppu_config);
661#ifdef __cplusplus
662}
663#endif
_ni_color_transfer_characteristic
@ NI_COL_TRC_RESERVED0
@ NI_COL_TRC_SMPTE428
@ NI_COL_TRC_UNSPECIFIED
@ NI_COL_TRC_NB
@ NI_COL_TRC_BT1361_ECG
@ NI_COL_TRC_BT2020_12
@ NI_COL_TRC_IEC61966_2_4
@ NI_COL_TRC_SMPTEST2084
@ NI_COL_TRC_IEC61966_2_1
@ NI_COL_TRC_SMPTE2084
@ NI_COL_TRC_LOG_SQRT
@ NI_COL_TRC_SMPTEST428_1
@ NI_COL_TRC_BT2020_10
@ NI_COL_TRC_BT709
@ NI_COL_TRC_SMPTE170M
@ NI_COL_TRC_RESERVED
@ NI_COL_TRC_ARIB_STD_B67
@ NI_COL_TRC_SMPTE240M
@ NI_COL_TRC_LINEAR
@ NI_COL_TRC_LOG
@ NI_COL_TRC_GAMMA28
@ NI_COL_TRC_GAMMA22
LIB_API int ni_should_send_sei_with_frame(ni_session_context_t *p_enc_ctx, ni_pic_type_t pic_type, ni_xcoder_params_t *p_param)
Whether SEI should be sent together with this frame to encoder.
struct _ni_hrd_params ni_hrd_params_t
enum _ni_color_primaries ni_color_primaries_t
_ni_color_space
@ NI_COL_SPC_BT470BG
@ NI_COL_SPC_YCOCG
@ NI_COL_SPC_SMPTE240M
@ NI_COL_SPC_ICTCP
@ NI_COL_SPC_SMPTE170M
@ NI_COL_SPC_YCGCO
@ NI_COL_SPC_RESERVED
@ NI_COL_SPC_FCC
@ NI_COL_SPC_CHROMA_DERIVED_CL
@ NI_COL_SPC_NB
@ NI_COL_SPC_BT2020_NCL
@ NI_COL_SPC_SMPTE2085
@ NI_COL_SPC_CHROMA_DERIVED_NCL
@ NI_COL_SPC_UNSPECIFIED
@ NI_COL_SPC_BT709
@ NI_COL_SPC_RGB
@ NI_COL_SPC_BT2020_CL
LIB_API void ni_enc_prep_aux_data(ni_session_context_t *p_enc_ctx, ni_frame_t *p_enc_frame, ni_frame_t *p_dec_frame, ni_codec_format_t codec_format, int should_send_sei_with_frame, uint8_t *mdcv_data, uint8_t *cll_data, uint8_t *cc_data, uint8_t *udu_data, uint8_t *hdrp_data)
Prepare auxiliary data that should be sent together with this frame to encoder based on the auxiliary...
_ni_color_primaries
Definition ni_av_codec.h:95
@ NI_COL_PRI_SMPTE432
@ NI_COL_PRI_RESERVED0
Definition ni_av_codec.h:96
@ NI_COL_PRI_SMPTE240M
functionally identical to above
@ NI_COL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
@ NI_COL_PRI_JEDEC_P22
JEDEC P22 phosphors.
@ NI_COL_PRI_NB
Not part of ABI.
@ NI_COL_PRI_FILM
colour filters using Illuminant C
@ NI_COL_PRI_BT470BG
@ NI_COL_PRI_UNSPECIFIED
Definition ni_av_codec.h:99
@ NI_COL_PRI_SMPTE428
SMPTE ST 428-1 (CIE 1931 XYZ)
@ NI_COL_PRI_RESERVED
@ NI_COL_PRI_BT709
Definition ni_av_codec.h:97
@ NI_COL_PRI_BT470M
@ NI_COL_PRI_BT2020
ITU-R BT2020.
@ NI_COL_PRI_SMPTE170M
@ NI_COL_PRI_SMPTEST428_1
LIB_API int ni_reconfig_ppu_output(ni_session_context_t *p_session_ctx, ni_xcoder_params_t *p_param, ni_ppu_config_t *ppu_config)
Reset decoder ppu resolution.
LIB_API void ni_enc_copy_aux_data(ni_session_context_t *p_enc_ctx, ni_frame_t *p_enc_frame, ni_frame_t *p_dec_frame, ni_codec_format_t codec_format, const uint8_t *mdcv_data, const uint8_t *cll_data, const uint8_t *cc_data, const uint8_t *udu_data, const uint8_t *hdrp_data, int is_hwframe, int is_semiplanar)
Copy auxiliary data that should be sent together with this frame to encoder.
enum _ni_color_transfer_characteristic ni_color_transfer_characteristic_t
#define NI_NUM_PIXEL_ASPECT_RATIO
Definition ni_av_codec.h:38
LIB_API int ni_dec_packet_parse(ni_session_context_t *p_session_ctx, ni_xcoder_params_t *p_param, uint8_t *data, int size, ni_packet_t *p_packet, int low_delay, int codec_format, int pkt_nal_bitmap, int custom_sei_type, int *svct_skip_next_packet, int *is_lone_sei_pkt)
Decode parse packet.
enum _ni_hdr_plus_overlap_process_option ni_hdr_plus_overlap_process_option_t
struct _ni_hdr_plus_percentile ni_hdr_plus_percentile_t
struct _ni_hdr_plus_color_transform_params ni_hdr_plus_color_transform_params_t
LIB_API void ni_dec_retrieve_aux_data(ni_frame_t *frame)
Retrieve auxiliary data (close caption, various SEI) associated with this frame that is returned by d...
enum _ni_color_space ni_color_space_t
struct _ni_content_light_level ni_content_light_level_t
LIB_API int ni_extract_custom_sei(uint8_t *pkt_data, int pkt_size, long index, ni_packet_t *p_packet, uint8_t sei_type, int vcl_found)
Extract custom sei payload data from pkt_data, and save it to ni_packet_t.
LIB_API int ni_enc_write_from_yuv_buffer(ni_session_context_t *p_ctx, ni_frame_t *p_enc_frame, uint8_t *p_yuv_buffer)
Send an input data frame to the encoder with YUV data given in the inputs.
_ni_h264_sei_pic_struct_t
Definition ni_av_codec.h:72
@ NI_H264_SEI_PIC_STRUCT_FRAME_TRIPLING
frame tripling
Definition ni_av_codec.h:89
@ NI_H264_SEI_PIC_STRUCT_TOP_BOTTOM
Definition ni_av_codec.h:76
@ NI_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP
Definition ni_av_codec.h:80
@ NI_H264_SEI_PIC_STRUCT_FRAME
frame
Definition ni_av_codec.h:73
@ NI_H264_SEI_PIC_STRUCT_BOTTOM_FIELD
bottom field
Definition ni_av_codec.h:75
@ NI_H264_SEI_PIC_STRUCT_BOTTOM_TOP
Definition ni_av_codec.h:78
@ NI_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM
Definition ni_av_codec.h:84
@ NI_H264_SEI_PIC_STRUCT_TOP_FIELD
top field
Definition ni_av_codec.h:74
@ NI_H264_SEI_PIC_STRUCT_FRAME_DOUBLING
frame doubling
Definition ni_av_codec.h:88
struct _ni_dynamic_hdr_plus ni_dynamic_hdr_plus_t
LIB_API int ni_enc_insert_timecode(ni_session_context_t *p_enc_ctx, ni_frame_t *p_enc_frame, ni_timecode_t *p_timecode)
Insert timecode data into picture timing SEI (H264) or time code SEI (H265)
struct _ni_mastering_display_metadata ni_mastering_display_metadata_t
_ni_h264_sei_type_t
Definition ni_av_codec.h:52
@ NI_H264_SEI_TYPE_FRAME_PACKING
Definition ni_av_codec.h:62
@ NI_H264_SEI_TYPE_FILLER_PAYLOAD
Definition ni_av_codec.h:56
@ NI_H264_SEI_TYPE_USER_DATA_REGISTERED
Definition ni_av_codec.h:57
@ NI_H264_SEI_TYPE_ALTERNATIVE_TRANSFER
Definition ni_av_codec.h:67
@ NI_H264_SEI_TYPE_PAN_SCAN_RECT
Definition ni_av_codec.h:55
@ NI_H264_SEI_TYPE_DISPLAY_ORIENTATION
Definition ni_av_codec.h:63
@ NI_H264_SEI_TYPE_PIC_TIMING
Definition ni_av_codec.h:54
@ NI_H264_SEI_TYPE_GREEN_METADATA
Definition ni_av_codec.h:64
@ NI_H264_SEI_TYPE_USER_DATA_UNREGISTERED
Definition ni_av_codec.h:59
@ NI_H264_SEI_TYPE_BUFFERING_PERIOD
Definition ni_av_codec.h:53
@ NI_H264_SEI_TYPE_RECOVERY_POINT
Definition ni_av_codec.h:60
@ NI_H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
Definition ni_av_codec.h:65
LIB_API int ni_expand_frame(ni_frame_t *dst, ni_frame_t *src, int dst_stride[], int raw_width, int raw_height, int ni_fmt, int nb_planes)
Expand frame form src frame.
enum _ni_h264_sei_type_t ni_h264_sei_type_t
struct _ni_timecode ni_timecode_t
enum _ni_h264_sei_pic_struct_t ni_h264_sei_pic_struct_t
_ni_hdr_plus_overlap_process_option
@ NI_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING
@ NI_HDR_PLUS_OVERLAP_PROCESS_LAYERING
Public definitions for operating NETINT video processing devices for video processing.
enum _ni_codec_format ni_codec_format_t
This is an enumeration for supported codec formats.
ni_pic_type_t
uint8_t targeted_system_display_actual_peak_luminance_flag
uint8_t num_cols_targeted_system_display_actual_peak_luminance
uint8_t num_rows_mastering_display_actual_peak_luminance
uint8_t num_rows_targeted_system_display_actual_peak_luminance
uint8_t num_cols_mastering_display_actual_peak_luminance
ni_rational_t targeted_system_display_maximum_luminance
ni_rational_t mastering_display_actual_peak_luminance[25][25]
uint8_t itu_t_t35_country_code
uint8_t mastering_display_actual_peak_luminance_flag
ni_hdr_plus_color_transform_params_t params[3]
ni_rational_t targeted_system_display_actual_peak_luminance[25][25]
ni_hdr_plus_percentile_t distribution_maxrgb[15]
ni_hdr_plus_overlap_process_option_t overlap_process_option
ni_rational_t percentile
int64_t bit_rate_unscale
int64_t cpb_size_unscale
uint32_t initial_cpb_removal_delay_length_minus1
uint32_t au_cpb_removal_delay_minus1
uint32_t dpb_output_delay_length_minus1
uint32_t au_cpb_removal_delay_length_minus1
ni_rational_t display_primaries[3][2]
uint8_t minutes_value
uint32_t time_offset_value
uint8_t counting_type
uint8_t hours_flag
uint16_t n_frames
uint8_t minutes_flag
uint8_t hours_value
uint8_t full_timestamp_flag
uint8_t nuit_field_based_flag
uint8_t time_offset_length
uint8_t seconds_flag
uint8_t discontinuity_flag
uint8_t seconds_value
uint8_t cnt_dropped_flag