From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 41E7B4DFF2 for ; Sun, 27 Apr 2025 11:48:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AD25968B153; Sun, 27 Apr 2025 14:47:04 +0300 (EEST) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 52D0768B207 for ; Sun, 27 Apr 2025 14:45:35 +0300 (EEST) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-73972a54919so3159090b3a.3 for ; Sun, 27 Apr 2025 04:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745754333; x=1746359133; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fzL67xYxnBu3IEObbI2IHZ7YFSIWuTfNQxBAZDQyHB4=; b=YBlVrTT1u+2b6psxzDLNWDKTCMY/xToq0N4W7dCMkrKkDbnjrHgOpYX3QDAxJdPKoG RzzTLKQ7hm8q6uQoaJaxTJq6s9ezKzTrjlH/uZTF01WZiqEHUvJRxI/Chue+D8EZlcPP cjG+rAJq9KbHrGHGcmDK0iYKQ9dwSNmX30LI0Mi6mUoKil+IZSQWFz80LJ+sJBNttP1x LpbXC332rD8JggbJ421r4yfnZkpFKsNYkFFILoRj/zwdNvshBZgT69XJEGKHMgj3LyBn SlUvcfWShiYo/N2d0Zy5K+Yl5jhBag7cuoYPBm8ScqP/nlWWeBMvwZgVltnzAVz4rm2E LcRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745754333; x=1746359133; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fzL67xYxnBu3IEObbI2IHZ7YFSIWuTfNQxBAZDQyHB4=; b=M8Wwt+5+x9/cCCxcqg1uNIq77a/Mm8zCz/CiLi0ZjPOrFdzZlPIBPhZf37Wh9WH87W vWwgKvuKdH/xBCqnCUR0FawaBrVcjx6ju1/cz+FzPDI7PMSmInznLmu/+kqct0x0tmOl o5jqImKa5YiosN7GgMF66vpLf57Tkhc9FQLq/6db1ozFLhpRuWQvSN/P8lFkyWh+BvDK 0zgesk+bnit56Vqo9jnysfnruki9D9M3asBNQR2HLoA93Xmjto1eH/4QON/Np8yM1xrl GfTSqK/CEvJOnY7UgT5jJ+KXzUtd5qkxrz+uh+jpqS3qUhnuE8kfCc3Gk8U8AzsvUiSb GREA== X-Gm-Message-State: AOJu0Yy6snp4fdokrwW07g9ymnBrILTxZ3zyagkr3LpDzRHko5kZ5BpV 2QjrR5rQI3Z6NvWT2amE2/u/HWqaazykv2o5p+H0rI8h3PBtFZ6qz0RVrzmH X-Gm-Gg: ASbGncsk/gS5YvAL4OC+hlQRDRrebqk/shEd/CoMfMoK6J+QuwlC+lG9OPTKq1yKLU8 u+BcpEtlODCUL7pPAUg4JfENEbSDqg0c5B6g1ZqlqP1vPBmbJ5Cy36gAevY2u+Qo8x0oV7Lk02y j/XN07UJ4DNxQWfe0b26rs0NPVXH0r5v0E1Q8jDujXD54R14mdX/zFt+LcSy3X7A4ez/P+1eY4O Zs/S38ORv6eXIijBS28zn2hHwjonfoxVUgr/nlgas11lFjcUibfvNiAwUleDytEaTBpLRMIIDPj 0QYMbACtLIj7jEfjr7m6/81w909DyHcuqio3GD6E6pggC/5BUFaZ2quk/2vkdPdBmcIxrj1r X-Google-Smtp-Source: AGHT+IEWeL0AaWiCoFbGdmByqBrQY0gDfDbGTk1pxvlAZ/MKH5+tTW2tvtpQCw5+inal8Dcxu43c5g== X-Received: by 2002:a05:6a20:cfa4:b0:204:4573:d853 with SMTP id adf61e73a8af0-2045b6984fdmr11684352637.4.1745754333203; Sun, 27 Apr 2025 04:45:33 -0700 (PDT) Received: from localhost.localdomain ([124.79.129.75]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e259134ebsm6064452b3a.27.2025.04.27.04.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Apr 2025 04:45:32 -0700 (PDT) From: toqsxw@gmail.com X-Google-Original-From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 27 Apr 2025 19:44:43 +0800 Message-ID: <20250427114451.1236-13-toqsxw@outlook.com> X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20250427114451.1236-1-toqsxw@outlook.com> References: <20250427114451.1236-1-toqsxw@outlook.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 13/20] avcodec/vvc/sei: add decode_display_orientation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: nuomi2021@gmail.com, Wu Jianhua Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Wu Jianhua Signed-off-by: Wu Jianhua --- libavcodec/vvc/sei.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libavcodec/vvc/sei.c b/libavcodec/vvc/sei.c index 2d81ae5908..7073762d49 100644 --- a/libavcodec/vvc/sei.c +++ b/libavcodec/vvc/sei.c @@ -94,6 +94,30 @@ static int decode_decoded_picture_hash(H274SEIPictureHash *h, const SEIRawDecode return 0; } +static int decode_display_orientation(H2645SEIDisplayOrientation *h, const SEIRawDisplayOrientation *s) +{ + int degrees[] = { 0, 0x8000, 0x4000, 0xC000 }; + + h->present = !s->display_orientation_cancel_flag; + if (h->present) { + if (s->display_orientation_transform_type > 7) + return AVERROR_INVALIDDATA; + + h->vflip = 0; + if (s->display_orientation_transform_type == 1 || + s->display_orientation_transform_type == 3 || + s->display_orientation_transform_type == 4 || + s->display_orientation_transform_type == 6) { + h->hflip = 1; + } else { + h->hflip = 0; + } + h->anticlockwise_rotation = degrees[s->display_orientation_transform_type >> 1]; + } + + return 0; +} + int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc) { H2645SEI *c = &s->common; @@ -116,6 +140,9 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon case SEI_TYPE_DECODED_PICTURE_HASH: return decode_decoded_picture_hash(&s->picture_hash, payload); + case SEI_TYPE_DISPLAY_ORIENTATION: + return decode_display_orientation(&s->common.display_orientation, payload); + default: av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n", sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ? -- 2.44.0.windows.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".