avcodec/h2645_sei: Also support Active Format Descriptor for HEVC

It is valid for HEVC; in fact, the ATSC-HEVC spec [1] simply
refers to the relevant H.264 spec.

It is also trivial to implement now: Just move applying AFD
to ff_h2645_sei_to_frame() and stop ignoring AFD when parsing
a HEVC SEI containing it.

A FATE-test for this has been added.

[1]: https://www.atsc.org/atsc-documents/a3412017-video-hevc/

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2022-07-02 14:20:36 +02:00
parent 01e775f4b7
commit a5bba606a0
5 changed files with 221 additions and 17 deletions

View File

@@ -1226,16 +1226,6 @@ static int h264_export_frame_props(H264Context *h)
}
}
if (h->sei.common.afd.present) {
AVFrameSideData *sd = av_frame_new_side_data(out, AV_FRAME_DATA_AFD,
sizeof(uint8_t));
if (sd) {
*sd->data = h->sei.common.afd.active_format_description;
h->sei.common.afd.present = 0;
}
}
ret = ff_h2645_sei_to_frame(out, &h->sei.common, AV_CODEC_ID_H264, h->avctx);
if (ret < 0)
return ret;