| @@ -80,6 +80,20 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h · 79 unmodified lines |
| 80 | 80 | return 0; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | +static int decode_decoded_picture_hash(H274SEIPictureHash *h, const SEIRawDecodedPictureHash *s) |
| 84 | +{ |
| 85 | + h->present = 1; |
| 86 | + h->hash_type = s->dph_sei_hash_type; |
| 87 | + if (h->hash_type == 0) |
| 88 | + memcpy(h->md5, s->dph_sei_picture_md5, sizeof(h->md5)); |
| 89 | + else if (h->hash_type == 1) |
| 90 | + memcpy(h->crc, s->dph_sei_picture_crc, sizeof(h->crc)); |
| 91 | + else if (h->hash_type == 2) |
| 92 | + memcpy(h->checksum, s->dph_sei_picture_checksum, sizeof(h->checksum)); |
| 93 | + |
| 94 | + return 0; |
| 95 | +} |
| 96 | + |
| 83 | 97 | int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc) |
| 84 | 98 | { |
| 85 | 99 | H2645SEI *c = &s->common; |
| @@ -99,6 +113,9 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon · 13 unmodified lines |
| 99 | 113 | return AVERROR(ENOMEM); |
| 100 | 114 | return decode_film_grain_characteristics(c->film_grain_characteristics, payload, fc); |
| 101 | 115 | |
| 116 | + case SEI_TYPE_DECODED_PICTURE_HASH: |
| 117 | + return decode_decoded_picture_hash(&s->picture_hash, payload); |
| 118 | + |
| 102 | 119 | default: |
| 103 | 120 | av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n", |
| 104 | 121 | 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 · 7 unmodified lines |
| 112 | 129 | |
| 113 | 130 | int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src) |
| 114 | 131 | { |
| 132 | + dst->picture_hash.present = 0; // drop hash |
| 115 | 133 | return ff_h2645_sei_ctx_replace(&dst->common, &src->common); |
| 116 | 134 | } |
| 117 | 135 | |
| 118 | 136 | void ff_vvc_sei_reset(VVCSEI *s) |
| 119 | 137 | { |
| 120 | 138 | ff_h2645_sei_reset(&s->common); |
| 139 | + s->picture_hash.present = 0; |
| 121 | 140 | } |