h265: CB2 change 265 HDR signal type. [1/1]
authorkuan.hu <kuan.hu@amlogic.com>
Sat, 18 Jun 2022 09:04:46 +0000 (17:04 +0800)
committerLiang Ji <liang.ji@amlogic.com>
Wed, 22 Jun 2022 12:08:42 +0000 (20:08 +0800)
SWPL-83432
BUG=232905331

Problem:
The HDR parameter is read when the
color_description_present_flag is not recognized,
resulting in the wrong parameter being transmitted
when the color_description_present_flag is 0.

Solution:
According to the HDR protocol, adjust
the read logic of related parameters.

Verify:
adt3

Signed-off-by: kuan.hu <kuan.hu@amlogic.com>
Change-Id: I188624329fb3493eb53800ab7914b41f4a30ab35

drivers/frame_provider/decoder/h265/vh265.c

index 9369556850c484055e51c269ea9aed30ed631923..516d74a6e83f71224bd188943d5bd08c7807fa64 100644 (file)
@@ -8513,6 +8513,13 @@ static void set_frame_info(struct hevc_state_s *hevc, struct vframe_s *vf,
        }
        if (hevc->video_signal_type & VIDEO_SIGNAL_TYPE_AVAILABLE_MASK) {
                vf->signal_type = pic->video_signal_type;
+               /* When the matrix_coeffiecents, transfer_characteristics and colour_primaries
+                * syntax elements are absent, their values shall be presumed to be equal to 2
+                */
+               if ((vf->signal_type & 0x1000000) == 0) {
+                       vf->signal_type = vf->signal_type & 0xff000000;
+                       vf->signal_type = vf->signal_type | 0x20202;
+               }
                if (hevc->sei_present_flag & SEI_HDR10PLUS_MASK) {
                        u32 data;
                        data = vf->signal_type;