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 ESMTP id C55AC49E76 for ; Tue, 12 Mar 2024 18:45:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E5C4168CCE0; Tue, 12 Mar 2024 20:45:39 +0200 (EET) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0FC7368ADF1 for ; Tue, 12 Mar 2024 20:45:34 +0200 (EET) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e68bab3e4cso2449831b3a.0 for ; Tue, 12 Mar 2024 11:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710269132; x=1710873932; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=1vI6q3+04lDIgpWNa3QHo0Ooj3QWMODrIPW/0MeIpu0=; b=eB0ENb/54bY6M2JJukEjTABtHqt4JN24zkF1p9o7oht1BNCB91VwCPnBc+RH7ey6q1 jYIVCGzc7YS2uEdB4wo4zUM45otUF/V1Do3dH5VpM75bJwDnLFL1aoBcJ0qNJPRXOVTy TrnIwBrHCwSc+bDIYe+auQtEs/rm6c2OnrrSDV23UBWuWa9cKxFJ4yyH9v24t03sNUcs uUWyIssTWMx67rImn1JOl9bAHBI8gFjpeU4LK5SFLf/Vj3x+j8Faef+GAyEiswbCFDA6 gXPhO5wRwLC7mpysTKvxtlcNJdG77rlmcDSkfzb6//436nU+TjLiZLEJE1WU17VdAwqm 2jiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710269132; x=1710873932; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1vI6q3+04lDIgpWNa3QHo0Ooj3QWMODrIPW/0MeIpu0=; b=uihmbKMFzY5979kY8y7tNm4Z9fzMA6TMX/LvPzPs7FiDXvvgnTxUWENYl0g9TuRp2h 5Px0plgFyH+VtogIh8ugQkKNkB90Fr6pjN9S40xMSiROwRla0VDY9R4njOfwruhgHFvq nOSZ4u5D5m8bgeiYiQfY+yebqZ3L0d3eb0WTl4cG1F4OoNLgZJ2ptk82jPSQkxfSOgL2 nGHvIqgigRa98kqcc7+iEcvycwngmpTP5B/TyZgLutP7QpphB2EtV2AEVxuVRbkkRmGe ktw8lKVhWHTPrL61wHXPnu5IEINIUGMOdXEMIe1vh6q20EtGXCxh7Mi5mybpejmXSREW v2Ag== X-Gm-Message-State: AOJu0YwdFC7bXGZDAAcqL/NOiVRQa7sb7bc4UPCGTOuohg7KRIHpe9T0 TJtvKphhff2EzhMkDzqvHucpJWgMo+BZumpJeLlbkV+YuaDK4pwNOedfluwD X-Google-Smtp-Source: AGHT+IEJh97bgr4iiQQSdkRwry8oVNIGyJy8GvrUOUZ+8l+28Bwwn1/zObxmF1Azj61xRJqIX/jWLA== X-Received: by 2002:a05:6a00:1a8b:b0:6e6:7bcb:b886 with SMTP id e11-20020a056a001a8b00b006e67bcbb886mr299299pfv.30.1710269131619; Tue, 12 Mar 2024 11:45:31 -0700 (PDT) Received: from localhost.localdomain ([190.194.169.124]) by smtp.gmail.com with ESMTPSA id y187-20020a62cec4000000b006e4d8687f44sm6734326pfg.102.2024.03.12.11.45.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 11:45:31 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Mar 2024 15:44:32 -0300 Message-ID: <20240312184435.7420-1-jamrial@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/av1dec: use named constants for ITU-T T.35 metadata 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 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: Signed-off-by: James Almer --- libavcodec/av1dec.c | 12 +++++++----- libavcodec/itut35.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 libavcodec/itut35.h diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index e6346b51db..4d074c3908 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -34,6 +34,7 @@ #include "decode.h" #include "hwaccel_internal.h" #include "internal.h" +#include "itut35.h" #include "hwconfig.h" #include "profiles.h" #include "refstruct.h" @@ -951,7 +952,7 @@ static int export_itut_t35(AVCodecContext *avctx, AVFrame *frame, provider_code = bytestream2_get_be16(&gb); switch (provider_code) { - case 0x31: { // atsc_provider_code + case ITU_T_T35_PROVIDER_CODE_ATSC: { uint32_t user_identifier = bytestream2_get_be32(&gb); switch (user_identifier) { case MKBETAG('G', 'A', '9', '4'): { // closed captions @@ -975,12 +976,12 @@ static int export_itut_t35(AVCodecContext *avctx, AVFrame *frame, } break; } - case 0x3C: { // smpte_provider_code + case ITU_T_T35_PROVIDER_CODE_SMTPE: { AVDynamicHDRPlus *hdrplus; int provider_oriented_code = bytestream2_get_be16(&gb); int application_identifier = bytestream2_get_byte(&gb); - if (itut_t35->itu_t_t35_country_code != 0xB5 || + if (itut_t35->itu_t_t35_country_code != ITU_T_T35_COUNTRY_CODE_US || provider_oriented_code != 1 || application_identifier != 4) break; @@ -994,9 +995,10 @@ static int export_itut_t35(AVCodecContext *avctx, AVFrame *frame, return ret; break; } - case 0x3B: { // dolby_provider_code + case ITU_T_T35_PROVIDER_CODE_DOLBY: { int provider_oriented_code = bytestream2_get_be32(&gb); - if (itut_t35->itu_t_t35_country_code != 0xB5 || provider_oriented_code != 0x800) + if (itut_t35->itu_t_t35_country_code != ITU_T_T35_COUNTRY_CODE_US || + provider_oriented_code != 0x800) break; ret = ff_dovi_rpu_parse(&s->dovi, gb.buffer, gb.buffer_end - gb.buffer); diff --git a/libavcodec/itut35.h b/libavcodec/itut35.h new file mode 100644 index 0000000000..10063e6a9e --- /dev/null +++ b/libavcodec/itut35.h @@ -0,0 +1,28 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_ITUT35_H +#define AVCODEC_ITUT35_H + +#define ITU_T_T35_COUNTRY_CODE_US 0xB5 + +#define ITU_T_T35_PROVIDER_CODE_ATSC 0x31 +#define ITU_T_T35_PROVIDER_CODE_DOLBY 0x3B +#define ITU_T_T35_PROVIDER_CODE_SMTPE 0x3C + +#endif /* AVCODEC_ITUT35_H */ -- 2.44.0 _______________________________________________ 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".