History

avcodec/vvc/sei: add decode_decoded_picture_hash

Wu Jianhua committed 1 year ago

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

Showing the changes to libavcodec (2 of 2 files). Show all

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
80 return 0;80 return 0;
81}81}
82 82
83static 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
83int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc)97int 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
113int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src)130int 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
118void ff_vvc_sei_reset(VVCSEI *s)136void 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}
libavcodec/vvc/sei.h+2−0
@@ -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
35typedef struct VVCSEI {36typedef struct VVCSEI {
36 H2645SEI common;37 H2645SEI common;
38 H274SEIPictureHash picture_hash;
37} VVCSEI;39} VVCSEI;
38 40
39struct VVCFrameContext;41struct 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