History

avcodec/vvc/sei: add decode_decoded_picture_hash

Wu Jianhua committed 1 year ago

Commit 8dfc24c1 parent 942cf592 files · +21 −0Browse files

Unified · Split

2 files
  1. libavcodec/vvc/sei.c +19 −0
  2. libavcodec/vvc/sei.h +2 −0
libavcodec/vvc/sei.c+19−0
@@ -80,6 +80,20 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h · 79 unmodified lines
8080 return 0;
8181 }
8282
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+
8397 int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc)
8498 {
8599 H2645SEI *c = &s->common;
@@ -99,6 +113,9 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon · 13 unmodified lines
99113 return AVERROR(ENOMEM);
100114 return decode_film_grain_characteristics(c->film_grain_characteristics, payload, fc);
101115
116+ case SEI_TYPE_DECODED_PICTURE_HASH:
117+ return decode_decoded_picture_hash(&s->picture_hash, payload);
118+
102119 default:
103120 av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n",
104121 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
112129
113130 int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src)
114131 {
132+ dst->picture_hash.present = 0; // drop hash
115133 return ff_h2645_sei_ctx_replace(&dst->common, &src->common);
116134 }
117135
118136 void ff_vvc_sei_reset(VVCSEI *s)
119137 {
120138 ff_h2645_sei_reset(&s->common);
139+ s->picture_hash.present = 0;
121140 }
libavcodec/vvc/sei.h+2−0
@@ -31,9 +31,11 @@ · 30 unmodified lines
3131 #include "libavcodec/h2645_sei.h"
3232 #include "libavcodec/sei.h"
3333 #include "libavcodec/vvc.h"
34+#include "libavcodec/h274.h"
3435
3536 typedef struct VVCSEI {
3637 H2645SEI common;
38+ H274SEIPictureHash picture_hash;
3739 } VVCSEI;
3840
3941 struct VVCFrameContext;

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