Skip to content

Commit

Permalink
Fixed some clang warnings / errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Feb 22, 2021
1 parent ca13165 commit 2d29d61
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion YUViewLib/src/decoder/decoderVVDec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ bool decoderVVDec::getNextFrameFromDecoder()
return setErrorB("Received a frame of different size");
if (this->formatYUV.subsampling != subsampling)
return setErrorB("Received a frame with different subsampling");
if (this->formatYUV.bitsPerSample != bitDepth)
if (unsigned(this->formatYUV.bitsPerSample) != bitDepth)
return setErrorB("Received a frame with different bit depth");
}

Expand Down
1 change: 0 additions & 1 deletion YUViewLib/src/decoder/decoderVVDec.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class decoderVVDec : public decoderBaseSingleLib
// Try to get the next picture from the decoder and save it in currentHMPic
bool getNextFrameFromDecoder();

bool internalsSupported{false};
int nrSignals{0};
bool flushing{false};

Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/src/filesource/FileSourceFFmpegFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ std::pair<int64_t, size_t> FileSourceFFmpegFile::getClosestSeekableFrameBefore(i
{
if (pic.frame >= 0)
{
if (pic.frame <= frameIdx)
if (frameIdx > 0 && pic.frame <= unsigned(frameIdx))
{
// We could seek here
bestSeekDTS = pic.dts;
Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/src/parser/AnnexB.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class AnnexB : public Base
fileStartEndPos; //< The start and end position of all slice NAL units (if known)
bool randomAccessPoint{false}; //< Can we start decoding here?

bool operator<(AnnexBFrame const &b) { return (this->poc < b.poc); }
bool operator<(AnnexBFrame const &b) const { return (this->poc < b.poc); }
};

// Returns false if the POC was already present int the list
Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/src/parser/VVC/AnnexBVVC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ std::optional<AnnexB::SeekData> AnnexBVVC::getSeekData(int iFrameNr)
continue;
}

if (picHeader->PicOrderCntVal == seekPOC)
if (seekPOC >= 0 && picHeader->PicOrderCntVal == unsigned(seekPOC))
{
// Seek here
AnnexB::SeekData seekData;
Expand Down
8 changes: 4 additions & 4 deletions YUViewLib/src/parser/VVC/ref_pic_list_struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void ref_pic_list_struct::parse(SubByteReaderLogging & reader,
{
this->st_ref_pic_flag[i] = reader.readFlag(formatArray("st_ref_pic_flag", i));
}
if (this->getStRefPicFlag(listIdx, rplsIdx, i))
if (this->getStRefPicFlag(i))
{
this->abs_delta_poc_st[i] = reader.readUEV(formatArray("abs_delta_poc_st", i));

Expand Down Expand Up @@ -99,17 +99,17 @@ void ref_pic_list_struct::parse(SubByteReaderLogging & reader,
// (148)
this->NumLtrpEntries = 0;
for (unsigned i = 0; i < this->num_ref_entries; i++)
if (!this->inter_layer_ref_pic_flag[i] && !this->getStRefPicFlag(listIdx, rplsIdx, i))
if (!this->inter_layer_ref_pic_flag[i] && !this->getStRefPicFlag(i))
this->NumLtrpEntries++;

// (150)
for (unsigned i = 0; i < this->num_ref_entries; i++)
if (!this->inter_layer_ref_pic_flag[i] && this->getStRefPicFlag(listIdx, rplsIdx, i))
if (!this->inter_layer_ref_pic_flag[i] && this->getStRefPicFlag(i))
this->DeltaPocValSt[i] =
(1 - 2 * int(this->strp_entry_sign_flag[i])) * this->AbsDeltaPocSt[i];
}

bool ref_pic_list_struct::getStRefPicFlag(unsigned listIdx, unsigned rplsIdx, unsigned i)
bool ref_pic_list_struct::getStRefPicFlag(unsigned i)
{
// The default value of a non existent st_ref_pic_flag is true
if (!this->inter_layer_ref_pic_flag[i] && this->st_ref_pic_flag.count(i) == 0)
Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/src/parser/VVC/ref_pic_list_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ref_pic_list_struct
umap_1d<int> DeltaPocValSt;

private:
bool getStRefPicFlag(unsigned listIdx, unsigned rplsIdx, unsigned i);
bool getStRefPicFlag(unsigned i);
};

} // namespace parser::vvc
4 changes: 2 additions & 2 deletions YUViewLib/src/playlistitem/playlistItemCompressedVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void playlistItemCompressedVideo::loadRawData(int frameIdx, bool caching)
std::tie(seekToDTS, seekToFrame) = inputFileFFmpegLoading->getClosestSeekableFrameBefore(frameIdx);
}

if (curFrameIdx == -1 || seekToFrame > curFrameIdx + FORWARD_SEEK_THRESHOLD)
if (curFrameIdx < 0 || seekToFrame > unsigned(curFrameIdx) + FORWARD_SEEK_THRESHOLD)
{
// A seek forward makes sense
seek = true;
Expand Down Expand Up @@ -564,7 +564,7 @@ void playlistItemCompressedVideo::loadRawData(int frameIdx, bool caching)
{
// We are reading from a raw annexB file and use ffmpeg for decoding
QByteArray data;
if (readAnnexBFrameCounterCodingOrder >= inputFileAnnexBParser->getNumberPOCs())
if (readAnnexBFrameCounterCodingOrder >= 0 && unsigned(readAnnexBFrameCounterCodingOrder) >= inputFileAnnexBParser->getNumberPOCs())
{
DEBUG_COMPRESSED("playlistItemCompressedVideo::loadRawData EOF");
}
Expand Down

0 comments on commit 2d29d61

Please sign in to comment.