Skip to content

Commit

Permalink
EncoderConfig: fix BPP rounding logic
Browse files Browse the repository at this point in the history
The ceil computation does not work as expected, and implicitly requires
a C++ stanadard library exposing C++23 features
  • Loading branch information
Reed Koser authored and zlatinski committed Dec 11, 2024
1 parent 6f7bc4d commit 952bb40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vk_video_encoder/libs/VkVideoEncoder/VkEncoderConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class EncoderInputFileHandler
}

uint32_t GetFrameCount(uint32_t width, uint32_t height, uint8_t bpp, VkVideoChromaSubsamplingFlagBitsKHR chromaSubsampling) {
uint8_t nBytes = (uint8_t)std::ceil ( bpp / 8);
uint8_t nBytes = (bpp + 7) / 8;
double samplingFactor = 1.5;
switch (chromaSubsampling)
{
Expand Down

0 comments on commit 952bb40

Please sign in to comment.