History

avcodec/vvc/sei: add decode_display_orientation

Wu Jianhua committed 1 year ago

Commit 40bc5e11 parent d1406481 file · +27 −0Browse files

Unified · Split

libavcodec/vvc/sei.c+27−0
@@ -94,6 +94,30 @@ static int decode_decoded_picture_hash(H274SEIPictureHash *h, const SEIRawDecode · 93 unmodified lines
94 return 0;94 return 0;
95}95}
96 96
97static int decode_display_orientation(H2645SEIDisplayOrientation *h, const SEIRawDisplayOrientation *s)
98{
99 int degrees[] = { 0, 0x8000, 0x4000, 0xC000 };
100
101 h->present = !s->display_orientation_cancel_flag;
102 if (h->present) {
103 if (s->display_orientation_transform_type > 7)
104 return AVERROR_INVALIDDATA;
105
106 h->vflip = 0;
107 if (s->display_orientation_transform_type == 1 ||
108 s->display_orientation_transform_type == 3 ||
109 s->display_orientation_transform_type == 4 ||
110 s->display_orientation_transform_type == 6) {
111 h->hflip = 1;
112 } else {
113 h->hflip = 0;
114 }
115 h->anticlockwise_rotation = degrees[s->display_orientation_transform_type >> 1];
116 }
117
118 return 0;
119}
120
97int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc)121int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc)
98{122{
99 H2645SEI *c = &s->common;123 H2645SEI *c = &s->common;
@@ -116,6 +140,9 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon · 16 unmodified lines
116 case SEI_TYPE_DECODED_PICTURE_HASH:140 case SEI_TYPE_DECODED_PICTURE_HASH:
117 return decode_decoded_picture_hash(&s->picture_hash, payload);141 return decode_decoded_picture_hash(&s->picture_hash, payload);
118 142
143 case SEI_TYPE_DISPLAY_ORIENTATION:
144 return decode_display_orientation(&s->common.display_orientation, payload);
145
119 default:146 default:
120 av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n",147 av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n",
121 sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ?148 sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ?

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