avcodec/cbs_h266: move decoded_picture_hash to CBS SEI
It's defined in H.274 as a common SEI message type and not in H.266 Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
826f55d5b3
commit
e0b574c483
@ -2134,6 +2134,12 @@ static const SEIMessageTypeDescriptor cbs_sei_common_types[] = {
|
|||||||
sizeof(SEIRawFramePackingArrangement),
|
sizeof(SEIRawFramePackingArrangement),
|
||||||
SEI_MESSAGE_RW(sei, frame_packing_arrangement),
|
SEI_MESSAGE_RW(sei, frame_packing_arrangement),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
SEI_TYPE_DECODED_PICTURE_HASH,
|
||||||
|
0, 1,
|
||||||
|
sizeof(SEIRawDecodedPictureHash),
|
||||||
|
SEI_MESSAGE_RW(sei, decoded_picture_hash),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME,
|
SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME,
|
||||||
1, 0,
|
1, 0,
|
||||||
@ -2272,12 +2278,6 @@ static const SEIMessageTypeDescriptor cbs_sei_h265_types[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const SEIMessageTypeDescriptor cbs_sei_h266_types[] = {
|
static const SEIMessageTypeDescriptor cbs_sei_h266_types[] = {
|
||||||
{
|
|
||||||
SEI_TYPE_DECODED_PICTURE_HASH,
|
|
||||||
0, 1,
|
|
||||||
sizeof(H266RawSEIDecodedPictureHash),
|
|
||||||
SEI_MESSAGE_RW(h266, sei_decoded_picture_hash),
|
|
||||||
},
|
|
||||||
SEI_MESSAGE_TYPE_END
|
SEI_MESSAGE_TYPE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -848,16 +848,6 @@ typedef struct H266RawSlice {
|
|||||||
int data_bit_start;
|
int data_bit_start;
|
||||||
} H266RawSlice;
|
} H266RawSlice;
|
||||||
|
|
||||||
typedef struct H266RawSEIDecodedPictureHash {
|
|
||||||
uint8_t dph_sei_hash_type;
|
|
||||||
uint8_t dph_sei_single_component_flag;
|
|
||||||
uint8_t dph_sei_picture_md5[3][16];
|
|
||||||
uint16_t dph_sei_picture_crc[3];
|
|
||||||
uint32_t dph_sei_picture_checksum[3];
|
|
||||||
|
|
||||||
uint8_t dph_sei_reserved_zero_7bits;
|
|
||||||
} H266RawSEIDecodedPictureHash;
|
|
||||||
|
|
||||||
typedef struct H266RawSEI {
|
typedef struct H266RawSEI {
|
||||||
H266RawNALUnitHeader nal_unit_header;
|
H266RawNALUnitHeader nal_unit_header;
|
||||||
SEIRawMessageList message_list;
|
SEIRawMessageList message_list;
|
||||||
|
@ -3442,34 +3442,6 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEI_FUNC(sei_decoded_picture_hash, (CodedBitstreamContext *ctx,
|
|
||||||
RWContext *rw,
|
|
||||||
H266RawSEIDecodedPictureHash *current,
|
|
||||||
SEIMessageState *unused))
|
|
||||||
{
|
|
||||||
int err, c_idx, i;
|
|
||||||
|
|
||||||
HEADER("Decoded Picture Hash");
|
|
||||||
|
|
||||||
u(8, dph_sei_hash_type, 0, 2);
|
|
||||||
flag(dph_sei_single_component_flag);
|
|
||||||
ub(7, dph_sei_reserved_zero_7bits);
|
|
||||||
|
|
||||||
for (c_idx = 0; c_idx < (current->dph_sei_single_component_flag ? 1 : 3);
|
|
||||||
c_idx++) {
|
|
||||||
if (current->dph_sei_hash_type == 0) {
|
|
||||||
for (i = 0; i < 16; i++)
|
|
||||||
us(8, dph_sei_picture_md5[c_idx][i], 0x00, 0xff, 2, c_idx, i);
|
|
||||||
} else if (current->dph_sei_hash_type == 1) {
|
|
||||||
us(16, dph_sei_picture_crc[c_idx], 0x0000, 0xffff, 1, c_idx);
|
|
||||||
} else if (current->dph_sei_hash_type == 2) {
|
|
||||||
us(32, dph_sei_picture_checksum[c_idx], 0x00000000, 0xffffffff, 1,
|
|
||||||
c_idx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int FUNC(sei) (CodedBitstreamContext *ctx, RWContext *rw,
|
static int FUNC(sei) (CodedBitstreamContext *ctx, RWContext *rw,
|
||||||
H266RawSEI *current, int prefix)
|
H266RawSEI *current, int prefix)
|
||||||
{
|
{
|
||||||
|
@ -63,6 +63,16 @@ typedef struct SEIRawFramePackingArrangement {
|
|||||||
uint8_t fp_upsampled_aspect_ratio_flag;
|
uint8_t fp_upsampled_aspect_ratio_flag;
|
||||||
} SEIRawFramePackingArrangement;
|
} SEIRawFramePackingArrangement;
|
||||||
|
|
||||||
|
typedef struct SEIRawDecodedPictureHash {
|
||||||
|
uint8_t dph_sei_hash_type;
|
||||||
|
uint8_t dph_sei_single_component_flag;
|
||||||
|
uint8_t dph_sei_picture_md5[3][16];
|
||||||
|
uint16_t dph_sei_picture_crc[3];
|
||||||
|
uint32_t dph_sei_picture_checksum[3];
|
||||||
|
|
||||||
|
uint8_t dph_sei_reserved_zero_7bits;
|
||||||
|
} SEIRawDecodedPictureHash;
|
||||||
|
|
||||||
typedef struct SEIRawMasteringDisplayColourVolume {
|
typedef struct SEIRawMasteringDisplayColourVolume {
|
||||||
uint16_t display_primaries_x[3];
|
uint16_t display_primaries_x[3];
|
||||||
uint16_t display_primaries_y[3];
|
uint16_t display_primaries_y[3];
|
||||||
|
@ -128,6 +128,34 @@ SEI_FUNC(frame_packing_arrangement, (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SEI_FUNC(decoded_picture_hash, (CodedBitstreamContext *ctx,
|
||||||
|
RWContext *rw,
|
||||||
|
SEIRawDecodedPictureHash *current,
|
||||||
|
SEIMessageState *unused))
|
||||||
|
{
|
||||||
|
int err, c_idx, i;
|
||||||
|
|
||||||
|
HEADER("Decoded Picture Hash");
|
||||||
|
|
||||||
|
u(8, dph_sei_hash_type, 0, 2);
|
||||||
|
flag(dph_sei_single_component_flag);
|
||||||
|
ub(7, dph_sei_reserved_zero_7bits);
|
||||||
|
|
||||||
|
for (c_idx = 0; c_idx < (current->dph_sei_single_component_flag ? 1 : 3);
|
||||||
|
c_idx++) {
|
||||||
|
if (current->dph_sei_hash_type == 0) {
|
||||||
|
for (i = 0; i < 16; i++)
|
||||||
|
us(8, dph_sei_picture_md5[c_idx][i], 0x00, 0xff, 2, c_idx, i);
|
||||||
|
} else if (current->dph_sei_hash_type == 1) {
|
||||||
|
us(16, dph_sei_picture_crc[c_idx], 0x0000, 0xffff, 1, c_idx);
|
||||||
|
} else if (current->dph_sei_hash_type == 2) {
|
||||||
|
us(32, dph_sei_picture_checksum[c_idx], 0x00000000, 0xffffffff, 1,
|
||||||
|
c_idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
SEI_FUNC(mastering_display_colour_volume,
|
SEI_FUNC(mastering_display_colour_volume,
|
||||||
(CodedBitstreamContext *ctx, RWContext *rw,
|
(CodedBitstreamContext *ctx, RWContext *rw,
|
||||||
SEIRawMasteringDisplayColourVolume *current,
|
SEIRawMasteringDisplayColourVolume *current,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user