Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit66df6a9

Browse files
authored
Merge pull request#327 from avTranscoder/dev/ffmpeg_5.0
FFmpeg 5.0
2 parentsff94632 +cac5c37 commit66df6a9

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
boolPixelProperties::isPaletted()const {
209208
if (!_pixelDesc)
210209
throwstd::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-
boolPixelProperties::isPseudoPaletted()const {
215-
if (!_pixelDesc)
216-
throwstd::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-
returnfalse;
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
boolisBitWisePacked()const;
7272
boolisHardwareAccelerated()const;
7373
boolisRgbPixelData()const;
74-
#if LIBAVCODEC_VERSION_MAJOR > 58
7574
boolisPaletted()const;
76-
#else
77-
boolisPseudoPaletted()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)

[8]ページ先頭

©2009-2025 Movatter.jp