| 372 | } |
| 373 | |
| 374 | void 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 | |
| 404 | void HRD::removeFromBufferAndCheck(const HRDFrameToRemove &frame, |
| 405 | int poc, |