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

Method removeFromBufferAndCheck

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

Source from the content-addressed store, hash-verified

402}
403
404void HRD::removeFromBufferAndCheck(const HRDFrameToRemove &frame,
405 int poc,
406 time_t removalTime,
407 HRDPlotModel * plotModel)
408{
409 (void)poc;
410
411 // Remove the frame from the buffer
412 auto bufferSub = frame.bits;
413 const auto bufferOld = this->decodingBufferLevel;
414 this->decodingBufferLevel -= bufferSub;
415 {
416 HRDPlotModel::HRDEntry entry;
417 entry.type = HRDPlotModel::HRDEntry::EntryType::Removal;
418 entry.cbp_fullness_start = bufferOld;
419 entry.cbp_fullness_end = this->decodingBufferLevel;
420 entry.time_offset_start = removalTime;
421 entry.time_offset_end = removalTime;
422 entry.poc = frame.poc;
423 plotModel->addHRDEntry(entry);
424 }
425 if (this->decodingBufferLevel < 0)
426 {
427 // The buffer did underflow; i.e. we need to decode a pictures
428 // at the time but there is not enough data in the buffer to do so (to take the AU
429 // out of the buffer).
430 DEBUG_AVC_HRD("HRD AU " << this->au_n << " POC " << poc << " - Warning: Time "
431 << double(frame.t_r) << " Decoding Buffer underflow by "
432 << this->decodingBufferLevel << "bits");
433 }
434}
435
436void HRD::addConstantBufferLine(int poc, time_t t_begin, time_t t_end, HRDPlotModel *plotModel)
437{

Callers 2

addAUMethod · 0.95
endOfFileMethod · 0.95

Calls 1

addHRDEntryMethod · 0.80

Tested by

no test coverage detected