Skip to content

FFmpeg 5.0 #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/AvTranscoder/properties/PixelProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,11 @@ bool PixelProperties::isRgbPixelData() const
return (_pixelDesc->flags & AV_PIX_FMT_FLAG_RGB) == AV_PIX_FMT_FLAG_RGB;
}

#if LIBAVCODEC_VERSION_MAJOR > 58
bool PixelProperties::isPaletted() const {
if (!_pixelDesc)
throw std::runtime_error("unable to find pixel description.");

return (_pixelDesc->flags & AV_PIX_FMT_FLAG_PAL) == AV_PIX_FMT_FLAG_PAL;
#elif LIBAVCODEC_VERSION_MAJOR > 53
bool PixelProperties::isPseudoPaletted() const {
if (!_pixelDesc)
throw std::runtime_error("unable to find pixel description.");

return (_pixelDesc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) == AV_PIX_FMT_FLAG_PSEUDOPAL;
#else
return false;
#endif
}

std::vector<Channel> PixelProperties::getChannels() const
Expand Down
4 changes: 0 additions & 4 deletions src/AvTranscoder/properties/PixelProperties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ class AvExport PixelProperties
bool isBitWisePacked() const;
bool isHardwareAccelerated() const;
bool isRgbPixelData() const;
#if LIBAVCODEC_VERSION_MAJOR > 58
bool isPaletted() const;
#else
bool isPseudoPaletted() const;
#endif

std::vector<Channel> getChannels() const;

Expand Down
22 changes: 12 additions & 10 deletions src/AvTranscoder/transcoder/Transcoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,22 +673,24 @@ void Transcoder::fillProcessStat(ProcessStat& processStat)
// uint8_t picture_type = coded_frame[4];
uint8_t error_count = coded_frame[5];

uint64_t errors[error_count];
std::vector<uint64_t> errors;
for (int i = 0; i < error_count; ++i)
{
int index = 6 + i;
errors[i] = (uint64_t) coded_frame[index + 7] << 56 |
(uint64_t) coded_frame[index + 6] << 48 |
(uint64_t) coded_frame[index + 5] << 40 |
(uint64_t) coded_frame[index + 4] << 32 |
(uint64_t) coded_frame[index + 3] << 24 |
(uint64_t) coded_frame[2] << 16 |
(uint64_t) coded_frame[1] << 8 |
(uint64_t) coded_frame[0];
errors.push_back(
(uint64_t) coded_frame[index + 7] << 56 |
(uint64_t) coded_frame[index + 6] << 48 |
(uint64_t) coded_frame[index + 5] << 40 |
(uint64_t) coded_frame[index + 4] << 32 |
(uint64_t) coded_frame[index + 3] << 24 |
(uint64_t) coded_frame[2] << 16 |
(uint64_t) coded_frame[1] << 8 |
(uint64_t) coded_frame[0]
);
}

videoStat.setQuality(quality);
videoStat.setPSNR((double) errors[0] /
videoStat.setPSNR((double) errors.at(0) /
(encoderContext.width * encoderContext.height * 255.0 * 255.0));
}
}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy