From patchwork Fri Feb 9 19:30:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 46141 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:a586:b0:19e:8a94:b663 with SMTP id gd6csp1153966pzc; Fri, 9 Feb 2024 11:30:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZGugD0vDTf794JtBn1k6BRGo/y/qeTHjlgs1a1dTX+MNcB6xtJze4rYYqXSWHjjujNATd X-Received: by 2002:aa7:ca55:0:b0:560:799:f802 with SMTP id j21-20020aa7ca55000000b005600799f802mr1873514edt.21.1707507058105; Fri, 09 Feb 2024 11:30:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707507058; cv=none; d=google.com; s=arc-20160816; b=eD/4s118KXQGmT4JDt9Fv/F8p145xs5CrW7lurz81SigVVJe7Nsl/ea1xzjE2GIffc hdIgbys+shSf4K22lq/b2/uJR8C8v9h4YmikWQ0hZfOMMn3dumvSsW2oZ9xwPIzNV/OB ihzV6ZlylXZ3UoplrPaUms95viFxSFo6GiNnoTwdAKMvR1HITMZdr2xEwm7rnzhkcoXd SlRRab5B5GqicI6pSV2eiW4wb8b9dfCtf8DEDBwPvCC5R8r7RGX1QQs6Zj+zOjjAAckc Ks+uZxFef2Ejk0/w7UOlUNRXnEpesokqPTET/Z+IyzciainntlJdyTrDruqThVvwR4vG wOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=B6EHdzp0+ZWpsqJdbfhMHfHQrYhayszAFahbKsb5F4g=; fh=Oxq0Y9X9aRoztl81OXOrDcYzT9JVJhIndu1ofwVO8BU=; b=INPy49TYfNKYoU0hWBWFO/LV+Lc/XJoaA8Hvri/SmKhoTUXoThi9wKPRpwxCh/+96U RFLB/73tbaE+nl7vIVqegpN41MNymykRHTkDupF7zq/ACTyNRWVNYjyyq3dIsXB/eyDQ Y1MVDA7T72Z5Jy2MSM7FANDbfCtLkTAVd1KqgwIbNMA585vVK53Iu4CkNaWy+Jm1Tbqt 3Il6I/Mb/wetIcnFGUCphTu9BqrnSCXR6pTn70amupXjrqQPahmTKP3aW7WltWMSRSoX 0fcGD6UK2F/gw8sAdZofbrjYloV1SZLpJByYllp6Tih6aSRFq3lxXkqKzKYW+ATm+Gfi zJuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b="Odqt8/Th"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org X-Forwarded-Encrypted: i=1; AJvYcCU7oJrvP98E2rnEYmNfsWwWaVhZUh+Nj29zSetFOA7tXj9Ak8b1DkqUiHM/w+aQuI4X2mV0XU5YFgFPjHfFGYxNqQXpIngQRQqPWIDoRYCS+7HuDsKjiJ8SLclBhmkqY6TL8sP3T1PBxm74LQXW0xGqu6/9PQX3P1gpT+xySbikinU0l+MwKjronjsArkwnoKrH7KG1plQ/pGKnQIGoAlNhZXEClALQp8Xo2q4nX9PkAxyFnNfITi+Y0lPcfEf8TluszlhEcC76GDKNOwIEZhENmWkVaETPO7AJbmSW8Fl3Zu7fmRxIsSK0GntQJJi7TvyU4UhWbDBvLOPtffdIZyV4nQGSHtUmDC1KrPff1iuLwf9VinLP3c3psd9EZ8LJePZi+7dA4SdkFLlLuKHn3/7SZ9/yGGt4J1HWojyJuU9iM7+2XNHwpferjtflSMrJ29ZbGuVo2dt1XRZ97QYYkl/wEry5flQsdrimCVhS5FRcyybGPgVUMP2rFYE8diFhk102RLLCqwTUTAmJiRjeK5BFfQeKsXkolBkx0gxWhoed5jT6fDcGU7YXhVB47M0PzE+HBG4XSKwR87Vz8gq0uk15c2M6LRnAgh9yoZZKES1aVJOHpl1y5OLS66NDzu6NuHVW2mDkNItcWJ4qZPxSbzyh9oGAf3JfKccpN0orAPaBo0Kuf5sw3Njfy7aiVYGCCqqXRdNCBG0Fyml4UT57K01cYFEdeTnZZB+QzkwaaqNRYD/5nwzMFTRsxT3RtYKZcu9uDyZuridpRoijfW67JmbiIO35gQXeaJI8oS7+n+Hg6o/vU7Hv4y7dUEgm1nT7zwmbcIjVgO5JEqoOrqr7eDUvFoRIj1UuWFve7fzuvqSZ2UMWNAGSWmHGF4e2S/Uvxg+LDlNQ7UR0KSO3I1YQK3zXhrtUnN9FcAxRAl4qR3gRIc8OBmp0pOzQAFhE3A4C/y2Uw3 HVOKUvGo6LB9LnsO4ttWOR00gsSHcKCIFIs3CA8MXG/n4icTZ6XlszccLDLSmreyHB76748bHjZFgZk91/qeolsS3v7LXAHTv4ltktP89Pjx1F6GmrUKW/f/iMVEIAc3rlmsuN8Ub+m3qW9WEezVp2cMdKrhHbxgK1+dAstW3ShNIJNFj8k6uBBTtQRbKxvhZ0vdBFH57OZo7FPJ/oggSaTjQqm/N/C5Xqic0huaBkb1B3mGDqhHjxRfP+zdSiJSVVAgQuXKN9y2TNahJBFrQGC6spz5Bpj4WLO94QnLTRiebNM75D6eRbU+l/KhUKUz+We1xJgjJWiSEtqJt6vuyr0rNr1Yn027SwB4frL38MD0I4IeDlE9vFraGvc7HYD60mNG2OuDtwvdK3WrSXVwAvFOQVcRM0Ybwt0wBeW0+0lTJXOWXrF1fHPPn3HifKRqFG8oogDSDel9dsIKGCfUOB4PL5wUN0R34lIkOGj9kqJ2NZ3GNA3f+pnOdeMF8HtWmVSPuAfLatEbdjiRb235uIW48NU2HXO6L3ScVRShmhAyEfvF/D0aXX40z6X8Y7WAxfAaNG75B+bk4nHCXsoc72QOk8cY0QriJAWWFRuV/pSZfwPVoBca9uTsC50yx26Mpf Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k2-20020aa7d8c2000000b0055f009a3b1asi33524eds.627.2024.02.09.11.30.57; Fri, 09 Feb 2024 11:30:58 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b="Odqt8/Th"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7F5AD68D0F6; Fri, 9 Feb 2024 21:30:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-il1-f228.google.com (mail-il1-f228.google.com [209.85.166.228]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4DB2168D0D3 for ; Fri, 9 Feb 2024 21:30:43 +0200 (EET) Received: by mail-il1-f228.google.com with SMTP id e9e14a558f8ab-363b6c3bc1eso4014055ab.1 for ; Fri, 09 Feb 2024 11:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1707507042; x=1708111842; 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=GjJKj//XldA7sth2Ge9QEZJzIpFR+D9/RxW+yr82AEA=; b=Odqt8/Th+m7jcspVQrkIFc0RqBhLlzA75mwBF48LA31dhY8l6vHFg+S5gAZEtInEmI /rhdZnHHZm5tEzDqNF/VfYVDRXPzT38FGZPdXbiSbKA+4SMI8VowMgWoYMS6BFNvq12D ztmFcghqLUnsUQt/A5Ye9GSXq2XImp+pqITNQ90gZyQ4WyeEp5quuYwMvSpns106BMEv MWPcE4PUhAIlPqMQWXqTTaZ/XNUH70UftCCYtuY7T3rvKBo2kT1WUiYWKmxtZq7CliOj pyBm796WXVqD+9hHSZgFJK8qWPT0jw0tSwlEPCk9ioefRGl08C0phETEL3bU15jFZ3U4 XL4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707507042; x=1708111842; 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=GjJKj//XldA7sth2Ge9QEZJzIpFR+D9/RxW+yr82AEA=; b=J7JySoFlHuKluE+5fQrVNaxuKPnv5aoI+4BTRyz64/sfmj8dqoCYyk31A/PkOovrlA iY+gGnRKWNhuKU4bvz7dRgv/DkWi2h49xrA0j6N+Rf294qGhE/Gd9DcfyBT3+SL5ZyhS RcfwFjx6oJ4jtAJ3N4MRH5MD9BVnzi7mmvOv7kCI5F4uZst5sKYpFuzRC4JRpO9U/C6D UvxvCMaWwIDDP4d1utuRNm+DRotgIgA0/m7/NlTOIIEgXu5mUOjcPG7nftXqW1zVED6W zUNXjUj9dgxP3F0sGuFHtEIMVpnCvScToteADqp1NWEV9tzuUHrAIqufWbJPNyS2cWkk xNgg== X-Gm-Message-State: AOJu0YyxUTS7kUimYGOc0dzlKR4fldCutsSr1muZ7VEfDFU+rHRebx8T dTTKKnML35RJZ7gGRQVR3m2bK910du5scuYj02NOBpEqpFza4lfHuuRBJZr0rafcZpn5R7jg/O0 QzzuGSJua9TRrJqTV3fbgTkVYzZ08s/SRPUzO5/Jl X-Received: by 2002:a92:d3c1:0:b0:363:cc7d:102c with SMTP id c1-20020a92d3c1000000b00363cc7d102cmr259540ilh.10.1707507041881; Fri, 09 Feb 2024 11:30:41 -0800 (PST) Received: from wsx-cc1-001.. (c-76-141-249-38.hsd1.il.comcast.net. [76.141.249.38]) by smtp-relay.gmail.com with ESMTPS id bq9-20020a056e02238900b00362a4e6b4bcsm59962ilb.51.2024.02.09.11.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:30:41 -0800 (PST) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Feb 2024 13:30:36 -0600 Message-Id: <20240209193036.1581378-2-marth64@proxyid.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240209193036.1581378-1-marth64@proxyid.net> References: <20240209193036.1581378-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v11 2/2] libavformat/dvdvideo: add DVD CLUT utilities and enable subtitle palette support 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: Marth64 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3swc4hyGOGA6 DVD subtitle palettes, which are natively YUV, are currently carried as a hex string in their respective subtitle streams and have no concept of colorspace tagging. In fact, the convention is to convert them to RGB prior to storage. Common players will only render the palettes properly if they are stored as RGB. Even ffmpeg itself expects this, and already does -in libavformat- the YUV-RGB conversions, specifically in mov.c and movenc.c. The point of this patch is to provide a consolidation of the code that deals with creating the extradata as well as the RGB conversion. That can then (1) enable usable palette support for DVD demuxer if it is merged and (2) start the process of consolidating the related conversions in MOV muxer/demuxer and eventually find a way to properly tag the colorspace. Signed-off-by: Marth64 --- doc/demuxers.texi | 5 +++ libavformat/Makefile | 2 +- libavformat/dvdclut.c | 83 +++++++++++++++++++++++++++++++++++++++ libavformat/dvdclut.h | 37 +++++++++++++++++ libavformat/dvdvideodec.c | 14 +++++++ 5 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 libavformat/dvdclut.c create mode 100644 libavformat/dvdclut.h diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 062ea2ea42..d3c7675631 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -391,6 +391,11 @@ often with junk data intended for controlling a real DVD player's buffering speed and with no other material data value. Default is 1, true. +@item clut_rgb @var{bool} +Output subtitle palettes (CLUTs) as RGB, required for Matroska. +Disable to output the palette in its original YUV colorspace. +Default is 1, true. + @end table @subsection Examples diff --git a/libavformat/Makefile b/libavformat/Makefile index df69734877..8f17e43e49 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -192,7 +192,7 @@ OBJS-$(CONFIG_DTS_MUXER) += rawenc.o OBJS-$(CONFIG_DV_MUXER) += dvenc.o OBJS-$(CONFIG_DVBSUB_DEMUXER) += dvbsub.o rawdec.o OBJS-$(CONFIG_DVBTXT_DEMUXER) += dvbtxt.o rawdec.o -OBJS-$(CONFIG_DVDVIDEO_DEMUXER) += dvdvideodec.o +OBJS-$(CONFIG_DVDVIDEO_DEMUXER) += dvdvideodec.o dvdclut.o OBJS-$(CONFIG_DXA_DEMUXER) += dxa.o OBJS-$(CONFIG_EA_CDATA_DEMUXER) += eacdata.o OBJS-$(CONFIG_EA_DEMUXER) += electronicarts.o diff --git a/libavformat/dvdclut.c b/libavformat/dvdclut.c new file mode 100644 index 0000000000..2f0d6be657 --- /dev/null +++ b/libavformat/dvdclut.c @@ -0,0 +1,83 @@ +/* + * DVD-Video subpicture CLUT (Color Lookup Table) utilities + * + * 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 + */ + +#include "libavutil/bprint.h" +#include "libavutil/colorspace.h" +#include "libavutil/common.h" + +#include "dvdclut.h" +#include "internal.h" + +/* crop table for YUV to RGB subpicture palette conversion */ +#define DVDCLUT_YUV_NEG_CROP_MAX 1024 + +int ff_dvdclut_palette_extradata_cat(const uint32_t *clut, + const size_t clut_size, + AVCodecParameters *par) +{ + int ret = 0; + AVBPrint bp; + + if (clut_size != FF_DVDCLUT_CLUT_SIZE) + return AVERROR(EINVAL); + + av_bprint_init(&bp, 0, FF_DVDCLUT_EXTRADATA_SIZE); + + av_bprintf(&bp, "palette: "); + + for (int i = 0; i < FF_DVDCLUT_CLUT_LEN; i++) + av_bprintf(&bp, "%06"PRIx32"%s", clut[i], + i != (FF_DVDCLUT_CLUT_LEN - 1) ? ", " : ""); + + av_bprintf(&bp, "\n"); + + ret = ff_bprint_to_codecpar_extradata(par, &bp); + + av_bprint_finalize(&bp, NULL); + + return ret; +} + +int ff_dvdclut_yuv_to_rgb(uint32_t *clut, const size_t clut_size) +{ + int y, cb, cr; + uint8_t r, g, b; + int r_add, g_add, b_add; + + if (clut_size != FF_DVDCLUT_CLUT_SIZE) + return AVERROR(EINVAL); + + for (int i = 0; i < FF_DVDCLUT_CLUT_LEN; i++) { + y = (clut[i] >> 16) & 0xFF; + cr = (clut[i] >> 8) & 0xFF; + cb = clut[i] & 0xFF; + + YUV_TO_RGB1_CCIR(cb, cr); + + y = (y - 16) * FIX(255.0 / 219.0); + r = av_clip_uint8((y + r_add - DVDCLUT_YUV_NEG_CROP_MAX) >> SCALEBITS); + g = av_clip_uint8((y + g_add - DVDCLUT_YUV_NEG_CROP_MAX) >> SCALEBITS); + b = av_clip_uint8((y + b_add - DVDCLUT_YUV_NEG_CROP_MAX) >> SCALEBITS); + + clut[i] = (r << 16) | (g << 8) | b; + } + + return 0; +} diff --git a/libavformat/dvdclut.h b/libavformat/dvdclut.h new file mode 100644 index 0000000000..41cea7e2c9 --- /dev/null +++ b/libavformat/dvdclut.h @@ -0,0 +1,37 @@ +/* + * DVD-Video subpicture CLUT (Color Lookup Table) utilities + * + * 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 AVFORMAT_DVDCLUT_H +#define AVFORMAT_DVDCLUT_H + +#include "libavcodec/codec_par.h" + +/* ("palette: ") + ("rrggbb, "*15) + ("rrggbb") + \n + \0 */ +#define FF_DVDCLUT_EXTRADATA_SIZE (9 + (8 * 15) + 6 + 1 + 1) +#define FF_DVDCLUT_CLUT_LEN 16 +#define FF_DVDCLUT_CLUT_SIZE FF_DVDCLUT_CLUT_LEN * sizeof(uint32_t) + +int ff_dvdclut_palette_extradata_cat(const uint32_t *clut, + const size_t clut_size, + AVCodecParameters *par); + +int ff_dvdclut_yuv_to_rgb(uint32_t *clut, const size_t clut_size); + +#endif /* AVFORMAT_DVDCLUT_H */ diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index f389afedb6..d46d4a2bdf 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -50,6 +50,7 @@ #include "avio_internal.h" #include "avlanguage.h" #include "demux.h" +#include "dvdclut.h" #include "internal.h" #include "url.h" @@ -96,6 +97,7 @@ typedef struct DVDVideoPGCSubtitleStreamEntry { int startcode; enum DVDVideoSubpictureViewport viewport; int disposition; + uint32_t clut[FF_DVDCLUT_CLUT_LEN]; const char *lang_iso; } DVDVideoPGCSubtitleStreamEntry; @@ -129,6 +131,7 @@ typedef struct DVDVideoDemuxContext { int opt_angle; /* the user-provided angle number (1-indexed) */ int opt_chapter_end; /* the user-provided exit PTT (0 for last) */ int opt_chapter_start; /* the user-provided entry PTT (1-indexed) */ + int opt_clut_rgb; /* output subtitle palette (CLUT) as RGB */ int opt_pg; /* the user-provided PG number (1-indexed) */ int opt_pgc; /* the user-provided PGC number (1-indexed) */ int opt_preindex; /* pre-indexing mode (2-pass read) */ @@ -1039,6 +1042,8 @@ break_error: static int dvdvideo_subp_stream_analyze(AVFormatContext *s, uint32_t offset, subp_attr_t subp_attr, DVDVideoPGCSubtitleStreamEntry *entry) { + DVDVideoDemuxContext *c = s->priv_data; + char lang_dvd[3] = {0}; entry->startcode = 0x20 + (offset & 0x1F); @@ -1046,6 +1051,11 @@ static int dvdvideo_subp_stream_analyze(AVFormatContext *s, uint32_t offset, sub if (subp_attr.lang_extension == 9) entry->disposition |= AV_DISPOSITION_FORCED; + memcpy(&entry->clut, c->play_state.pgc->palette, FF_DVDCLUT_CLUT_SIZE); + + if (c->opt_clut_rgb) + ff_dvdclut_yuv_to_rgb(entry->clut, FF_DVDCLUT_CLUT_SIZE); + AV_WB16(lang_dvd, subp_attr.lang_code); entry->lang_iso = ff_convert_lang_to(lang_dvd, AV_LANG_ISO639_2_BIBL); @@ -1067,6 +1077,9 @@ static int dvdvideo_subp_stream_add(AVFormatContext *s, DVDVideoPGCSubtitleStrea st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codecpar->codec_id = AV_CODEC_ID_DVD_SUBTITLE; + if ((ret = ff_dvdclut_palette_extradata_cat(entry->clut, FF_DVDCLUT_CLUT_SIZE, st->codecpar)) < 0) + return ret; + if (entry->lang_iso) av_dict_set(&st->metadata, "language", entry->lang_iso, 0); @@ -1393,6 +1406,7 @@ static const AVOption dvdvideo_options[] = { {"angle", "playback angle number", OFFSET(opt_angle), AV_OPT_TYPE_INT, { .i64=1 }, 1, 9, AV_OPT_FLAG_DECODING_PARAM }, {"chapter_end", "exit chapter (PTT) number (0=end)", OFFSET(opt_chapter_end), AV_OPT_TYPE_INT, { .i64=0 }, 0, 99, AV_OPT_FLAG_DECODING_PARAM }, {"chapter_start", "entry chapter (PTT) number", OFFSET(opt_chapter_start), AV_OPT_TYPE_INT, { .i64=1 }, 1, 99, AV_OPT_FLAG_DECODING_PARAM }, + {"clut_rgb", "output subtitle palette (CLUT) as RGB", OFFSET(opt_clut_rgb), AV_OPT_TYPE_BOOL, { .i64=1 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, {"pg", "entry PG number (0=auto)", OFFSET(opt_pg), AV_OPT_TYPE_INT, { .i64=0 }, 0, 255, AV_OPT_FLAG_DECODING_PARAM }, {"pgc", "entry PGC number (0=auto)", OFFSET(opt_pgc), AV_OPT_TYPE_INT, { .i64=0 }, 0, 999, AV_OPT_FLAG_DECODING_PARAM }, {"preindex", "enable for accurate chapter markers, slow (2-pass read)", OFFSET(opt_preindex), AV_OPT_TYPE_BOOL, { .i64=0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },