Skip to content

Commit 66df6a9

Browse files
authored
Merge pull request #327 from avTranscoder/dev/ffmpeg_5.0
FFmpeg 5.0
2 parents ff94632 + cac5c37 commit 66df6a9

File tree

3 files changed

+12
-24
lines changed

3 files changed

+12
-24
lines changed

src/AvTranscoder/properties/PixelProperties.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,11 @@ bool PixelProperties::isRgbPixelData() const
204204
return (_pixelDesc->flags & AV_PIX_FMT_FLAG_RGB) == AV_PIX_FMT_FLAG_RGB;
205205
}
206206

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

212211
return (_pixelDesc->flags & AV_PIX_FMT_FLAG_PAL) == AV_PIX_FMT_FLAG_PAL;
213-
#elif LIBAVCODEC_VERSION_MAJOR > 53
214-
bool PixelProperties::isPseudoPaletted() const {
215-
if (!_pixelDesc)
216-
throw std::runtime_error("unable to find pixel description.");
217-
218-
return (_pixelDesc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) == AV_PIX_FMT_FLAG_PSEUDOPAL;
219-
#else
220-
return false;
221-
#endif
222212
}
223213

224214
std::vector<Channel> PixelProperties::getChannels() const

src/AvTranscoder/properties/PixelProperties.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ class AvExport PixelProperties
7171
bool isBitWisePacked() const;
7272
bool isHardwareAccelerated() const;
7373
bool isRgbPixelData() const;
74-
#if LIBAVCODEC_VERSION_MAJOR > 58
7574
bool isPaletted() const;
76-
#else
77-
bool isPseudoPaletted() const;
78-
#endif
7975

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

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -673,22 +673,24 @@ void Transcoder::fillProcessStat(ProcessStat& processStat)
673673
// uint8_t picture_type = coded_frame[4];
674674
uint8_t error_count = coded_frame[5];
675675

676-
uint64_t errors[error_count];
676+
std::vector<uint64_t> errors;
677677
for (int i = 0; i < error_count; ++i)
678678
{
679679
int index = 6 + i;
680-
errors[i] = (uint64_t) coded_frame[index + 7] << 56 |
681-
(uint64_t) coded_frame[index + 6] << 48 |
682-
(uint64_t) coded_frame[index + 5] << 40 |
683-
(uint64_t) coded_frame[index + 4] << 32 |
684-
(uint64_t) coded_frame[index + 3] << 24 |
685-
(uint64_t) coded_frame[2] << 16 |
686-
(uint64_t) coded_frame[1] << 8 |
687-
(uint64_t) coded_frame[0];
680+
errors.push_back(
681+
(uint64_t) coded_frame[index + 7] << 56 |
682+
(uint64_t) coded_frame[index + 6] << 48 |
683+
(uint64_t) coded_frame[index + 5] << 40 |
684+
(uint64_t) coded_frame[index + 4] << 32 |
685+
(uint64_t) coded_frame[index + 3] << 24 |
686+
(uint64_t) coded_frame[2] << 16 |
687+
(uint64_t) coded_frame[1] << 8 |
688+
(uint64_t) coded_frame[0]
689+
);
688690
}
689691

690692
videoStat.setQuality(quality);
691-
videoStat.setPSNR((double) errors[0] /
693+
videoStat.setPSNR((double) errors.at(0) /
692694
(encoderContext.width * encoderContext.height * 255.0 * 255.0));
693695
}
694696
}

0 commit comments

Comments
 (0)
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