libxcoder  3.5.1
ni_device_api_priv_logan.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  *
24  * \file ni_device_api_priv_logan.h
25  *
26  * @date April 1, 2018
27  *
28  * \brief Private definitions used by main ni_device_api_logan file
29  *
30  * @author
31  *
32  ******************************************************************************/
33 
34 #pragma once
35 
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41 
42 #include "ni_defs_logan.h"
43 
44 typedef enum
45 {
49 
50 typedef enum
51 {
57 
58 // mapping of a subset of NI_LOGAN_RETCODE_NVME_SC_* of ni_logan_retcode_t, returned by
59 // fw in regular i/o environment.
61 {
63  ni_logan_xcoder_request_pending = 1, // NVME SC 0x305
64  ni_logan_xcoder_resource_recovery = 0xFFFD, // NVME SC 0x3FD
65  ni_logan_xcoder_resource_insufficient = 0xFFFE, // NVME SC 0x3FE
66  ni_logan_xcoder_general_error = 0xFFFF, // NVME SC 0x3FF
68 
70 {
71  uint8_t ui8Enable;
72  uint8_t ui8HWAccess;
73  union
74  {
75  uint16_t ui16ReadFrameId;
76  uint16_t ui16WriteFrameId;
79 
81 {
82  uint8_t active_sub_instances_cnt; // Number of active sub-instance in that instance
83  uint8_t process_load_percent; // Processing load in percentage
84  uint8_t error_count;
85  uint8_t fatal_error;
86  uint32_t fw_model_load;
87  uint8_t cmd_queue_count;
91 
93  uint8_t ui8VpuCoreError;
94  uint8_t ui8VpuInstId;
97  uint32_t ui32DataPktSize;
98  uint32_t ui32VpuInstError;
99  uint32_t ui32BufferAddr;
100  uint32_t ui32BufferWrPt;
101  uint32_t ui32BufferRdPt;
102  uint32_t ui32BufferSize;
103  uint32_t ui32Reserved;
104 } ni_logan_instance_debugInfo_t; // 32 bytes (Has to be 8 byte aligned)
105 
107 {
108  uint16_t picture_width; // Picture Width
109  uint16_t picture_height; // Picture Height
110  uint16_t transfer_frame_stride; // Transfer Frame Stride
111  uint16_t transfer_frame_height; // Transfer Frame Height(Not VPU Frame Height)
112  uint16_t frame_rate; // Sequence Frame Rate
113  uint16_t is_flushed; // Is decoder/encoder flushed or still has data to process
114  uint16_t reorder_delay; // decoder reorder delay
115  uint16_t reserved;
117 
119 {
120  uint16_t is_flushed; // Is decoder/encoder flushed or still has data to process
121  uint16_t data_bytes_available; // How much data is available to read/write
123 
125 {
126  uint32_t session_id;
128 
130 {
131  uint32_t codec_format;
132  int32_t i32picWidth; /*!*< The width of a picture to be encoded in unit of sample. */
133  int32_t i32picHeight; /*!*< The height of a picture to be encoded in unit of sample. */
134  uint32_t model_load;
135  uint32_t EncoderReadSyncQuery; // In low latency mode, encoder read packet will just send query command one time
136  uint32_t hw_desc_mode; // hw action mode
137  uint32_t set_high_priority; //set high priory to FW
139 
141 {
142  uint32_t codec_format;
143  uint32_t model_load;
144  uint32_t low_delay_mode;
145  uint32_t hw_desc_mode; // hw action mode
146  uint32_t set_high_priority; //set high priory to FW
147  uint32_t reserved[1];
149 
151 {
152  uint32_t session_closed;
154 
156 {
157  uint32_t packet_size; // encoder packet actual size
159 
161 {
162  int16_t inst_id; // hardware instance ID
163  int16_t frame_index; // hardware frame index,
164  // -3: default invalid value
165  // -5: meta data index
166  uint32_t hw_address;
168 
170 {
171  union
172  {
173  uint32_t buf_avail_size; // available size of space/data for write/read
175  };
177 
179 {
180  uint16_t force_picture_type; //flag to force the pic type
181  uint16_t data_format; // In Env write this is usually set to NI_LOGAN_DATA_FORMAT_YUV_FRAME
182  uint16_t picture_type; // This is set to either XCODER_PIC_TYPE_I or XCODER_PIC_TYPE_CRA or XCODER_PIC_TYPE_IDR
183  uint16_t video_width;
184  uint16_t video_height;
185  uint32_t timestamp;
187 
188 // 24 bytes
190 {
191  uint16_t crop_left;
192  uint16_t crop_right;
193  uint16_t crop_top;
194  uint16_t crop_bottom;
195  union
196  {
197  uint64_t frame_offset;
198  uint64_t frame_tstamp;
200  uint16_t frame_width;
201  uint16_t frame_height;
202  uint16_t frame_type;
203  uint16_t bit_depth;
205 
206 // 64 bytes
208 {
210  uint32_t sei_header;
211  uint16_t sei_number;
212  uint16_t sei_size;
213  uint32_t frame_cycle;
215  uint16_t reserved;
218 
219 // 64 bytes
221 {
230  uint16_t force_pic_qp_i;
231  uint16_t force_pic_qp_p;
232  uint16_t force_pic_qp_b;
233  uint16_t force_headers;
236  uint16_t src_frm_map_ind;
238  uint8_t ui8Reserved[4]; //4
240 
241 // 40 bytes
243 {
244  uint32_t bs_frame_size;
245  uint32_t frame_type;
246  uint64_t frame_tstamp;
247  uint32_t recycle_index;
248  uint32_t frame_cycle;
249  uint32_t avg_frame_qp;
250  uint8_t end_of_packet;
251  uint8_t reserved[11];
253 
254 /*!****** encoder paramters *********************************************/
255 
257 {
259  GOP_PRESET_IDX_ALL_I = 1, /*!*< All Intra, gopsize = 1 */
260  GOP_PRESET_IDX_IPP = 2, /*!*< Consecutive P, cyclic gopsize = 1 */
261  GOP_PRESET_IDX_IBBB = 3, /*!*< Consecutive B, cyclic gopsize = 1 */
262  GOP_PRESET_IDX_IBPBP = 4, /*!*< gopsize = 2 */
263  GOP_PRESET_IDX_IBBBP = 5, /*!*< gopsize = 4 */
264  GOP_PRESET_IDX_IPPPP = 6, /*!*< Consecutive P, cyclic gopsize = 4 */
265  GOP_PRESET_IDX_IBBBB = 7, /*!*< Consecutive B, cyclic gopsize = 4 */
266  GOP_PRESET_IDX_RA_IB = 8, /*!*< Random Access, cyclic gopsize = 8 */
267  GOP_PRESET_IDX_SP = 9, /*!*< Consecutive P, gopsize=1, similar to 2 but */
268  /* uses 1 instead of 2 reference frames */
269 
270  GOP_PRESET_IDX_17 = 17, /*!*< GOP_PRESET_IDX_ALL_I, poc_type=2 */
271  GOP_PRESET_IDX_18 = 18, /*!*< GOP_PRESET_IDX_IPP, poc_type=2 */
272  GOP_PRESET_IDX_19 = 19, /*!*< GOP_PRESET_IDX_IBBB, poc_type=2 */
273  GOP_PRESET_IDX_20 = 20, /*!*< GOP_PRESET_IDX_IPPPP, poc_type=2 */
274  GOP_PRESET_IDX_21 = 21, /*!*< GOP_PRESET_IDX_IBBBB, poc_type=2 */
275  GOP_PRESET_IDX_22 = 22, /*!*< GOP_PRESET_IDX_SP, poc_type=2 */
277 
278 /*!*
279 * \brief
280 @verbatim
281 This is an enumeration for declaring codec standard type variables. Currently,
282 VPU supports many different video standards such as H.265/HEVC, MPEG4 SP/ASP, H.263 Profile 3, H.264/AVC
283 BP/MP/HP, VC1 SP/MP/AP, Divx3, MPEG1, MPEG2, RealVideo 8/9/10, AVS Jizhun/Guangdian profile, AVS2,
284  Theora, VP3, VP8/VP9 and SVAC.
285 
286 NOTE: MPEG-1 decoder operation is handled as a special case of MPEG2 decoder.
287 STD_THO must be always 9.
288 @endverbatim
289 */
290 typedef enum
291 {
300  STD_THO = 9,
307  STD_MAX
309 
311 {
312  int32_t profile;
313  int32_t level;
314  int32_t tier;
316  int32_t losslessEnable; /*!*< It enables lossless coding. */
317  int32_t constIntraPredFlag; /*!*< It enables constrained intra prediction. */
320  int32_t intra_qp; /*!*< A quantization parameter of intra picture */
321  int32_t intra_period; /*!*< A period of intra picture in GOP size */
322  int32_t conf_win_top; /*!*< A top offset of conformance window */
323  int32_t conf_win_bottom; /*!*< A bottom offset of conformance window */
324  int32_t conf_win_left; /*!*< A left offset of conformance window */
325  int32_t conf_win_right; /*!*< A right offset of conformance window */
327  int32_t independSliceModeArg; /*!*< The number of CTU for a slice when independSliceMode is set with 1 */
329  int32_t dependSliceModeArg; /*!*< The number of CTU or bytes for a slice when dependSliceMode is set with 1 or 2 */
333  int32_t scalingListEnable; /*!*< It enables a scaling list. */
334  int32_t cu_size_mode;
335  int32_t tmvpEnable; /*!*< It enables temporal motion vector prediction. */
336  int32_t wppEnable; /*!*< It enables WPP (T408-front Parallel Processing).
337  WPP is unsupported in ring buffer mode of bitstream buffer. */
338  int32_t max_num_merge; /*!*< It specifies the number of merge candidates in RDO (1 or 2).
339  2 of max_num_merge (default) offers better quality of encoded picture,
340  while 1 of max_num_merge improves encoding performance. */
341  int32_t disableDeblk; /*!*< It disables in-loop deblocking filtering. */
342  int32_t lfCrossSliceBoundaryEnable; /*!*< It enables filtering across slice boundaries for in-loop deblocking. */
343  int32_t betaOffsetDiv2; /*!*< It sets BetaOffsetDiv2 for deblocking filter. */
344  int32_t tcOffsetDiv2; /*!*< It sets TcOffsetDiv3 for deblocking filter. */
345  int32_t skipIntraTrans; /*!*< It enables transform skip for an intra CU. */
346  int32_t saoEnable; /*!*< It enables SAO (Sample Adaptive Offset). */
347  int32_t intraNxNEnable; /*!*< It enables intra NxN PUs. */
348  int32_t bitAllocMode;
350  int32_t enable_cu_level_rate_control; /*!*< It enable CU level rate control. */
351  int32_t enable_hvs_qp; /*!*< It enable CU QP adjustment for subjective quality enhancement. */
352  int32_t hvs_qp_scale; /*!*< A QP scaling factor for CU QP adjustment when enable_hvs_qp_scale is 1 */
353  int32_t max_delta_qp; /*!*< A maximum delta QP for rate control */
354 
355  // CUSTOM_GOP
356  ni_logan_custom_gop_params_t custom_gop_params; /*!*< <<vpuapi_h_CustomGopParam>> */
357  int32_t roiEnable; /*!*< It enables ROI map. NOTE: It is valid when rate control is on. */
358 
359  uint32_t numUnitsInTick; /*!*< It specifies the number of time units of a clock operating at the frequency time_scale Hz.
360  This is used to to calculate frame_rate syntax. */
361  uint32_t timeScale; /*!*< It specifies the number of time units that pass in one second.
362  This is used to to calculate frame_rate syntax. */
363  uint32_t numTicksPocDiffOne; /*!*< It specifies the number of clock ticks corresponding to
364  a difference of picture order count values equal to 1.
365  This is used to calculate frame_rate syntax. */
366 
367  int32_t chromaCbQpOffset; /*!*< The value of chroma(Cb) QP offset */
368  int32_t chromaCrQpOffset; /*!*< The value of chroma(Cr) QP offset */
369 
370  int32_t initialRcQp; /*!*< The value of initial QP by HOST application. This value is meaningless if INITIAL_RC_QP is 63.*/
371 
372  uint32_t nrYEnable; /*!*< It enables noise reduction algorithm to Y component. */
373  uint32_t nrCbEnable; /*!*< It enables noise reduction algorithm to Cb component. */
374  uint32_t nrCrEnable; /*!*< It enables noise reduction algorithm to Cr component. */
375 
376  // ENC_NR_WEIGHT
377  uint32_t nrIntraWeightY; /*!*< A weight to Y noise level for intra picture (0 ~ 31).
378  nrIntraWeight/4 is multiplied to the noise level that has been estimated.
379  This weight is put for intra frame to be filtered more strongly or
380  more weakly than just with the estimated noise level. */
381  uint32_t nrIntraWeightCb; /*!*< A weight to Cb noise level for intra picture (0 ~ 31) */
382  uint32_t nrIntraWeightCr; /*!*< A weight to Cr noise level for intra picture (0 ~ 31) */
383  uint32_t nrInterWeightY; /*!*< A weight to Y noise level for inter picture (0 ~ 31).
384  nrInterWeight/4 is multiplied to the noise level that has been estimated.
385  This weight is put for inter frame to be filtered more strongly or
386  more weakly than just with the estimated noise level. */
387  uint32_t nrInterWeightCb; /*!*< A weight to Cb noise level for inter picture (0 ~ 31) */
388  uint32_t nrInterWeightCr; /*!*< A weight to Cr noise level for inter picture (0 ~ 31) */
389 
390  uint32_t nrNoiseEstEnable; /*!*< It enables noise estimation for noise reduction.
391  When this is disabled, host carries out noise estimation with nrNoiseSigmaY/Cb/Cr. */
392  uint32_t nrNoiseSigmaY; /*!*< It specifies Y noise standard deviation when nrNoiseEstEnable is 0. */
393  uint32_t nrNoiseSigmaCb; /*!*< It specifies Cb noise standard deviation when nrNoiseEstEnable is 0. */
394  uint32_t nrNoiseSigmaCr; /*!*< It specifies Cr noise standard deviation when nrNoiseEstEnable is 0. */
395 
396  uint32_t useLongTerm; /*!*< It enables long-term reference function. */
397 
398  // newly added for T408_520
399  uint32_t monochromeEnable; /*!*< It enables monochrome encoding mode. */
400  uint32_t strongIntraSmoothEnable; /*!*< It enables strong intra smoothing. */
401 
402  uint32_t weightPredEnable; /*!*< It enables to use weighted prediction.*/
403  uint32_t bgDetectEnable; /*!*< It enables background detection. */
404  uint32_t bgThrDiff; /*!*< It specifies the threshold of max difference that is used in s2me block.
405  It is valid when background detection is on. */
406  uint32_t bgThrMeanDiff; /*!*< It specifies the threshold of mean difference that is used in s2me block.
407  It is valid when background detection is on. */
408  uint32_t bgLambdaQp; /*!*< It specifies the minimum lambda QP value to be used in the background area. */
409  int32_t bgDeltaQp; /*!*< It specifies the difference between the lambda QP value of background
410  and the lambda QP value of foreground. */
411 
412  uint32_t customLambdaEnable; /*!*< It enables custom lambda table. */
413  uint32_t customMDEnable; /*!*< It enables custom mode decision. */
414  int32_t pu04DeltaRate; /*!*< A value which is added to the total cost of 4x4 blocks */
415  int32_t pu08DeltaRate; /*!*< A value which is added to the total cost of 8x8 blocks */
416  int32_t pu16DeltaRate; /*!*< A value which is added to the total cost of 16x16 blocks */
417  int32_t pu32DeltaRate; /*!*< A value which is added to the total cost of 32x32 blocks */
418  int32_t pu04IntraPlanarDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
419  in 4x4 Planar intra prediction mode. */
420  int32_t pu04IntraDcDeltaRate; /*!*< A value which is added to rate when calculating cost (=distortion + rate)
421  in 4x4 DC intra prediction mode. */
422  int32_t pu04IntraAngleDeltaRate; /*!*< A value which is added to rate when calculating cost (=distortion + rate)
423  in 4x4 Angular intra prediction mode. */
424  int32_t pu08IntraPlanarDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
425  in 8x8 Planar intra prediction mode.*/
426  int32_t pu08IntraDcDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
427  in 8x8 DC intra prediction mode.*/
428  int32_t pu08IntraAngleDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
429  in 8x8 Angular intra prediction mode. */
430  int32_t pu16IntraPlanarDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
431  in 16x16 Planar intra prediction mode. */
432  int32_t pu16IntraDcDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
433  in 16x16 DC intra prediction mode */
434  int32_t pu16IntraAngleDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
435  in 16x16 Angular intra prediction mode */
436  int32_t pu32IntraPlanarDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
437  in 32x32 Planar intra prediction mode */
438  int32_t pu32IntraDcDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
439  in 32x32 DC intra prediction mode */
440  int32_t pu32IntraAngleDeltaRate; /*!*< A value which is added to rate when calculating cost(=distortion + rate)
441  in 32x32 Angular intra prediction mode */
442  int32_t cu08IntraDeltaRate; /*!*< A value which is added to rate when calculating cost for intra CU8x8 */
443  int32_t cu08InterDeltaRate; /*!*< A value which is added to rate when calculating cost for inter CU8x8 */
444  int32_t cu08MergeDeltaRate; /*!*< A value which is added to rate when calculating cost for merge CU8x8 */
445  int32_t cu16IntraDeltaRate; /*!*< A value which is added to rate when calculating cost for intra CU16x16 */
446  int32_t cu16InterDeltaRate; /*!*< A value which is added to rate when calculating cost for inter CU16x16 */
447  int32_t cu16MergeDeltaRate; /*!*< A value which is added to rate when calculating cost for merge CU16x16 */
448  int32_t cu32IntraDeltaRate; /*!*< A value which is added to rate when calculating cost for intra CU32x32 */
449  int32_t cu32InterDeltaRate; /*!*< A value which is added to rate when calculating cost for inter CU32x32 */
450  int32_t cu32MergeDeltaRate; /*!*< A value which is added to rate when calculating cost for merge CU32x32 */
451  int32_t coefClearDisable; /*!*< It disables the transform coefficient clearing algorithm for P or B picture.
452  If this is 1, all-zero coefficient block is not evaluated in RDO. */
453  int32_t minQpI; /*!*< A minimum QP of I picture for rate control */
454  int32_t maxQpI; /*!*< A maximum QP of I picture for rate control */
455  int32_t minQpP; /*!*< A minimum QP of P picture for rate control */
456  int32_t maxQpP; /*!*< A maximum QP of P picture for rate control */
457  int32_t minQpB; /*!*< A minimum QP of B picture for rate control */
458  int32_t maxQpB; /*!*< A maximum QP of B picture for rate control */
459 
460  // for H.264 on T408
461  int32_t avcIdrPeriod; /*!*< A period of IDR picture (0 ~ 1024) 0 - implies an infinite period */
462  int32_t rdoSkip; /*!*< It skips RDO(rate distortion optimization). */
463  int32_t lambdaScalingEnable; /*!*< It enables lambda scaling using custom GOP. */
464  int32_t enable_transform_8x8; /*!*< It enables 8x8 intra prediction and 8x8 transform. */
465  int32_t avc_slice_mode;
466  int32_t avc_slice_arg; /*!*< The number of MB for a slice when avc_slice_mode is set with 1 */
469  int32_t enable_mb_level_rc; /*!*< It enables MB-level rate control. */
471 
473  // forcedHeaderEnable = 2:Every IRAP frame includes headers(VPS, SPS, PPS)
474  // forcedHeaderEnable = 1:Every IDR frame includes headers (VPS,SPS, PPS).
475  // forcedHeaderEnable = 0:First IDR frame includes headers (VPS,SPS, PPS).
478 
480 {
481  uint8_t ui8bitstreamFormat; /*!*< The standard type of bitstream in encoder operation.
482  It is one of STD_AVC and STD_HEVC, use enums from ni_logan_bitstream_format_t. */
483  int32_t i32picWidth; /*!*< The width of a picture to be encoded in unit of sample. */
484  int32_t i32picHeight; /*!*< The height of a picture to be encoded in unit of sample. */
485  int32_t i32meBlkMode; // (AVC ONLY)
486  uint8_t ui8sliceMode; /*!*< <<vpuapi_h_EncSliceMode>> */
489  int32_t i32userQpMax;
490  // AVC only
491  int32_t i32maxIntraSize; /*!*< The maximum bit size for intra frame. (H.264/AVC only) */
492  int32_t i32userMaxDeltaQp; /*!*< The maximum delta QP for encoding process. (H.264/AVC only) */
493  int32_t i32userMinDeltaQp; /*!*< The minimum delta QP for encoding process. (H.264/AVC only) */
494  int32_t i32userQpMin; /*!*< The minimum quantized step parameter for encoding process. (H.264/AVC only) */
495  int32_t i32bitRate;
496  int32_t i32bitRateBL;
497  uint8_t ui8rcEnable;
498  int32_t i32srcBitDepth; /*!*< A bit-depth of source image */
499  uint8_t ui8enablePTS; /*!*< An enable flag to report PTS(Presentation Timestamp) */
500  uint8_t ui8lowLatencyMode; /*!*< 2bits low latency mode setting. bit[1]: low latency interrupt enable,
501  bit[0]: fast bitstream-packing enable (only for T408_5) */
502 
503  ni_logan_t408_config_t niParamT408; /*!*< <<vpuapi_h_EncT408Param>> */
504 
505  /*!*< endianess of 10 bit source YUV. 0: little (default) 1: big */
507 
509  uint32_t hdrEnableVUI; //TODO: to be deprecated
512  uint8_t ui8EnableAUD;
513  int8_t ui8hwframes;
515  uint8_t ui8crf;
516  uint8_t ui8Reserved[4];
517  uint32_t ui32flushGop;
519  uint32_t ui32fillerEnable;
521  // Mode for limiting max frame, 0: in bits 1: in ratio
522  uint32_t maxFrameMode;
523  uint32_t maxFrameArg;
530 
531 /*!****** hwuploader initialization paramters *********************************/
533 {
534  uint16_t width;
535  uint16_t height;
536  uint16_t bit_depth_factor; // for YUV buffer allocation
537  uint16_t pool_size; // hardware YUV buffer pool size
538  uint16_t p2p_pool;
540 
541 /*!****** paramters of clearing hardware frames *********************************/
543 {
544  int8_t i8FrameIdx;
545  int8_t i8InstID;
546  int8_t resv[2];
548 
549 
550 // the following enum and struct are copied from firmware/nvme/vpuapi/vpuapi.h
551 /*!*
552 * \brief
553 @verbatim
554 This is an enumeration for declaring SET_PARAM command options. (_T400_ENC encoder only)
555 Depending on this, SET_PARAM command parameter registers from 0x15C have different meanings.
556 
557 @endverbatim
558 */
559 typedef enum
560 {
563  OPT_SEI = 2,
564  OPT_VUI = 3
566 
567 /*!******************************************************************************
568  * \brief Get info from received p_frame
569  *
570  * \param ni_logan_frame_t* p_frame - ni_logan_frame_t
571  * \param uint32_t read_length - buffer length in p_frame
572  * \param uint64_t* frame_offset - frame offset
573  * \param bool is_hw_frame - 0: software frame, 1: hardware frame
574  *
575  * \return frame size
576  *******************************************************************************/
577 int ni_logan_create_frame(ni_logan_frame_t* p_frame, uint32_t read_length, uint64_t* frame_offset, bool is_hw_frame);
578 
579 /*!******************************************************************************
580  * \brief Setup all xcoder configurations with custom parameters (Rev. B)
581  *
582  * \param
583  *
584  * \return
585  ******************************************************************************/
589 
590 /*!******************************************************************************
591  * \brief Setup and initialize all xcoder configuration to default (Rev. B)
592  *
593  * \param
594  *
595  * \return
596  ******************************************************************************/
598  ni_logan_encoder_config_t* p_config);
599 
600 /*!******************************************************************************
601  * \brief Perform validation on custom parameters (Rev. B)
602  *
603  * \param
604  *
605  * \return
606  ******************************************************************************/
610  char* p_param_err,
611  uint32_t max_err_len);
612 
613 /*!******************************************************************************
614  * \brief check the range of common parameters
615  *
616  * \param
617  *
618  * \return
619  ******************************************************************************/
622  char* param_err,
623  uint32_t max_err_len);
624 
625 /*!******************************************************************************
626  * \brief check the range of rate control parameters
627  *
628  * \param
629  *
630  * \return
631  ******************************************************************************/
633  char* param_err,
634  uint32_t max_err_len);
635 
636 /*!******************************************************************************
637  * \brief Print xcoder user configurations
638  *
639  * \param
640  *
641  * \return
642  *******************************************************************************/
643 void ni_logan_params_print(void * const p_params, ni_logan_device_type_t device_type);
644 
645 /*!******************************************************************************
646  * \brief Get info from received xcoder capability
647  *
648  * \param
649  *
650  * \return
651  *******************************************************************************/
653 
654 /*!******************************************************************************
655  * \brief Open a xcoder decoder instance
656  *
657  * \param
658  *
659  * \return
660 *******************************************************************************/
662 
663 /*!******************************************************************************
664  * \brief Close a xcoder decoder instance
665  *
666  * \param
667  *
668  * \return
669  *******************************************************************************/
671 
672 /*!******************************************************************************
673  * \brief Flush decoder output
674  *
675  * \param
676  *
677  * \return
678  *******************************************************************************/
680 
681 /*!******************************************************************************
682  * \brief Flush decoder output
683  *
684  * \param ni_logan_session_context_t* p_ctx - xcoder Context
685  *
686  * \return NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_INVALID_PARAM
687  * or NI_LOGAN_RETCODE_ERROR_INVALID_SESSION on failure
688  *******************************************************************************/
690 
691 /*!******************************************************************************
692  * \brief Send a video p_packet to decoder
693  *
694  * \param
695  *
696  * \return
697  *******************************************************************************/
699 
700 /*!******************************************************************************
701  * \brief Retrieve a YUV p_frame from decoder
702  *
703  * \param
704  *
705  * \return
706  *******************************************************************************/
708 
709 /*!******************************************************************************
710  * \brief Query current decoder status
711  *
712  * \param
713  *
714  * \return
715  *******************************************************************************/
717 
718 /*!******************************************************************************
719  * \brief Open a xcoder encoder instance
720  *
721  * \param
722  *
723  * \return
724  *******************************************************************************/
726 
727 /*!******************************************************************************
728  * \brief Close a xcoder encoder instance
729  *
730  * \param
731  *
732  * \return
733  *******************************************************************************/
735 
736 /*!******************************************************************************
737  * \brief Flush encoder output
738  *
739  * \param
740  *
741  * \return
742  *******************************************************************************/
744 
745 /*!******************************************************************************
746  * \brief Send a YUV p_frame to encoder
747  *
748  * \param
749  *
750  * \return
751  *******************************************************************************/
753 
754 /*!******************************************************************************
755  * \brief Retrieve an encoded packet from encoder
756  *
757  * \param
758  *
759  * \return
760  *******************************************************************************/
762 
763 /*!******************************************************************************
764  * \brief Query current encoder status
765  *
766  * \param
767  *
768  * \return
769  *******************************************************************************/
771 //int ni_logan_encoder_session_reconfig(ni_logan_session_context_t *p_ctx, ni_logan_session_config_t *p_config,
772 // ni_logan_param_change_flags_t change_flags);
773 
774 /*!******************************************************************************
775  * \brief Query a particular xcoder instance to get GeneralStatus data
776  *
777  * \param ni_logan_session_context_t p_ctx - xcoder Context
778  * \param ni_logan_device_type_t device_type - xcoder type Encoder or Decoder
779  * \param ni_logan_instance_mgr_general_status_t *out - Struct preallocated from the caller where the
780  * resulting data will be placed
781  *
782  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure
783  *******************************************************************************/
785  ni_logan_device_type_t device_type,
787 
788 /*!******************************************************************************
789  * \brief Query a particular xcoder instance to get Stream Info data
790  *
791  * \param ni_logan_session_context_t p_ctx - xcoder Context
792  * \param ni_logan_device_type_t device_type - xcoder type Encoder or Decoder
793  * \param ni_logan_instance_mgr_stream_info_t *out - Struct preallocated from the caller where the
794  * resulting data will be placed
795  *
796  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_MEM_ALOC
797  * or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure
798  *******************************************************************************/
800  ni_logan_device_type_t device_type,
802  bool is_hw);
803 
804 /*!*****************************************************************************
805  * \brief Query a particular xcoder instance to get status Info data
806  *
807  * \param ni_logan_session_context_t p_ctx - xcoder Context
808  * \param ni_logan_device_type_t device_type - xcoder type Encoder or Decoder
809  * \param ni_logan_instance_status_info_t *out - Struct preallocated from the
810  * caller where the resulting data will be placed
811  * \param int rc - rc returned by the last call
812  *
813  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION,
814  * NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED
815  * on failure
816  ******************************************************************************/
818  ni_logan_device_type_t device_type,
819  ni_logan_instance_status_info_t* p_status_info,
820  int rc,
821  int opcode);
822 
823 /*!*****************************************************************************
824  * \brief Query a particular xcoder instance to get buffer/data Info data
825  *
826  * \param ni_logan_session_context_t p_ctx - xcoder Context
827  * \param ni_logan_instance_buf_info_rw_type_t rw_type
828  * \param ni_logan_device_type_t device_type - xcoder type Encoder or Decoder
829  * \param ni_logan_instance_buf_info_t *out - Struct preallocated from the caller
830  * where the resulting data will be placed
831  *
832  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION,
833  * NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on
834  * failure
835  ******************************************************************************/
838  ni_logan_device_type_t device_type,
839  ni_logan_instance_buf_info_t *p_inst_buf_info,
840  bool is_hw);
841 
842 /*!******************************************************************************
843  * \brief Send a p_config command for Start Of Stream
844  *
845  * \param ni_logan_session_context_t p_ctx - xcoder Context
846  * \param ni_logan_device_type_t device_type - xcoder type Encoder or Decoder
847  *
848  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION.
849  * NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure
850  *******************************************************************************/
852  ni_logan_device_type_t device_type);
853 
854 /*!******************************************************************************
855  * \brief Send a p_config command for End Of Stream
856  *
857  * \param ni_logan_session_context_t p_ctx - xcoder Context
858  * \param ni_logan_device_type_t device_type - xcoder type Encoder or Decoder
859  *
860  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION,
861  * NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure
862  *******************************************************************************/
864  ni_logan_device_type_t device_type);
865 
866 /*!******************************************************************************
867  * \brief Send a p_config command Flush Of Stream
868  *
869  * \param ni_logan_session_context_t p_ctx - xcoder Context
870  * \param ni_logan_device_type_t device_type - xcoder type Encoder or Decoder
871  *
872  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION,
873  * NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure
874  *******************************************************************************/
876  ni_logan_device_type_t device_type);
877 
878 /*!******************************************************************************
879  * \brief Send a p_config command to configure encoding parameters.
880  *
881  * \param ni_logan_session_context_t p_ctx - xcoder Context
882  *
883  * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION,
884  * NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure
885  *******************************************************************************/
887 
888 /*!******************************************************************************
889  * \brief updates encoder parameters based on change flags structure
890  *
891  * \param
892  *
893  * \return
894  *******************************************************************************/
896  ni_logan_param_change_flags_t change_flags);
897 
898 /*!******************************************************************************
899  * \brief decoder keep alive thread function triggers every 1 second
900  *
901  * \param void thread args
902  *
903  * \return void
904  *******************************************************************************/
905 void *ni_logan_session_keep_alive_thread(void *arguments);
906 
907 /*!******************************************************************************
908  * \brief send a keep alive message to firmware
909  *
910  * \param
911  *
912  * \return
913  *******************************************************************************/
915  ni_device_handle_t device_handle,
916  ni_event_handle_t event_handle,
917  void *p_data);
918 
919 /*!******************************************************************************
920  * \brief insert the 32 bits of integer value at bit position pos
921  *
922  * \param int pos, int value
923  *
924  * \return void
925  ******************************************************************************/
926 void ni_logan_fix_VUI(uint8_t *vui, int pos, int value);
927 
928 /*!******************************************************************************
929 * \brief Copy a xcoder decoder card info and create worker thread
930 *
931 * \param ni_logan_session_context_t p_ctx - source xcoder Context
932 * \param ni_logan_session_context_t p_ctx - destination xcoder Context
933 *
934 * \return NI_LOGAN_RETCODE_SUCCESS on success,
935 * NI_LOGAN_RETCODE_INVALID_PARAM on failure
936 *******************************************************************************/
938  ni_logan_session_context_t *dst_p_ctx);
939 
940 /*!******************************************************************************
941 * \brief Retrieve a hw desc p_frame from decoder
942 * When yuvbypass enabled, this is used for decoder
943 * to read hardware frame index, extra data and meta data
944 *
945 * \param ni_logan_session_context_t p_ctx - xcoder Context
946 * \param ni_logan_frame_t* p_frame - xcoder frame
947 * \param ni_logan_hwframe_surface_t* hwdesc - xcoder hardware descriptor
948 *
949 * \return rx_size on success,
950 * negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure
951 *******************************************************************************/
953  ni_logan_frame_t* p_frame);
954 
955 /*!******************************************************************************
956 * \brief Get Card Serial Number from received Nvme Indentify info
957 *
958 * \param
959 *
960 * \return
961 *******************************************************************************/
962 void ni_logan_populate_serial_number(ni_logan_serial_num_t* p_serial_num, void* p_data);
963 
964 /*!******************************************************************************
965 * \brief Open a xcoder uploader instance
966 *
967 * \param ni_logan_session_context_t p_ctx - xcoder Context
968 *
969 * \return NI_LOGAN_RETCODE_SUCCESS on success,
970 * negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure
971 * \return
972 *******************************************************************************/
974 
975 /*!******************************************************************************
976 * \brief Setup framepool for hwupload. Uses decoder framepool
977 *
978 * \param ni_logan_session_context_t p_ctx - xcoder Context
979 * \param uint32_t pool_size - buffer pool in HW
980 *
981 * \return NI_LOGAN_RETCODE_SUCCESS on success,
982 * negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure
983 *******************************************************************************/
985  uint32_t pool_size, uint32_t p2p_pool);
986 
987 /*!******************************************************************************
988 * \brief Send a YUV to hardware, hardware will store it.
989 *
990 *
991 * \param ni_logan_session_context_t p_ctx - xcoder Context
992 * \param ni_logan_frame_t* p_frame - xcoder frame
993 *
994 * \return NI_LOGAN_RETCODE_SUCCESS on success,
995 * negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure
996 *******************************************************************************/
998  ni_logan_frame_t* p_frame);
999 
1000 /*!******************************************************************************
1001 * \brief Retrieve a HW descriptor of uploaded frame
1002 * The HW descriptor will contain the YUV frame index,
1003 * which stored in HW through ni_logan_hwupload_session_write().
1004 *
1005 * \param ni_logan_session_context_t p_ctx - xcoder Context
1006 * \param ni_logan_hwframe_surface_t* hwdesc - xcoder hardware descriptor
1007 *
1008 * \return NI_LOGAN_RETCODE_SUCCESS on success,
1009 * negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure
1010 *******************************************************************************/
1012  ni_logan_hwframe_surface_t* hwdesc, unsigned int *hwaddress);
1013 
1014 /*!******************************************************************************
1015 * \brief Retrieve a YUV through HW descriptor from decoder
1016 *
1017 * \param ni_logan_session_context_t p_ctx - xcoder Context
1018 * \param ni_logan_frame_t* p_frame - xcoder frame
1019 * \param ni_logan_hwframe_surface_t* hwdesc - xcoder hardware descriptor
1020 *
1021 * \return rx_size on success,
1022 * negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure
1023 *******************************************************************************/
1025  ni_logan_frame_t* p_frame,
1026  ni_logan_hwframe_surface_t* hwdesc);
1027 
1028 /*!*****************************************************************************
1029 * \brief clear a particular xcoder instance buffer/data
1030 *
1031 * \param ni_logan_frame_surface1_t* surface - target hardware descriptor
1032 * \param ni_device_handle_t device_handle - device handle
1033 * \param ni_event_handle_t event_handle - event handle
1034 *
1035 * \return - NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION,
1036 * or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on
1037 * failure
1038 ******************************************************************************/
1040  ni_device_handle_t device_handle,
1041  ni_event_handle_t event_handle);
1042 
1043 /*!******************************************************************************
1044  * \brief Set up schedule priority. First try to run with RR mode. If fails,
1045  * try to set nice value. If fails either, ignore it and run with default
1046  * priority.
1047  *
1048  * \param
1049  *
1050  * \return
1051  ******************************************************************************/
1052 void ni_logan_change_priority(void);
1053 #ifdef __cplusplus
1054 }
1055 #endif
1056 
1057 /*!*****************************************************************************
1058  * \brief Get an address offset from a hw descriptor
1059  *
1060  * \param[in] p_ctx ni_session_context_t to be referenced
1061  * \param[in] hwaddress DDR address in FW
1062  * \param[in] hwdesc Pointer to caller allocated niFrameSurface1_t
1063  * \param[out] p_offset Value of offset
1064  *
1065  * \return On success NI_RETCODE_SUCCESS
1066  * On failure NI_RETCODE_INVALID_PARAM
1067  ******************************************************************************/
1069  unsigned int *p_offset, unsigned int hwaddress);
Common NETINT definitions used by all modules.
ni_logan_retcode_t
ni_logan_device_type_t
#define NI_LOGAN_MAX_VUI_SIZE
enum _ni_logan_param_change_flags ni_logan_param_change_flags_t
This is an enumeration for encoder parameter change.
#define NI_LOGAN_MAX_GOP_NUM
struct _ni_logan_decoder_session_open_info ni_logan_decoder_session_open_info_t
ni_logan_retcode_t ni_logan_encoder_session_close(ni_logan_session_context_t *p_ctx, int eos_recieved)
Close a xcoder encoder instance.
int ni_logan_encoder_session_read(ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
Retrieve an encoded packet from encoder.
ni_logan_retcode_t ni_logan_query_stream_info(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_mgr_stream_info_t *p_stream_info, bool is_hw)
Query a particular xcoder instance to get Stream Info data.
int ni_logan_decoder_session_read_desc(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Retrieve a hw desc p_frame from decoder When yuvbypass enabled, this is used for decoder to read hard...
struct _ni_logan_metadata_common ni_logan_metadata_common_t
struct _ni_logan_inst_config_rw ni_logan_inst_config_rw_t
enum _ni_logan_gop_preset_idx ni_logan_gop_preset_idx_t
ni_logan_inst_config_rw_type_t
@ INST_WRITE_CONFIG
@ INST_READ_CONFIG
ni_logan_retcode_t ni_logan_config_instance_set_encoder_params(ni_logan_session_context_t *p_ctx)
Send a p_config command to configure encoding parameters.
ni_logan_retcode_t ni_get_memory_offset(ni_logan_session_context_t *p_ctx, const ni_logan_hwframe_surface_t *hwdesc, unsigned int *p_offset, unsigned int hwaddress)
Get an address offset from a hw descriptor.
ni_logan_bitstream_format_t
ni_logan_retcode_t ni_logan_config_instance_sos(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
Send a p_config command for Start Of Stream.
struct _ni_logan_instance_upload_ret_hwdesc ni_logan_instance_upload_ret_hwdesc_t
ni_logan_retcode_t ni_logan_query_status_info(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_status_info_t *p_status_info, int rc, int opcode)
Query a particular xcoder instance to get status Info data.
struct _ni_logan_instance_mgr_stream_complete ni_logan_instance_mgr_stream_complete_t
int ni_logan_hwupload_session_write(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Send a YUV to hardware, hardware will store it.
int ni_logan_encoder_session_query(ni_logan_session_context_t *p_ctx)
Query current encoder status.
ni_logan_retcode_t ni_logan_validate_custom_template(ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_cfg, ni_logan_encoder_params_t *p_src, char *p_param_err, uint32_t max_err_len)
Perform validation on custom parameters (Rev. B)
struct _ni_logan_encoder_session_open_info ni_logan_encoder_session_open_info_t
ni_logan_retcode_t ni_logan_config_instance_update_encoder_params(ni_logan_session_context_t *p_ctx, ni_logan_param_change_flags_t change_flags)
updates encoder parameters based on change flags structure
int ni_logan_decoder_session_write(ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
Send a video p_packet to decoder.
struct _ni_logan_metadata_enc_bstream ni_logan_metadata_enc_bstream_t
ni_logan_retcode_t ni_logan_clear_instance_buf(ni_logan_hwframe_surface_t *surface, ni_device_handle_t device_handle, ni_event_handle_t event_handle)
clear a particular xcoder instance buffer/data
enum _ni_logan_xcoder_mgr_retcode ni_logan_xcoder_mgr_retcode_t
ni_logan_retcode_t ni_logan_encoder_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder encoder instance.
ni_logan_retcode_t ni_logan_encoder_session_flush(ni_logan_session_context_t *p_ctx)
Flush encoder output.
void ni_logan_set_default_template(ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_config)
Setup and initialize all xcoder configuration to default (Rev. B)
void ni_logan_fix_VUI(uint8_t *vui, int pos, int value)
insert the 32 bits of integer value at bit position pos
int ni_logan_hwdownload_session_read(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame, ni_logan_hwframe_surface_t *hwdesc)
Retrieve a YUV through HW descriptor from decoder.
int ni_logan_create_frame(ni_logan_frame_t *p_frame, uint32_t read_length, uint64_t *frame_offset, bool is_hw_frame)
Get info from received p_frame.
_ni_logan_gop_preset_idx
@ GOP_PRESET_IDX_CUSTOM
@ GOP_PRESET_IDX_IBPBP
@ GOP_PRESET_IDX_IBBBB
@ GOP_PRESET_IDX_RA_IB
@ GOP_PRESET_IDX_IPPPP
@ GOP_PRESET_IDX_ALL_I
@ GOP_PRESET_IDX_IBBBP
@ GOP_PRESET_IDX_IPP
@ GOP_PRESET_IDX_IBBB
struct _ni_logan_session_closed_status ni_logan_session_closed_status_t
void ni_logan_populate_serial_number(ni_logan_serial_num_t *p_serial_num, void *p_data)
Get Card Serial Number from received Nvme Indentify info.
struct _ni_logan_init_frames_params_t ni_logan_init_frames_params_t
int ni_logan_hwupload_session_read_hwdesc(ni_logan_session_context_t *p_ctx, ni_logan_hwframe_surface_t *hwdesc, unsigned int *hwaddress)
Retrieve a HW descriptor of uploaded frame The HW descriptor will contain the YUV frame index,...
struct _ni_logan_instance_debugInfo ni_logan_instance_debugInfo_t
struct _ni_logan_metadata_dec_frame ni_logan_metadata_dec_frame_t
_ni_logan_xcoder_mgr_retcode
@ ni_logan_xcoder_general_error
@ ni_logan_xcoder_resource_insufficient
@ ni_logan_xcoder_resource_recovery
@ ni_logan_xcoder_request_success
@ ni_logan_xcoder_request_pending
ni_logan_retcode_t ni_logan_query_instance_buf_info(ni_logan_session_context_t *p_ctx, ni_logan_instance_buf_info_rw_type_t rw_type, ni_logan_device_type_t device_type, ni_logan_instance_buf_info_t *p_inst_buf_info, bool is_hw)
Query a particular xcoder instance to get buffer/data Info data.
int ni_logan_hwupload_init_framepool(ni_logan_session_context_t *p_ctx, uint32_t pool_size, uint32_t p2p_pool)
Setup framepool for hwupload. Uses decoder framepool.
ni_logan_retcode_t ni_logan_query_general_status(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_mgr_general_status_t *p_gen_status)
Query a particular xcoder instance to get GeneralStatus data.
struct _ni_logan_instance_buf_info ni_logan_instance_buf_info_t
struct _ni_logan_t408_config_t ni_logan_t408_config_t
struct _ni_logan_get_session_id ni_logan_get_session_id_t
ni_logan_retcode_t ni_logan_decoder_session_copy_internal(ni_logan_session_context_t *src_p_ctx, ni_logan_session_context_t *dst_p_ctx)
Copy a xcoder decoder card info and create worker thread.
ni_logan_retcode_t ni_logan_send_session_keep_alive(uint32_t session_id, ni_device_handle_t device_handle, ni_event_handle_t event_handle, void *p_data)
send a keep alive message to firmware
struct _ni_logan_metadata_enc_frame ni_logan_metadata_enc_frame_t
struct _ni_logan_instance_mgr_general_status ni_logan_instance_mgr_general_status_t
void ni_logan_change_priority(void)
Set up schedule priority. First try to run with RR mode. If fails, try to set nice value....
ni_logan_retcode_t ni_logan_check_common_params(ni_logan_t408_config_t *p_param, ni_logan_encoder_params_t *p_src, char *param_err, uint32_t max_err_len)
check the range of common parameters
void * ni_logan_session_keep_alive_thread(void *arguments)
decoder keep alive thread function triggers every 1 second
ni_logan_instance_buf_info_rw_type_t
@ INST_BUF_INFO_RW_WRITE
@ INST_BUF_INFO_RW_READ
@ INST_BUF_INFO_R_ACQUIRE
@ INST_BUF_INFO_RW_UPLOAD
ni_logan_retcode_t ni_logan_decoder_session_close(ni_logan_session_context_t *p_ctx, int eos_recieved)
Close a xcoder decoder instance.
struct _ni_logan_encoder_frame_params ni_logan_encoder_frame_params_t
void ni_logan_populate_device_capability_struct(ni_logan_device_capability_t *p_cap, void *p_data)
Get info from received xcoder capability.
ni_logan_retcode_t ni_logan_decoder_session_flush_buffers(ni_logan_session_context_t *p_ctx)
Flush decoder output.
ni_logan_retcode_t ni_logan_config_instance_eos(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
Send a p_config command for End Of Stream.
struct _ni_logan_instance_dec_packet_info ni_logan_instance_dec_packet_info_t
ni_logan_retcode_t ni_logan_decoder_session_flush(ni_logan_session_context_t *p_ctx)
Flush decoder output.
ni_logan_retcode_t ni_logan_decoder_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder decoder instance.
ni_logan_retcode_t ni_logan_uploader_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder uploader instance.
int ni_logan_decoder_session_read(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Retrieve a YUV p_frame from decoder.
struct _ni_logan_recycle_buffer_t ni_logan_recycle_buffer_t
ni_logan_retcode_t ni_logan_config_instance_flush(ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
Send a p_config command Flush Of Stream.
ni_logan_set_param_option_t
int ni_logan_encoder_session_write(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Send a YUV p_frame to encoder.
struct _ni_logan_encoder_config_t ni_logan_encoder_config_t
struct _ni_logan_instance_mgr_stream_info ni_logan_instance_mgr_stream_info_t
ni_logan_retcode_t ni_logan_check_ratecontrol_params(ni_logan_encoder_config_t *p_cfg, char *param_err, uint32_t max_err_len)
check the range of rate control parameters
void ni_logan_set_custom_template(ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_cfg, ni_logan_encoder_params_t *p_src)
Setup all xcoder configurations with custom parameters (Rev. B)
void ni_logan_params_print(void *const p_params, ni_logan_device_type_t device_type)
Print xcoder user configurations.
int ni_logan_decoder_session_query(ni_logan_session_context_t *p_ctx)
Query current decoder status.
uint8_t ui8VuiRbsp[NI_LOGAN_MAX_VUI_SIZE]
ni_logan_t408_config_t niParamT408
union _ni_logan_inst_config_rw::@5 uHWAccessField
ni_logan_instance_upload_ret_hwdesc_t hw_inst_ind
union _ni_logan_metadata_common::@8 ui64_data
ni_logan_hwframe_surface_t hwdesc
ni_logan_metadata_common_t metadata_common
ni_logan_metadata_common_t metadata_common
int32_t fixedBitRatio[NI_LOGAN_MAX_GOP_NUM]
ni_logan_custom_gop_params_t custom_gop_params