MCPcopy Create free account
hub / github.com/IENT/YUView / addToBufferAndCheck

Method addToBufferAndCheck

YUViewLib/src/parser/AVC/HRD.cpp:374–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374void HRD::addToBufferAndCheck(size_t bufferAdd,
375 size_t bufferSize,
376 int poc,
377 time_t t_begin,
378 time_t t_end,
379 HRDPlotModel *plotModel)
380{
381 const auto bufferOld = this->decodingBufferLevel;
382 this->decodingBufferLevel += bufferAdd;
383
384 {
385 HRDPlotModel::HRDEntry entry;
386 entry.type = HRDPlotModel::HRDEntry::EntryType::Adding;
387 entry.cbp_fullness_start = bufferOld;
388 entry.cbp_fullness_end = this->decodingBufferLevel;
389 entry.time_offset_start = t_begin;
390 entry.time_offset_end = t_end;
391 entry.poc = poc;
392 plotModel->addHRDEntry(entry);
393 }
394 if (this->decodingBufferLevel > int64_t(bufferSize))
395 {
396 this->decodingBufferLevel = bufferSize;
397 DEBUG_AVC_HRD("HRD AU " << this->au_n << " POC " << poc << " - Warning: Time " << double(t_end)
398 << " Decoding Buffer overflow by "
399 << (int(this->decodingBufferLevel) - bufferSize) << "bits"
400 << " added bits " << bufferAdd << ")");
401 }
402}
403
404void HRD::removeFromBufferAndCheck(const HRDFrameToRemove &frame,
405 int poc,

Callers 1

addAUMethod · 0.95

Calls 1

addHRDEntryMethod · 0.80

Tested by

no test coverage detected