From c07a56179fb29359eff51dcaf1169fd152ddf07c Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Tue, 8 Dec 2020 11:40:01 +0200 Subject: [PATCH] Fix Hash SEI message for VTM11.0 --- src/encoder_state-bitstream.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/encoder_state-bitstream.c b/src/encoder_state-bitstream.c index e13f9610..e8ed3109 100644 --- a/src/encoder_state-bitstream.c +++ b/src/encoder_state-bitstream.c @@ -1250,8 +1250,10 @@ static void add_checksum(encoder_state_t * const state) case KVZ_HASH_CHECKSUM: kvz_image_checksum(frame->rec, checksum, state->encoder_control->bitdepth); - WRITE_U(stream, 1 + num_colors * 4, 8, "size"); + WRITE_U(stream, 2 + num_colors * 4, 8, "size"); WRITE_U(stream, 2, 8, "hash_type"); // 2 = checksum + WRITE_U(stream, 0, 1, "dph_sei_single_component_flag"); + WRITE_U(stream, 0, 7, "dph_sei_reserved_zero_7bits"); for (int i = 0; i < num_colors; ++i) { uint32_t checksum_val = ( @@ -1266,8 +1268,10 @@ static void add_checksum(encoder_state_t * const state) case KVZ_HASH_MD5: kvz_image_md5(frame->rec, checksum, state->encoder_control->bitdepth); - WRITE_U(stream, 1 + num_colors * 16, 8, "size"); + WRITE_U(stream, 2 + num_colors * 16, 8, "size"); WRITE_U(stream, 0, 8, "hash_type"); // 0 = md5 + WRITE_U(stream, 0, 1, "dph_sei_single_component_flag"); + WRITE_U(stream, 0, 7, "dph_sei_reserved_zero_7bits"); for (int i = 0; i < num_colors; ++i) { for (int b = 0; b < 16; ++b) {