Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -80,6 +80,20 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h · 79 unmodified lines | |||
| 80 | return 0; | 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 | int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc) | 97 | int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc) |
| 84 | { | 98 | { |
| 85 | H2645SEI *c = &s->common; | 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 | return AVERROR(ENOMEM); | 113 | return AVERROR(ENOMEM); |
| 100 | return decode_film_grain_characteristics(c->film_grain_characteristics, payload, fc); | 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 | default: | 119 | default: |
| 103 | av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n", | 120 | av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n", |
| 104 | sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ? | 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 | int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src) | 130 | int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src) |
| 114 | { | 131 | { |
| 132 | dst->picture_hash.present = 0; // drop hash | ||
| 115 | return ff_h2645_sei_ctx_replace(&dst->common, &src->common); | 133 | return ff_h2645_sei_ctx_replace(&dst->common, &src->common); |
| 116 | } | 134 | } |
| 117 | 135 | ||
| 118 | void ff_vvc_sei_reset(VVCSEI *s) | 136 | void ff_vvc_sei_reset(VVCSEI *s) |
| 119 | { | 137 | { |
| 120 | ff_h2645_sei_reset(&s->common); | 138 | ff_h2645_sei_reset(&s->common); |
| 139 | s->picture_hash.present = 0; | ||
| 121 | } | 140 | } |
| @@ -31,9 +31,11 @@ · 30 unmodified lines | |||
| 31 | #include "libavcodec/h2645_sei.h" | 31 | #include "libavcodec/h2645_sei.h" |
| 32 | #include "libavcodec/sei.h" | 32 | #include "libavcodec/sei.h" |
| 33 | #include "libavcodec/vvc.h" | 33 | #include "libavcodec/vvc.h" |
| 34 | #include "libavcodec/h274.h" | ||
| 34 | 35 | ||
| 35 | typedef struct VVCSEI { | 36 | typedef struct VVCSEI { |
| 36 | H2645SEI common; | 37 | H2645SEI common; |
| 38 | H274SEIPictureHash picture_hash; | ||
| 37 | } VVCSEI; | 39 | } VVCSEI; |
| 38 | 40 | ||
| 39 | struct VVCFrameContext; | 41 | struct VVCFrameContext; |