Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -94,6 +94,30 @@ static int decode_decoded_picture_hash(H274SEIPictureHash *h, const SEIRawDecode · 93 unmodified lines | ||
| 94 | 94 | return 0; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | +static 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 | + | |
| 97 | 121 | int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc) |
| 98 | 122 | { |
| 99 | 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 | 140 | case SEI_TYPE_DECODED_PICTURE_HASH: |
| 117 | 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 | 146 | default: |
| 120 | 147 | av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n", |
| 121 | 148 | sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ? |