History

avdovi/dovi_rpudec: handle prev_vdr_rpu_id failures

According to the spec, missing previous VDR RPU IDs do not constitute an error, but we should instead fallback first to VDR RPU with ID 0, and failing that, synthesize "neutral" metadata. That's nontrivial though as the resulting metadata will be dependent on other properties of the RPU, and this case is not hit in practice so I'll defer it to a rainy day.

Niklas Haas committed 2 years ago

Commit e1b91eb1 parent 954f8901 file · +5 −0Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/dovi_rpudec.c+5−0
@@ -456,7 +456,12 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, · 455 unmodified lines
456 if (use_prev_vdr_rpu) {456 if (use_prev_vdr_rpu) {
457 int prev_vdr_rpu_id = get_ue_golomb_31(gb);457 int prev_vdr_rpu_id = get_ue_golomb_31(gb);
458 VALIDATE(prev_vdr_rpu_id, 0, DOVI_MAX_DM_ID);458 VALIDATE(prev_vdr_rpu_id, 0, DOVI_MAX_DM_ID);
459 if (!s->vdr[prev_vdr_rpu_id])
460 prev_vdr_rpu_id = 0;
459 if (!s->vdr[prev_vdr_rpu_id]) {461 if (!s->vdr[prev_vdr_rpu_id]) {
462 /* FIXME: Technically, the spec says that in this case we should
463 * synthesize "neutral" vdr metadata, but easier to just error
464 * out as this corner case is not hit in practice */
460 av_log(s->logctx, AV_LOG_ERROR, "Unknown previous RPU ID: %u\n",465 av_log(s->logctx, AV_LOG_ERROR, "Unknown previous RPU ID: %u\n",
461 prev_vdr_rpu_id);466 prev_vdr_rpu_id);
462 goto fail;467 goto fail;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t