/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocdecode/checkouts/develop/projects/rocdecode/utils/rocvideodecode/roc_video_dec.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocdecode/checkouts/develop/projects/rocdecode/utils/rocvideodecode/roc_video_dec.h Source File#

15 min read time

Applies to Linux

rocDecode: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocdecode/checkouts/develop/projects/rocdecode/utils/rocvideodecode/roc_video_dec.h Source File
roc_video_dec.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2023 - 2026 Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 #pragma once
24 
25 #include <stdint.h>
26 #include <mutex>
27 #include <vector>
28 #include <string>
29 #include <iostream>
30 #include <sstream>
31 #include <iomanip>
32 #include <string.h>
33 #include <queue>
34 #include <stdexcept>
35 #include <exception>
36 #include <cstring>
37 #include <unordered_map>
38 #include <chrono>
39 #include <thread>
40 #include <ctime>
41 #include <time.h>
42 #ifndef _WIN32
43 #include <unistd.h>
44 #include <sys/syscall.h>
45 #else
46 #include <process.h>
47 #include <windows.h>
48 #endif
49 #include <hip/hip_runtime.h>
50 #include "rocdecode/rocdecode.h"
51 #include "rocdecode/rocparser.h"
52 
53 // Select the output surface format for a chroma format + bit depth. Monochrome
54 // selects the same format as 4:2:0 (NV12/P016). Unrecognized chroma formats
55 // return rocDecVideoSurfaceFormat_Native (the "decoder chooses" sentinel), which
56 // callers must not use as a bit position (see rocdecode.h).
57 inline rocDecVideoSurfaceFormat SelectSurfaceFormat(rocDecVideoChromaFormat chroma_format, uint8_t bitdepth_minus_8) {
58  switch (chroma_format) {
61  return bitdepth_minus_8 ? rocDecVideoSurfaceFormat_P016
64  return bitdepth_minus_8 ? rocDecVideoSurfaceFormat_YUV444_16Bit
67  return bitdepth_minus_8 ? rocDecVideoSurfaceFormat_YUV422_16Bit
69  default:
70  return rocDecVideoSurfaceFormat_Native; // unrecognized chroma format
71  }
72 }
73 
74 #define ROCVIDEODEC_TOSTR(X) std::to_string(X)
75 #define ROCVIDEODEC_STR(X) std::string(X)
76 
77 // Simple logging macros - format matches src/commons.h:
78 // [0, Critical] filename:line: timestamp_us us: [pid:X tid:Y hashid:0xZZZZZ] func(): message
79 #ifndef _WIN32
80 #define RocVideoDecCriticalLog(msg) \
81  do { \
82  struct timespec _ts_; \
83  clock_gettime(CLOCK_MONOTONIC, &_ts_); \
84  uint64_t _us_ = static_cast<uint64_t>(_ts_.tv_sec) * 1000000ULL + _ts_.tv_nsec / 1000ULL; \
85  const char *_f_ = strrchr(__FILE__, '/'); \
86  pid_t _tid_ = static_cast<pid_t>(syscall(SYS_gettid)); \
87  std::ostringstream _htid_oss_; \
88  _htid_oss_ << "0x" << std::hex << std::setw(5) << std::setfill('0') \
89  << (std::hash<std::thread::id>{}(std::this_thread::get_id()) & 0xFFFFF); \
90  std::cerr << "[0, Critical] " << (_f_ ? _f_ + 1 : __FILE__) \
91  << ":" << __LINE__ << ": " << _us_ << " us: [pid:" \
92  << getpid() << " tid:" << _tid_ << " hashid:" << _htid_oss_.str() << "] " \
93  << __func__ << "(): " << (msg) << std::endl; \
94  } while (0)
95 #else
96 #define RocVideoDecCriticalLog(msg) \
97  do { \
98  /* function-local static: the runtime initializes it exactly once, even when \
99  several decode threads reach their first log at the same time */ \
100  static const LARGE_INTEGER _freq_ = [] { LARGE_INTEGER _f_ = {}; QueryPerformanceFrequency(&_f_); return _f_; }(); \
101  LARGE_INTEGER _cnt_; QueryPerformanceCounter(&_cnt_); \
102  /* split the division to keep the counter from overflowing when scaled to us */ \
103  uint64_t _us_ = static_cast<uint64_t>(_cnt_.QuadPart / _freq_.QuadPart) * 1000000ULL \
104  + static_cast<uint64_t>(_cnt_.QuadPart % _freq_.QuadPart) * 1000000ULL / _freq_.QuadPart; \
105  const char *_f_ = strrchr(__FILE__, '\\'); \
106  if (!_f_) _f_ = strrchr(__FILE__, '/'); \
107  uint32_t _tid_ = GetCurrentThreadId(); \
108  std::ostringstream _htid_oss_; \
109  _htid_oss_ << "0x" << std::hex << std::setw(5) << std::setfill('0') \
110  << (std::hash<std::thread::id>{}(std::this_thread::get_id()) & 0xFFFFF); \
111  std::cerr << "[0, Critical] " << (_f_ ? _f_ + 1 : __FILE__) \
112  << ":" << __LINE__ << ": " << _us_ << " us: [pid:" \
113  << _getpid() << " tid:" << _tid_ << " hashid:" << _htid_oss_.str() << "] " \
114  << __func__ << "(): " << (msg) << std::endl; \
115  } while (0)
116 #endif
117 
126 #define MAX_FRAME_NUM 16
127 
128 typedef int (ROCDECAPI *PFNRECONFIGUEFLUSHCALLBACK)(void *, uint32_t, void *);
129 
130 typedef enum SeiAvcHevcPayloadType_enum {
131  SEI_TYPE_TIME_CODE = 136,
132  SEI_TYPE_USER_DATA_UNREGISTERED = 5
133 } SeiAvcHevcPayloadType;
134 
140 } OutputSurfaceMemoryType;
141 
142 inline int GetChromaPlaneCount(rocDecVideoSurfaceFormat surface_format) {
143  int num_planes = 1;
144  switch (surface_format) {
147  default:
148  num_planes = 1;
149  break;
156  num_planes = 2;
157  break;
158  }
159 
160  return num_planes;
161 };
162 
163 inline float GetChromaHeightFactor(rocDecVideoSurfaceFormat surface_format) {
164  float factor = 0.5;
165  switch (surface_format) {
170  default:
171  factor = 0.5;
172  break;
177  factor = 1.0;
178  break;
179  }
180 
181  return factor;
182 };
183 
184 class RocVideoDecodeException : public std::exception {
185 public:
186 
187  explicit RocVideoDecodeException(const std::string& message, const int err_code):_message(message), _err_code(err_code) {}
188  explicit RocVideoDecodeException(const std::string& message):_message(message), _err_code(-1) {}
189  virtual const char* what() const throw() override {
190  return _message.c_str();
191  }
192  int Geterror_code() const { return _err_code; }
193 private:
194  std::string _message;
195  int _err_code;
196 };
197 
198 #define ROCDEC_THROW(X, CODE) throw RocVideoDecodeException(" { " + std::string(__func__) + " } " + X , CODE);
199 
200 #define ROCDEC_API_CALL( rocDecAPI ) \
201  do { \
202  rocDecStatus error_code = rocDecAPI; \
203  if( error_code != ROCDEC_SUCCESS) { \
204  std::ostringstream error_log; \
205  error_log << #rocDecAPI << " returned " << rocDecGetErrorName(error_code) << " at " <<__FILE__ <<":" << __LINE__;\
206  ROCDEC_THROW(error_log.str(), error_code); \
207  } \
208  } while (0)
209 
210 #define HIP_API_CALL( call ) \
211  do { \
212  hipError_t hip_status = call; \
213  if (hip_status != hipSuccess) { \
214  const char *sz_err_name = NULL; \
215  sz_err_name = hipGetErrorName(hip_status); \
216  std::ostringstream error_log; \
217  error_log << "hip API error " << sz_err_name ; \
218  ROCDEC_THROW(error_log.str(), hip_status); \
219  } \
220  } \
221  while (0)
222 
223 #define CHECK_ZERO(str, value) \
224  do { \
225  if (value == 0) { \
226  RocVideoDecCriticalLog(ROCVIDEODEC_STR(str) + " is 0."); \
227  } \
228  } while (0)
229 
230 struct Rect {
231  int left;
232  int top;
233  int right;
234  int bottom;
235 };
236 
237 struct Dim {
238  int w, h;
239 };
240 
241 static inline int align(int value, int alignment) {
242  return (value + alignment - 1) & ~(alignment - 1);
243 }
244 
245 typedef struct DecFrameBuffer_ {
246  uint8_t *frame_ptr;
247  int64_t pts;
250 
251 
252 typedef struct OutputSurfaceInfoType {
253  uint32_t output_width;
254  uint32_t output_height;
255  uint32_t output_pitch;
256  uint32_t output_vstride;
257  uint32_t chroma_height;
259  uint32_t bytes_per_pixel;
260  uint32_t bit_depth;
261  uint32_t num_chroma_planes;
263  rocDecVideoSurfaceFormat surface_format;
264  OutputSurfaceMemoryType mem_type;
266 
267 typedef struct ReconfigParams_t {
268  PFNRECONFIGUEFLUSHCALLBACK p_fn_reconfigure_flush;
269  void *p_reconfig_user_struct;
270  uint32_t reconfig_flush_mode;
272 
279  public:
294  RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool force_zero_latency = false,
295  const Rect *p_crop_rect = nullptr, bool extract_user_SEI_Message = false, uint32_t disp_delay = 0, int max_width = 0, int max_height = 0,
296  uint32_t clk_rate = 1000, bool skip_init = false);
297 
298  virtual ~RocVideoDecoder();
299 
300  rocDecVideoCodec GetCodecId() { return codec_id_; }
301 
305  uint32_t GetWidth() {CHECK_ZERO("Display width", disp_width_); return disp_width_;}
306 
310  int GetDecodeWidth() {CHECK_ZERO("Coded width", coded_width_); return coded_width_; }
311 
315  uint32_t GetHeight() {CHECK_ZERO("Display height", disp_height_); return disp_height_; }
316 
320  int GetChromaHeight() {CHECK_ZERO("Chroma height", chroma_height_); return chroma_height_; }
321 
325  int GetNumChromaPlanes() {return num_chroma_planes_; }
326 
330  virtual int GetFrameSize() {CHECK_ZERO("Display width", disp_width_); return disp_width_ * (disp_height_ + (chroma_height_ * num_chroma_planes_)) * byte_per_pixel_; }
331 
332 
338  uint32_t GetBitDepth() {return (bitdepth_minus_8_ + 8); }
339  uint32_t GetBytePerPixel() {CHECK_ZERO("Bytes per pixel", byte_per_pixel_); return byte_per_pixel_; }
343  size_t GetSurfaceSize() {CHECK_ZERO("Surface size", surface_size_); return surface_size_; }
344  uint32_t GetSurfaceStride() {CHECK_ZERO("Surface stride", surface_stride_); return surface_stride_; }
345  //RocDecImageFormat GetSubsampling() { return subsampling_; }
352  const char *GetCodecFmtName(rocDecVideoCodec codec_id);
353 
360  const char *GetSurfaceFmtName(rocDecVideoSurfaceFormat surface_format_id);
361 
369  virtual bool GetOutputSurfaceInfo(OutputSurfaceInfo **surface_info);
370 
378  bool SetReconfigParams(ReconfigParams *p_reconfig_params, bool b_force_reconfig_flush = false);
379 
396  virtual int DecodeFrame(const uint8_t *data, size_t size, int pkt_flags, int64_t pts = 0, int *num_decoded_pics = nullptr);
401  virtual uint8_t* GetFrame(int64_t *pts);
402 
411  virtual bool ReleaseFrame(int64_t pTimestamp, bool b_flushing = false);
412 
421  //void SaveImage(std::string output_file_name, void* dev_mem, OutputImageInfo* image_info, bool is_output_RGB = 0);
422 
432  void GetDeviceinfo(std::string &device_name, std::string &gcn_arch_name, int &pci_bus_id, int &pci_domain_id, int &pci_device_id);
433 
442  virtual void SaveFrameToFile(std::string output_file_name, void *surf_mem, OutputSurfaceInfo *surf_info, size_t rgb_image_size = 0);
443 
447  virtual void ResetSaveFrameToFile();
448 
454  int32_t GetNumOfFlushedFrames() { return num_frames_flushed_during_reconfig_;}
455 
459 
460  // Session overhead refers to decoder initialization and deinitialization time
461  void AddDecoderSessionOverHead(std::thread::id session_id, double duration) { session_overhead_[session_id] += duration; }
462  double GetDecoderSessionOverHead(std::thread::id session_id) {
463  if (session_overhead_.find(session_id) != session_overhead_.end()) {
464  return session_overhead_[session_id];
465  } else {
466  return 0;
467  }
468  }
469 
475  bool CodecSupported(int device_id, rocDecVideoCodec codec_id, uint32_t bit_depth);
476 
480  virtual int ReconfigureDecoder(RocdecVideoFormat *p_video_format);
481 
482  protected:
486  static int ROCDECAPI HandleVideoSequenceProc(void *p_user_data, RocdecVideoFormat *p_video_format) { return ((RocVideoDecoder *)p_user_data)->HandleVideoSequence(p_video_format); }
487 
491  static int ROCDECAPI HandlePictureDecodeProc(void *p_user_data, RocdecPicParams *p_pic_params) { return ((RocVideoDecoder *)p_user_data)->HandlePictureDecode(p_pic_params); }
492 
496  static int ROCDECAPI HandlePictureDisplayProc(void *p_user_data, RocdecParserDispInfo *p_disp_info) { return ((RocVideoDecoder *)p_user_data)->HandlePictureDisplay(p_disp_info); }
497 
501  static int ROCDECAPI HandleSEIMessagesProc(void *p_user_data, RocdecSeiMessageInfo *p_sei_message_info) { return ((RocVideoDecoder *)p_user_data)->GetSEIMessage(p_sei_message_info); }
502 
508 
514 
523  int GetSEIMessage(RocdecSeiMessageInfo *p_sei_message_info);
524 
532 
537  bool InitHIP(int device_id);
538 
543  std::chrono::system_clock::time_point StartTimer();
544 
549  double StopTimer(const std::chrono::system_clock::time_point &start_time);
550 
551  int num_devices_;
552  int device_id_;
553  RocdecVideoParser rocdec_parser_ = nullptr;
554  rocDecDecoderHandle roc_decoder_ = nullptr;
555  OutputSurfaceMemoryType out_mem_type_ = OUT_SURFACE_MEM_DEV_INTERNAL;
556  rocDecVideoCodec codec_id_ = rocDecVideoCodec_NumCodecs;
557  bool b_force_zero_latency_ = false;
558  bool b_extract_sei_message_ = false;
559  uint32_t disp_delay_;
560  ReconfigParams *p_reconfig_params_ = nullptr;
561  bool b_force_recofig_flush_ = false;
562  int32_t num_frames_flushed_during_reconfig_ = 0;
563  hipDeviceProp_t hip_dev_prop_;
564  hipStream_t hip_stream_ = nullptr;
565  rocDecVideoChromaFormat video_chroma_format_ = rocDecVideoChromaFormat_420;
566  rocDecVideoSurfaceFormat video_surface_format_ = rocDecVideoSurfaceFormat_NV12;
567  RocdecSeiMessageInfo *curr_sei_message_ptr_ = nullptr;
568  RocdecSeiMessageInfo sei_message_display_q_[MAX_FRAME_NUM];
569  RocdecVideoFormat *curr_video_format_ptr_ = nullptr;
570  int output_frame_cnt_ = 0, output_frame_cnt_ret_ = 0;
571  int decoded_pic_cnt_ = 0;
572  int decode_poc_ = 0, pic_num_in_dec_order_[MAX_FRAME_NUM];
573  int num_alloced_frames_ = 0;
574  int last_decode_surf_idx_ = 0;
575  std::ostringstream input_video_info_str_;
576  int bitdepth_minus_8_ = 0;
577  uint32_t byte_per_pixel_ = 1;
578  uint32_t coded_width_ = 0;
579  uint32_t disp_width_ = 0;
580  uint32_t coded_height_ = 0;
581  uint32_t disp_height_ = 0;
582  uint32_t target_width_ = 0;
583  uint32_t target_height_ = 0;
584  int max_width_ = 0, max_height_ = 0;
585  uint32_t chroma_height_ = 0, chroma_width_ = 0;
586  uint32_t num_decode_surfaces_ = 0;
587  uint32_t num_chroma_planes_ = 0;
588  uint32_t num_components_ = 0;
589  uint32_t surface_stride_ = 0;
590  uint32_t surface_vstride_ = 0, chroma_vstride_ = 0; // vertical stride between planes: used when using internal dev memory
591  size_t surface_size_ = 0;
592  OutputSurfaceInfo output_surface_info_ = {};
593  std::mutex mtx_vp_frame_;
594  std::vector<DecFrameBuffer> vp_frames_; // vector of decoded frames
595  std::queue<DecFrameBuffer> vp_frames_q_;
596  Rect disp_rect_ = {}; // displayable area specified in the bitstream
597  Rect crop_rect_ = {}; // user specified region of interest within diplayable area disp_rect_
598  FILE *fp_sei_ = NULL;
599  FILE *fp_out_ = NULL;
600  bool is_output_surface_changed_ = false;
601  std::string current_output_filename = "";
602  uint32_t extra_output_file_count_ = 0;
603  std::thread::id decoder_session_id_; // Decoder session identifier. Used to gather session level stats.
604  std::unordered_map<std::thread::id, double> session_overhead_; // Records session overhead of initialization+deinitialization time. Format is (thread id, duration)
605 };
Definition: roc_video_dec.h:184
High-level video decoder utility class that wraps the rocDecode core APIs to create,...
Definition: roc_video_dec.h:278
virtual void ResetSaveFrameToFile()
Helper function to close an existing file and dump to new file in case of multiple files using same d...
virtual bool GetOutputSurfaceInfo(OutputSurfaceInfo **surface_info)
Get the pointer to the Output Image Info.
virtual bool ReleaseFrame(int64_t pTimestamp, bool b_flushing=false)
function to release frame after use by the application: Only used with "OUT_SURFACE_MEM_DEV_INTERNAL"
int FlushAndReconfigure()
Function to force Reconfigure Flush: needed for random seeking to key frames.
void WaitForDecodeCompletion()
Function to wait for the decode completion of the last submitted picture.
int32_t GetNumOfFlushedFrames()
Get the Num Of Flushed Frames from video decoder object.
Definition: roc_video_dec.h:454
const char * GetCodecFmtName(rocDecVideoCodec codec_id)
Get the name of the output format.
uint32_t GetWidth()
Get the output frame width.
Definition: roc_video_dec.h:305
int GetNumChromaPlanes()
This function is used to get the number of chroma planes.
Definition: roc_video_dec.h:325
virtual int ReconfigureDecoder(RocdecVideoFormat *p_video_format)
This function reconfigure decoder if there is a change in sequence params.
static int ROCDECAPI HandlePictureDisplayProc(void *p_user_data, RocdecParserDispInfo *p_disp_info)
Callback function to be registered for getting a callback when a decoded frame is available for displ...
Definition: roc_video_dec.h:496
double StopTimer(const std::chrono::system_clock::time_point &start_time)
Function to get elapsed time.
int HandlePictureDisplay(RocdecParserDispInfo *p_disp_info)
This function gets called after a picture is decoded and available for display. Frames are fetched an...
int GetChromaHeight()
This function is used to get the current chroma height.
Definition: roc_video_dec.h:320
uint32_t GetHeight()
Get the output frame height.
Definition: roc_video_dec.h:315
int GetSEIMessage(RocdecSeiMessageInfo *p_sei_message_info)
This function gets called when all unregistered user SEI messages are parsed for a frame.
uint32_t GetBitDepth()
Get the Bit Depth and BytesPerPixel associated with the pixel format.
Definition: roc_video_dec.h:338
static int ROCDECAPI HandlePictureDecodeProc(void *p_user_data, RocdecPicParams *p_pic_params)
Callback function to be registered for getting a callback when a decoded frame is ready to be decoded...
Definition: roc_video_dec.h:491
bool InitHIP(int device_id)
Function to Initialize GPU-HIP.
bool ReleaseInternalFrames()
function to release all internal frames and clear the vp_frames_q_ (used with reconfigure): Only used...
virtual uint8_t * GetFrame(int64_t *pts)
This function returns a decoded frame and timestamp. This should be called in a loop fetching all the...
virtual void SaveFrameToFile(std::string output_file_name, void *surf_mem, OutputSurfaceInfo *surf_info, size_t rgb_image_size=0)
Helper function to dump decoded output surface to file.
void GetDeviceinfo(std::string &device_name, std::string &gcn_arch_name, int &pci_bus_id, int &pci_domain_id, int &pci_device_id)
utility function to save image to a file
bool CodecSupported(int device_id, rocDecVideoCodec codec_id, uint32_t bit_depth)
Check if the given Video Codec is supported on the given GPU.
virtual int GetFrameSize()
This function is used to get the current frame size based on pixel format.
Definition: roc_video_dec.h:330
const char * GetSurfaceFmtName(rocDecVideoSurfaceFormat surface_format_id)
function to return the name from surface_format_id
std::chrono::system_clock::time_point StartTimer()
Function to get start time.
size_t GetSurfaceSize()
Functions to get the output surface attributes.
Definition: roc_video_dec.h:343
static int ROCDECAPI HandleSEIMessagesProc(void *p_user_data, RocdecSeiMessageInfo *p_sei_message_info)
Callback function to be registered for getting a callback when all the unregistered user SEI Messages...
Definition: roc_video_dec.h:501
virtual int DecodeFrame(const uint8_t *data, size_t size, int pkt_flags, int64_t pts=0, int *num_decoded_pics=nullptr)
this function decodes a frame and returns the number of frames available for display
int GetDecodeWidth()
This function is used to get the actual decode width.
Definition: roc_video_dec.h:310
RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool force_zero_latency=false, const Rect *p_crop_rect=nullptr, bool extract_user_SEI_Message=false, uint32_t disp_delay=0, int max_width=0, int max_height=0, uint32_t clk_rate=1000, bool skip_init=false)
Construct a new Roc Video Decoder object.
int HandlePictureDecode(RocdecPicParams *p_pic_params)
This function gets called when a picture is ready to be decoded. rocDecDecodeFrame is called from thi...
bool SetReconfigParams(ReconfigParams *p_reconfig_params, bool b_force_reconfig_flush=false)
Function to set the Reconfig Params object.
int HandleVideoSequence(RocdecVideoFormat *p_video_format)
This function gets called when a sequence is ready to be decoded. The function also gets called when ...
static int ROCDECAPI HandleVideoSequenceProc(void *p_user_data, RocdecVideoFormat *p_video_format)
Callback function to be registered for getting a callback when decoding of sequence starts.
Definition: roc_video_dec.h:486
OutputSurfaceMemoryType_enum
Definition: roc_video_dec.h:135
@ OUT_SURFACE_MEM_HOST_COPIED
Definition: roc_video_dec.h:138
@ OUT_SURFACE_MEM_DEV_COPIED
Definition: roc_video_dec.h:137
@ OUT_SURFACE_MEM_DEV_INTERNAL
Definition: roc_video_dec.h:136
@ OUT_SURFACE_MEM_NOT_MAPPED
Definition: roc_video_dec.h:139
The AMD rocDecode Library.
@ rocDecVideoCodec_NumCodecs
Definition: rocdecode.h:87
@ rocDecVideoSurfaceFormat_Native
Definition: rocdecode.h:117
@ rocDecVideoSurfaceFormat_YUV420
Definition: rocdecode.h:111
@ rocDecVideoSurfaceFormat_YUV422
Definition: rocdecode.h:114
@ rocDecVideoSurfaceFormat_YUV444_16Bit
Definition: rocdecode.h:109
@ rocDecVideoSurfaceFormat_YUV420_16Bit
Definition: rocdecode.h:112
@ rocDecVideoSurfaceFormat_P016
Definition: rocdecode.h:106
@ rocDecVideoSurfaceFormat_NV12
Definition: rocdecode.h:105
@ rocDecVideoSurfaceFormat_YUV422_16Bit
Definition: rocdecode.h:115
@ rocDecVideoSurfaceFormat_YUV444
Definition: rocdecode.h:108
void * rocDecDecoderHandle
Definition: rocdecode.h:51
@ rocDecVideoChromaFormat_422
Definition: rocdecode.h:135
@ rocDecVideoChromaFormat_444
Definition: rocdecode.h:136
@ rocDecVideoChromaFormat_420
Definition: rocdecode.h:134
@ rocDecVideoChromaFormat_Monochrome
Definition: rocdecode.h:133
The AMD rocParser Library.
void * RocdecVideoParser
Definition: rocparser.h:46
Definition: roc_video_dec.h:245
uint8_t * frame_ptr
Definition: roc_video_dec.h:246
int picture_index
Definition: roc_video_dec.h:248
int64_t pts
Definition: roc_video_dec.h:247
Definition: roc_video_dec.h:237
Definition: roc_video_dec.h:252
uint32_t output_vstride
Definition: roc_video_dec.h:256
uint32_t output_pitch
Definition: roc_video_dec.h:255
uint32_t output_height
Definition: roc_video_dec.h:254
uint32_t chroma_height
Definition: roc_video_dec.h:257
uint64_t output_surface_size_in_bytes
Definition: roc_video_dec.h:262
uint32_t num_chroma_planes
Definition: roc_video_dec.h:261
uint32_t bit_depth
Definition: roc_video_dec.h:260
uint32_t bytes_per_pixel
Definition: roc_video_dec.h:259
rocDecVideoSurfaceFormat surface_format
Definition: roc_video_dec.h:263
Rect disp_rect
Definition: roc_video_dec.h:258
uint32_t output_width
Definition: roc_video_dec.h:253
OutputSurfaceMemoryType mem_type
Definition: roc_video_dec.h:264
Definition: roc_video_dec.h:267
Definition: roc_video_dec.h:230
Timing Info struct\Used in rocdecParseVideoData API with PFNVIDDISPLAYCALLBACK pfn_display_picture.
ROCDEC_VIDEO_FORMAT structUsed in Parser callback API.
Definition: rocparser.h:64
Definition: rocdecode.h:1628