ffmpeg | branch: master | Wu Jianhua <toq...@outlook.com> | Sun Apr 27 19:44:39 2025 +0800| [8dfc24cdce634c78bca405afba5ea2b0db50905d] | committer: Nuo Mi
avcodec/vvc/sei: add decode_decoded_picture_hash Signed-off-by: Wu Jianhua <toq...@outlook.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8dfc24cdce634c78bca405afba5ea2b0db50905d --- libavcodec/vvc/sei.c | 19 +++++++++++++++++++ libavcodec/vvc/sei.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/libavcodec/vvc/sei.c b/libavcodec/vvc/sei.c index 365f815950..2d81ae5908 100644 --- a/libavcodec/vvc/sei.c +++ b/libavcodec/vvc/sei.c @@ -80,6 +80,20 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h return 0; } +static int decode_decoded_picture_hash(H274SEIPictureHash *h, const SEIRawDecodedPictureHash *s) +{ + h->present = 1; + h->hash_type = s->dph_sei_hash_type; + if (h->hash_type == 0) + memcpy(h->md5, s->dph_sei_picture_md5, sizeof(h->md5)); + else if (h->hash_type == 1) + memcpy(h->crc, s->dph_sei_picture_crc, sizeof(h->crc)); + else if (h->hash_type == 2) + memcpy(h->checksum, s->dph_sei_picture_checksum, sizeof(h->checksum)); + + return 0; +} + int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc) { H2645SEI *c = &s->common; @@ -99,6 +113,9 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon return AVERROR(ENOMEM); return decode_film_grain_characteristics(c->film_grain_characteristics, payload, fc); + case SEI_TYPE_DECODED_PICTURE_HASH: + return decode_decoded_picture_hash(&s->picture_hash, payload); + default: av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n", sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ? @@ -112,10 +129,12 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src) { + dst->picture_hash.present = 0; // drop hash return ff_h2645_sei_ctx_replace(&dst->common, &src->common); } void ff_vvc_sei_reset(VVCSEI *s) { ff_h2645_sei_reset(&s->common); + s->picture_hash.present = 0; } diff --git a/libavcodec/vvc/sei.h b/libavcodec/vvc/sei.h index 17e04cde63..6e4855bf60 100644 --- a/libavcodec/vvc/sei.h +++ b/libavcodec/vvc/sei.h @@ -31,9 +31,11 @@ #include "libavcodec/h2645_sei.h" #include "libavcodec/sei.h" #include "libavcodec/vvc.h" +#include "libavcodec/h274.h" typedef struct VVCSEI { H2645SEI common; + H274SEIPictureHash picture_hash; } VVCSEI; struct VVCFrameContext; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".