Decoder utility: Removed a couple of incorrect asserts. (#574)

* * Decoder utility: Removed a couple of incorrect asserts. Changed other asserts to error messages.

* * Changed rocDecode version from 0.12.0 to 0.13.0. Updated change log.

* * Decoder utility: Updated change log based on review comments.

* * Decoder utility: Minor format change based on review: removed the extra space.
此提交包含在:
jeffqjiangNew
2025-04-29 16:41:36 -04:00
提交者 GitHub
父節點 7e5a3f6939
當前提交 4b10fa5a1a
共有 3 個檔案被更改,包括 17 行新增14 行删除
+2 -1
查看文件
@@ -2,7 +2,7 @@
Full documentation for rocDecode is available at [https://rocm.docs.amd.com/projects/rocDecode/en/latest/](https://rocm.docs.amd.com/projects/rocDecode/en/latest/)
## rocDecode 0.12.0 for ROCm 6.5
## rocDecode 0.13.0 for ROCm 6.5
### Added
@@ -22,6 +22,7 @@ Full documentation for rocDecode is available at [https://rocm.docs.amd.com/proj
* Fixed a bug in picture files sample "videoDecodePicFiles" that can results in incorrect output frame count.
* Fixed a decoded frame output issue in video size change cases.
* Removed incorrect asserts of bitdepth_minus_8 in GetBitDepth() and num_chroma_planes in GetNumChromaPlanes() API calls in RocVideoDecoder utility class.
### Removed
+1 -1
查看文件
@@ -40,7 +40,7 @@ if (NOT DEFINED CMAKE_CXX_COMPILER)
endif()
# rocDecode Version
set(VERSION "0.12.0")
set(VERSION "0.13.0")
# Set Project Version and Language
project(rocdecode VERSION ${VERSION} LANGUAGES CXX)
+14 -12
查看文件
@@ -22,7 +22,6 @@ THE SOFTWARE.
#pragma once
#include <assert.h>
#include <stdint.h>
#include <mutex>
#include <vector>
@@ -114,7 +113,6 @@ inline float GetChromaHeightFactor(rocDecVideoSurfaceFormat surface_format) {
return factor;
};
class RocVideoDecodeException : public std::exception {
public:
@@ -154,6 +152,10 @@ private:
} \
while (0)
#define CHECK_ZERO(str, value) \
if (value == 0) { \
ROCDEC_ERR(STR(str) + " is 0."); \
}
struct Rect {
int left;
@@ -224,32 +226,32 @@ class RocVideoDecoder {
/**
* @brief Get the output frame width
*/
uint32_t GetWidth() { assert(disp_width_); return disp_width_;}
uint32_t GetWidth() {CHECK_ZERO("Display width", disp_width_); return disp_width_;}
/**
* @brief This function is used to get the actual decode width
*/
int GetDecodeWidth() { assert(coded_width_); return coded_width_; }
int GetDecodeWidth() {CHECK_ZERO("Coded width", coded_width_); return coded_width_; }
/**
* @brief Get the output frame height
*/
uint32_t GetHeight() { assert(disp_height_); return disp_height_; }
uint32_t GetHeight() {CHECK_ZERO("Display height", disp_height_); return disp_height_; }
/**
* @brief This function is used to get the current chroma height.
*/
int GetChromaHeight() { assert(chroma_height_); return chroma_height_; }
int GetChromaHeight() {CHECK_ZERO("Chroma height", chroma_height_); return chroma_height_; }
/**
* @brief This function is used to get the number of chroma planes.
*/
int GetNumChromaPlanes() { assert(num_chroma_planes_); return num_chroma_planes_; }
int GetNumChromaPlanes() {return num_chroma_planes_; }
/**
* @brief This function is used to get the current frame size based on pixel format.
*/
virtual int GetFrameSize() { assert(disp_width_); return disp_width_ * (disp_height_ + (chroma_height_ * num_chroma_planes_)) * byte_per_pixel_; }
virtual int GetFrameSize() {CHECK_ZERO("Display width", disp_width_); return disp_width_ * (disp_height_ + (chroma_height_ * num_chroma_planes_)) * byte_per_pixel_; }
/**
@@ -257,13 +259,13 @@ class RocVideoDecoder {
*
* @return uint32_t
*/
uint32_t GetBitDepth() { assert(bitdepth_minus_8_); return (bitdepth_minus_8_ + 8); }
uint32_t GetBytePerPixel() { assert(byte_per_pixel_); return byte_per_pixel_; }
uint32_t GetBitDepth() {return (bitdepth_minus_8_ + 8); }
uint32_t GetBytePerPixel() {CHECK_ZERO("Bytes per pixel", byte_per_pixel_); return byte_per_pixel_; }
/**
* @brief Functions to get the output surface attributes
*/
size_t GetSurfaceSize() { assert(surface_size_); return surface_size_; }
uint32_t GetSurfaceStride() { assert(surface_stride_); return surface_stride_; }
size_t GetSurfaceSize() {CHECK_ZERO("Surface size", surface_size_); return surface_size_; }
uint32_t GetSurfaceStride() {CHECK_ZERO("Surface stride", surface_stride_); return surface_stride_; }
//RocDecImageFormat GetSubsampling() { return subsampling_; }
/**
* @brief Get the name of the output format