From patchwork Fri Feb 9 22:28:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 46145 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:a586:b0:19e:8a94:b663 with SMTP id gd6csp1238472pzc; Fri, 9 Feb 2024 14:29:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVhvrb1L4N7DNVB/DTFC+BZab8VINGRwbzZyCJy0xCY33PiNZjy04HPY8UhJDHUVCVNou3 X-Received: by 2002:aa7:d8ce:0:b0:560:e6b1:f73 with SMTP id k14-20020aa7d8ce000000b00560e6b10f73mr220443eds.16.1707517757675; Fri, 09 Feb 2024 14:29:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707517757; cv=none; d=google.com; s=arc-20160816; b=vQjJccnvqvlPMkIi/N2+ypK23VyCj5BMvAXqd9dxeHg/VdtBcUK81vw81r/pn4J1v+ THkdTNSt8QGxC2MDY11yaopJTtaoA71jUuqIvmDRt7yQ7I7xyJWiRho8WnpW41rrCZK8 ZVvjxqfIziB8ZA3xx1bTzRi+x5VfJ6TK4HQDzvdCVhcbPqt9PSpvMYFu+7HuXTNXNdcJ 5VZyH5vrMYLBxR5jnsy9bOtCfOmXps1KVcLa1cY/KUYAATYeksHQvV7g+FoSeEm/ozxE Sp+ZyjI4DZf7kKK2pufVp8JQN/oRnJovOW2WotadbxGx6Gg0WItgFYphhckKaErezdhb GT4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=QO72Ho7HGBjd60lWYh/HfRmvGbDdIhJQGP+PihJiOOg=; fh=KVKbc9N0Ici0pOk4OPezEPaWsCxNzoL2qlxTJoh0WiM=; b=NWrrPNdLAuIT+ge31elNkjwd6/NadZkvoGidFmd1f+/zdReXliVtJLs4nIlSdyCLyP NeHvRd9U2YJJZgAQdNLtSWt2lJvhl2Qv2aitr+4UjsdGQtB0J9yZToGhITjmoCC44CY/ f2I9ruaZ1upVvm2l4sip2PntqQo3iGyl6c+84bEbNOh7mo7ALPYtK1r6/Ienln1JRtkg Pjb+NOzS34W3zc70sk0RtA8/jYo54GKH5oGpLaMC8UGIM3L1x7lzJq/AJOKJZ67fW8r0 io2AjzyNdQuytCSrKzvIDnSIjmgX7lB0WLT5hhw5eK/fOdjrEPckZ8+JP75NBxrP9f5l 8WNQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ONsssr0f; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCVhjJ2Vh9y3OpAV4+Nb+dY4+4jY8/WaI/NMj574ax9V0+QNXId8vINKebhz7v/awwy9Rsv4cLaz8vT2TEEp4NCkFE7bDs5sMHfQdKXC+s0BedeQsXOWECxWGuvjaMNGBy3hBRS69GRmn3XbBmiaQHpQ74GqNw1cPmfGFkLQr42g8QhBUOEO2rtUuL2JFaAKY+SnlV0FfCewInU80jjx8Qq1oePJHH7sG1eIp7RECJ7UDa5AQWArFlaNfPbKE+qnc1ykIwEbB9YDPoZ5PEKNFDe5h0kDhbt0f/1bbAD0KNGxPm8ekgXhrs93NWA54/7I5ZrZABqeKk8yWWxcwOGyq0bARwEEvztC4CIniSGM+jNvNQ0nW5frmh59lIhE7UvVxpBnjkuazVWE/QrOtJKnNXKHRC9G7RW7yualg09E2F9OjbqKG61oK2d/i/9BWKaojXGE99l07IXr294Jbv2Us1Z3ZPE8W5aFqhbdHSF+oscgLsvNwHlGfhXq29fVW6ha20UvnqZfXCIde1dzKVdI4KFMOT8Q/zcQudTKxBzoD/OPTF2ETIMWUX/b4rBVNTywcrjx2+Hq5s3o79vIeB41d1kcON0wHbXTMHuGhJx1gzeVaL0dD3RC06yXPyJmtTxAFKupDofyaxSWxZM4DbHHIqy+gPS3WAn8EDXTeeE7B1NT77GID7D1jiN6xX59C5HpvfN7CsJAyDrU5/BBclFHJ4blpqIxaFgPfIPms7hDqQpoQ3ggDJrliX7bJvxHrxu56qLBxXJSZUJDQVPj5P4qlMBuQJEk8f3M2GkcdSkPGZvajO5etLVjcLB0MdVFvfqpRKgyTDjdOgvsinl5mF5CogFVM4tgdpS2De6iY3edYph+oN9b44U7SVu3MHc6tG49F1s752RoWiei2GiDyjA15AEpiY+ORsS7aqzrHo/CCv1/DKCmn/N3dS1/+8ZmY7VQ89FyGZ 8cA7l3dRD3rCW/u78hvDz9EiMJA/GA10H6J0jb3tBP2yGHCsdSPRSWV6GPSHLxqGMBfUHOQSYhfOeYUWrttd6e/RHtJ+6STZl2lfhxzuxePM/r3QChfto82BG/IMzsxRJ/542oZiEWhloD+7RjQYLIkFYZDymC/gsG5+ZXwD4lRtoW4e/ZEaC5QzbtsJUfdAAl8lfK1JakKCZu2rr+pONTu5mDdVzkCI5iqi/ux3l0otDbby2+SF5zA13KTW6XB97k3b6gaRsm4URfHz2mQhWX2orfUZq0CYry0O2DEsl6h+/els83sEgCjYUonJGz9ZDQzgWvagozkHWOudiPp0/dHgT4g/ndZtdqF3a3uJVyPH2J/SxqtM6p9FkII4nZTiH56otFkET+wWm5igc1nijfXryAiVmkV7wVdHm52DOAQ9tk0nk2W2KgxhKOfUg4DaEf7u0qMqjlDFM47rB6GeOVyF2jX9TAp1PgRtuJd3qEzsq53li9m3ikMDhMozwg+KtKSJ7zVpFhVAoHw+UbmIjOdJHWsRxZQWjhZduwMMFWepEiDlIoXCq7pk+TSNmhd33kVBM7LRdzhIdfKNiy4Mgs8a30WY1Su0v5HwejZowyX9mZnwxkITkoM+HF7BNd Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dj2-20020a05640231a200b00560fdf343e3si177302edb.679.2024.02.09.14.29.03; Fri, 09 Feb 2024 14:29:17 -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=@gmail.com header.s=20230601 header.b=ONsssr0f; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4093968D0B4; Sat, 10 Feb 2024 00:29:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 311B768CEAB for ; Sat, 10 Feb 2024 00:28:54 +0200 (EET) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2906bcae4feso1056558a91.3 for ; Fri, 09 Feb 2024 14:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707517731; x=1708122531; 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=Q94xUkXUYB7cjoxirJE809N12lXqz6h7Ilm+SoViwWA=; b=ONsssr0fcEDOHhn86kaXO1VWMtm7+Y2tDMc0T8eZZDYtm9C5kAygP9XHKQiTa6I8jw bR8YRNbPNGAFPFKyrjkZQlxK3CeFcW0hxmNuEgWEqX7LIl1bCwoj1wyS8WsOU7aX63Tt mUZLTvdK1Y886y9hXUSVUtffyxkkg9ZDkVocU4TNeGPi/tU4q9Lz7UfSFSvo5Bo3w3tN 40qqj9WOFs6nVnxOQcS1eIgpU6uDqFTMicB8CZfaQZItk/hAvZ8TS6RDTgXlL/9nosza o4PsbvyaMmhi+Q3PNfuMyV2dJ2wPqJuBADL+1fo5QYo4sM0tf5sjJbRv57hok99l5B64 HCtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707517731; x=1708122531; 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=Q94xUkXUYB7cjoxirJE809N12lXqz6h7Ilm+SoViwWA=; b=NGkGmD8/HjD5boQ+Aa3aW5ijcc+Jml97xJcN2YlOAnzXfGdP8aLVjmxEhZ/slr6Gog sc2L3pzKlt6PKeYFYYmCGWFyEDYSxDYi0tyxY3K1aaLZ96f/LA2lkNulT0QLk+UGJS+M ofk6+YBv1Vfpj5iLOwywD2riv84ycyvShzwMVhudmUQkjF5iS2ng83e/TO9nh94Ow+rZ gYVh2zZKJf2qXOZF846QlaksW3Fd8fKwaTTic5yixHfnroazMg/7cYmPHO8vj+VWl0np VgNVWVnqhJrlC9Bp3mziqExu9g/WAUceqoT5q9ZiDin3K5ucLZ64UVv9ygg7EkfsKlEK CDGA== X-Gm-Message-State: AOJu0YyedmjI/0Sic/ZZuLlYTuICYoTU5xRzbYIuuSzJOoRdTZCCZcNo wuZZEgqhvvcEpqeo7dvB2ERJDdQcG3y8cMjwP8g+CvFO/yAsxL2fmKB44yZx X-Received: by 2002:a17:90b:34a:b0:296:a462:454d with SMTP id fh10-20020a17090b034a00b00296a462454dmr405712pjb.28.1707517731262; Fri, 09 Feb 2024 14:28:51 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id ca1-20020a17090af30100b00296bf413fd0sm2330888pjb.35.2024.02.09.14.28.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 14:28:50 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Feb 2024 19:28:15 -0300 Message-ID: <20240209222817.13543-1-jamrial@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3 v9] avformat: add a Tile Grid stream group type 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: k/I3bIGoX/9/ This will be used to support tiled image formats like HEIF. Signed-off-by: James Almer --- Changed the API to support overlaping tiles, as well as leaving pixels unfilled. This allows us to implement Image Overlay HEIF support. libavformat/avformat.c | 5 ++ libavformat/avformat.h | 127 +++++++++++++++++++++++++++++++++++++++++ libavformat/dump.c | 29 ++++++++++ libavformat/options.c | 34 +++++++++++ 4 files changed, 195 insertions(+) diff --git a/libavformat/avformat.c b/libavformat/avformat.c index ca31d3dc56..f53ba4ce58 100644 --- a/libavformat/avformat.c +++ b/libavformat/avformat.c @@ -99,6 +99,11 @@ void ff_free_stream_group(AVStreamGroup **pstg) av_iamf_mix_presentation_free(&stg->params.iamf_mix_presentation); break; } + case AV_STREAM_GROUP_PARAMS_TILE_GRID: + av_opt_free(stg->params.tile_grid); + av_freep(&stg->params.tile_grid->offsets); + av_freep(&stg->params.tile_grid); + break; default: break; } diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 5d0fe82250..97f68531ac 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1018,10 +1018,136 @@ typedef struct AVStream { int pts_wrap_bits; } AVStream; +/** + * AVStreamGroupTileGrid holds information on how to combine several + * independent images on a single canvas for presentation. + * + * The following is an example of a simple grid with 3 rows and 4 columns: + * + * +---+---+---+---+ + * | 0 | 1 | 2 | 3 | + * +---+---+---+---+ + * | 4 | 5 | 6 | 7 | + * +---+---+---+---+ + * | 8 | 9 |10 |11 | + * +---+---+---+---+ + * + * Assuming all tiles have a dimension of 512x512, the + * @ref AVStreamGroupTileGrid.offsets "offset" of the topleft pixel of + * the first @ref AVStreamGroup.streams "stream" in the group is "0,0", the + * @ref AVStreamGroupTileGrid.offsets "offset" of the topleft pixel of + * the second @ref AVStreamGroup.streams "stream" in the group is "512,0", the + * @ref AVStreamGroupTileGrid.offsets "offset" of the topleft pixel of + * the fifth @ref AVStreamGroup.streams "stream" in the group is "0,512", the + * @ref AVStreamGroupTileGrid.offsets "offset", of the topleft pixel of + * the sixth @ref AVStreamGroup.streams "stream" in the group is "512,512", + * etc. + * + * The following is an example of a canvas with overlaping tiles: + * + * +---------------+ + * |***** | + * |* 0##### | + * |***# 1 # | + * | ##### | + * | | + * | | + * | | + * +---------------+ + * + * Assuming a canvas with size 2048x2048 and both tiles with a dimension of + * 512x512, a possible @ref AVStreamGroupTileGrid.offsets "offset" for the + * topleft pixel of the first @ref AVStreamGroup.streams "stream" in the group + * would be 256x256, and the @ref AVStreamGroupTileGrid.offsets "offset" for + * the topleft pixel of the second @ref AVStreamGroup.streams "stream" in the + * group would be 512x512. + * + * sizeof(AVStreamGroupTileGrid) is not a part of the ABI and may only be + * allocated by avformat_stream_group_create(). + */ +typedef struct AVStreamGroupTileGrid { + const AVClass *av_class; + + /** + * Width of the canvas. + * + * Must be > 0. + */ + int coded_width; + /** + * Width of the canvas. + * + * Must be > 0. + */ + int coded_height; + + /** + * An @ref AVStreamGroup.nb_streams "nb_streams" sized array of offsets in + * pixels from the topleft edge of the canvas, indicating where each stream + * should be placed. + * It must be allocated with the av_malloc() family of functions. + * + * - demuxing: set by libavformat, must not be modified by the caller. + * - muxing: set by the caller before avformat_write_header(). + * + * Freed by libavformat in avformat_free_context(). + */ + struct { + int x; + int y; + } *offsets; + + /** + * The pixel value per channel in RGBA format used if no pixel of any tile + * is located at a particular pixel location. + * + * @see av_image_fill_color(). + * @see av_parse_color(). + */ + uint8_t background[4]; + + /** + * Offset in pixels from the left edge of the canvas where the actual image + * meant for presentation starts. + * + * This field must be >= 0 and <= @ref coded_width. + */ + int horizontal_offset; + /** + * Offset in pixels from the top edge of the canvas where the actual image + * meant for presentation starts. + * + * This field must be >= 0 and <= @ref coded_height. + */ + int vertical_offset; + + /** + * Width of the final image for presentation. + * + * Must be > 0 and <= (@ref coded_width - @ref horizontal_offset). + * When it's not equal to (@ref coded_width - @ref horizontal_offset), the + * result of (@ref coded_width - width - @ref horizontal_offset) is the + * amount amount of pixels to be cropped from the right edge of the + * final image before presentation. + */ + int width; + /** + * Height of the final image for presentation. + * + * Must be > 0 and <= (@ref coded_height - @ref vertical_offset). + * When it's not equal to (@ref coded_height - @ref vertical_offset), the + * result of (@ref coded_height - height - @ref vertical_offset) is the + * amount amount of pixels to be cropped from the bottom edge of the + * final image before presentation. + */ + int height; +} AVStreamGroupTileGrid; + enum AVStreamGroupParamsType { AV_STREAM_GROUP_PARAMS_NONE, AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT, AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION, + AV_STREAM_GROUP_PARAMS_TILE_GRID, }; struct AVIAMFAudioElement; @@ -1062,6 +1188,7 @@ typedef struct AVStreamGroup { union { struct AVIAMFAudioElement *iamf_audio_element; struct AVIAMFMixPresentation *iamf_mix_presentation; + struct AVStreamGroupTileGrid *tile_grid; } params; /** diff --git a/libavformat/dump.c b/libavformat/dump.c index 9d37179bb7..756db8c87e 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -22,6 +22,7 @@ #include #include +#include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/display.h" #include "libavutil/iamf.h" @@ -738,6 +739,34 @@ static void dump_stream_group(const AVFormatContext *ic, uint8_t *printed, } break; } + case AV_STREAM_GROUP_PARAMS_TILE_GRID: { + const AVStreamGroupTileGrid *tile_grid = stg->params.tile_grid; + AVCodecContext *avctx = avcodec_alloc_context3(NULL); + const char *ptr = NULL; + av_log(NULL, AV_LOG_INFO, " Tile Grid:"); + if (avctx && stg->nb_streams && !avcodec_parameters_to_context(avctx, stg->streams[0]->codecpar)) { + avctx->width = tile_grid->width; + avctx->height = tile_grid->height; + avctx->coded_width = tile_grid->coded_width; + avctx->coded_height = tile_grid->coded_height; + if (ic->dump_separator) + av_opt_set(avctx, "dump_separator", ic->dump_separator, 0); + buf[0] = 0; + avcodec_string(buf, sizeof(buf), avctx, is_output); + ptr = av_stristr(buf, " "); + } + avcodec_free_context(&avctx); + if (ptr) + av_log(NULL, AV_LOG_INFO, "%s", ptr); + av_log(NULL, AV_LOG_INFO, "\n"); + dump_metadata(NULL, stg->metadata, " ", AV_LOG_INFO); + for (int i = 0; i < stg->nb_streams; i++) { + const AVStream *st = stg->streams[i]; + dump_stream_format(ic, st->index, i, index, is_output, AV_LOG_VERBOSE); + printed[st->index] = 1; + } + break; + } default: break; } diff --git a/libavformat/options.c b/libavformat/options.c index 03e6a2a7ff..a323aa7fe6 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -339,6 +339,28 @@ fail: return NULL; } +#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM +#define OFFSET(x) offsetof(AVStreamGroupTileGrid, x) +static const AVOption tile_grid_options[] = { + { "grid_size", "size of the output canvas", OFFSET(coded_width), + AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS }, + { "output_size", "size of valid pixels in output image meant for presentation", OFFSET(width), + AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS }, + { "background_color", "set a background color for unused pixels", + OFFSET(background), AV_OPT_TYPE_COLOR, { .str = "black"}, 0, 0, FLAGS }, + { "horizontal_offset", NULL, OFFSET(horizontal_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS }, + { "vertical_offset", NULL, OFFSET(vertical_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS }, + { NULL }, +}; +#undef FLAGS +#undef OFFSET + +static const AVClass tile_grid_class = { + .class_name = "AVStreamGroupTileGrid", + .version = LIBAVUTIL_VERSION_INT, + .option = tile_grid_options, +}; + static void *stream_group_child_next(void *obj, void *prev) { AVStreamGroup *stg = obj; @@ -348,6 +370,8 @@ static void *stream_group_child_next(void *obj, void *prev) return stg->params.iamf_audio_element; case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION: return stg->params.iamf_mix_presentation; + case AV_STREAM_GROUP_PARAMS_TILE_GRID: + return stg->params.tile_grid; default: break; } @@ -370,6 +394,9 @@ static const AVClass *stream_group_child_iterate(void **opaque) case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION: ret = av_iamf_mix_presentation_get_class(); break; + case AV_STREAM_GROUP_PARAMS_TILE_GRID: + ret = &tile_grid_class; + break; default: break; } @@ -431,6 +458,13 @@ AVStreamGroup *avformat_stream_group_create(AVFormatContext *s, if (!stg->params.iamf_mix_presentation) goto fail; break; + case AV_STREAM_GROUP_PARAMS_TILE_GRID: + stg->params.tile_grid = av_mallocz(sizeof(*stg->params.tile_grid)); + if (!stg->params.tile_grid) + goto fail; + stg->params.tile_grid->av_class = &tile_grid_class; + av_opt_set_defaults(stg->params.tile_grid); + break; default: goto fail; } From patchwork Fri Feb 9 22:28:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 46146 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:a586:b0:19e:8a94:b663 with SMTP id gd6csp1238476pzc; Fri, 9 Feb 2024 14:29:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtBHMt4jA6YWV5joALN0cII6R9aL8kIS8p8Aqz0eE2cFyidAP25BJyxv6oGIDCyRkJ7INs X-Received: by 2002:a17:906:358f:b0:a3b:fbc0:cd16 with SMTP id o15-20020a170906358f00b00a3bfbc0cd16mr418089ejb.24.1707517758304; Fri, 09 Feb 2024 14:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707517758; cv=none; d=google.com; s=arc-20160816; b=RHP4LZ3ojDnwl68Ce/qgNYMCiq0EN5np7eXECbgnVA5OkRYIBs00fxXcc7TljkgSSE lWOj4k7/PXoDen/qExPlHRadq/fVa/qFVOK3nwys2NfEfgHEEqbheOvb87V7q3xTx5hw KVn4Qd6iC7cYpTzgWThgWpxz6xRYSRttBKGQQs+jXGa5TjB/VKPHI5bF4wrF2Syeqdz7 92zYkGGtLpjFKDCvSrUHpvA+LLwugdH5s4A1e2Ir13xbPE+PhGBhPRN3n9jEY7Pygfek HYbwPNQigLH+pZk6NDHG2e5atv+3voBE7VeSdcTJv2EwOrvoM+5BpnflbrDN1PISs6Tq l08A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=28eLR8nrmNO97PFISXlmWszX5adyUoTosUCbRV4reHE=; fh=jvSqPM8jpcMz0D/e+R/xryecsaGAY2MczDGFIVxWfRw=; b=NZegS45ZOxWXbFS5m61ye5UJiBP9pn93/UN24rY87N+umiT5QnOLU7woAKZP20wrJj JAkIoOiR9bs1HzkqUJK9lH3Jqx7N+jYrDL9Ppr/Lrc8ghmVKHdRXWRmta0T5lyb6dvqm iQ0TXphPf5ZVQHFgynB5mGOheHc/apJ+6I90CckCmSW/MsBD5aZSom/4a+p2o8dHiGri dkiHRzR3Px2xMYAyeao/QFVeVStyGiFfsjYn6wzLvnGabN2UZWuJx2gPT9gv7g/7utJf EX7AomykAMPFwL129uWV85dZEJYdsnu4AVp12/27l6hjJm0qi93wQ0FCEIM0ZFJVgF4i 5pWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=kNlP0LRn; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCUqe3D4NSEI66K1THKx1xF9cnbIaNJR/uIYozoDBomTZycQXD6snfwn18bZqSN8G+enlcD+1Wxdbm0zB/FMttQMKxVC62Z6CNm43xSANvaObnDpF6suoMXj5BUkPiBugylFK64KRnUK2SLjjNAzSmwL8fLnGNN2Bwq4XLtX40eoLBqP2GP59m1W3/YBBrvOp2p/I9t0D5Zk7vBXQQJvBU5+BXiEhoA7reJE5YXgMykEXuhqHldsMC0sYw04PT+tlxbA+4HQNEfY8a2+titY5uz9rr/qAR6/+JfjylSGjo9r/qsjnPQnOjOmx7U0HQgt+WyTsX4WwgGAQemVBlIbiEM6/DySdTselqTulsj+D51tiLzRHP5OcgeswFjMxTuaPiEBa2RJ3+9BcniGgghalA/NKfpmIwohhojMICsOIzeXfq8oTLiq0JqVCRoxZyA/KpG/NNCljuATdVgn9jSO0Y9DvVd9Rpej8LCYf4dDFK9jeap4AdukK5RviOV8Ah6bYsJeyYxWfDmDZW24DlZOgB8e0LF8jVfsM1g3t5EAPy0SMg85WtUcqiRQI9sDyvVS/jv5kxfMQVAnBXZ7j2X2qzy+uz2hkSLtW0QJwWmr3MVAdAoUW5ipNX/fyFB/hKQiXCscH8oNyERZQGAQPIjNICNIPBNy1Ia3vVhS+5qkZvJvbcP+gaiMRZVITc+A9RNGvsa9jHYkXS65lnmnrb/2ATrelmm2j2k/bz4tYuyw5q41+0VZwitOWM7lmhduiLeLww2eE2t5yzplvEY/2XzttRl6wo/ib4+Pu87refik18qXChzDqLrTugkE6WxPUzneu/y3EqQFz8LjSFCAoXJlUCtG0Y4PozXNSqwlfRY/3I8DDyGUOG9+oD7CXkYdwdGXLHg+/MEVph+NksO8h3a9+CKGGcfQkQSHVx2SAez3hpkl2PuiNNr84LHfQKozqfOSI/G7vk E+Xu8KXLvPK8md8cgf5hFcw+4/y7kZOq+J22FBJ+PQNi1S7HPyUTJSM4uDjW1PuIPjjBkj1Ohd8ZHqx+zCQCwkiY//wXrkMcBgYi8mMe4PaVC/zhtw5qxXi0ddWdfdpLjkVw9i3lr/6JO+g/nHZqolQ8C53ILutuOFH066JQR38VUmGn4AfbiUfUb+pwT8WVA7rXeYwrZwvmA+rDU+DTQBN9fGrpH0I3+KhFtdgXw3bUgpvSJvh3iv2h/OSCDlEzDXksEMFEOXVGs3GD8jcTsilCMKANN/0pNv55bkMCj3cHi85ciq5LkBlJCT+oUaIlR6eyIZKVQB9oaqQ0MRHAaSjvd44VUgG3yHWFtFgcqW4d0KX3VUvnsc7n6rGm3synxMQwXzckYLUD7Ny/sMMjSsu+MF6qQNRViYkfgCqagAnecBpkCws6liGwkNAhfTklgEJL00zTlboaqyfWJUM1ALaQMFVSFTEKKOaquhSByzevf50rUHTENpYCw1QelLxP4lfBWEC4czvTp35IH6+TmcNjE3L5iQx7yJ+0WYSKOwt04/jqgxmn0pr9g2MfIFdUbKRbO305uYJ6l+pz19tY0ZiCQq5ewp5uSlfou3c+D/OQZYnY/KrTKXyjRGTPs4k1tF Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i23-20020a1709061cd700b00a38461f6447si1261937ejh.507.2024.02.09.14.29.11; Fri, 09 Feb 2024 14:29:18 -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=@gmail.com header.s=20230601 header.b=kNlP0LRn; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B38668D0F5; Sat, 10 Feb 2024 00:29:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2CFB468CEAB for ; Sat, 10 Feb 2024 00:28:56 +0200 (EET) Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-5d4a1e66750so987010a12.0 for ; Fri, 09 Feb 2024 14:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707517733; x=1708122533; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6r8DJlEz38tWbC6hCF/MiFi0EhEhFeuBic23EeSuVF0=; b=kNlP0LRnTL89gCYNshU+hbd3oyN/oFitrjQt4+4MtV/yAPz1tgfqAEOCWenw6VKYou TWOZfNYWW6XG4qgss8CS4nzNbxHYdSu4xYZfa7kUQ2WXd+sTxWwouGRSLyQZ9Pa9hHUw JbXCBk6PqKkGZ12Dmz9fmDjwwp7zE8SqKgdql+Ol8m4Ke8awTgeSgNghHN+U2wNHzF1u 3RmRye69jKd5EI0+aQrnhJQWUe7+2mH5GA8LNDAFKynbP2/DOvaqYLy8fyexh6ztirHW rn9XmQXnNKTvWmhxnUDUU6YdOgPYu3MKepA0BsArUii7X6NZJc7+tI8arpHQ0nWSxPbv x+Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707517733; x=1708122533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6r8DJlEz38tWbC6hCF/MiFi0EhEhFeuBic23EeSuVF0=; b=rmpWxqHTA6yyVaXxvJ6Lj00v7LGyiW1Vr3KRg0/NSlrzLhPHssMa/yn/ApIvl0ZD2t E/GwDuaRNAxn35/M5yawWfHHsS9FnjtRv1VkKxtSGgVLLs9zY6EcyD3hwi/3WOu+ni/q wShTz1h88Qm+1rerXtxauJOfLlAVxYdfcA0no7n+w6wFr96b2dJOuKbhY/yxP9C2I21h cX9xnOvFfgpBgu7jUPVO8MzFkjr6UyrlV0bgbZWLYdKHbQ5PRCwTc4J1iKk1gzea79PA p32VikZq4bxDHfGmCMzAyWZ8Fo8qT+peDaanM3fdGk4fvjdDL6Cw8wHcTL9FEe6LJGrc JyAg== X-Gm-Message-State: AOJu0YxGg+2drYvdq/Jpk6w7DudkPDbAuaEtYxEDN+JMgG0xPykM94lu wkElQ/sxwsvpl0H0ic9hDWpcEUXUMZb7wWhc4DUvCSWcZ75reM7TPKe0iWeU X-Received: by 2002:a17:90a:1f41:b0:296:a62f:a0d2 with SMTP id y1-20020a17090a1f4100b00296a62fa0d2mr405691pjy.32.1707517733141; Fri, 09 Feb 2024 14:28:53 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id ca1-20020a17090af30100b00296bf413fd0sm2330888pjb.35.2024.02.09.14.28.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 14:28:52 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Feb 2024 19:28:16 -0300 Message-ID: <20240209222817.13543-2-jamrial@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209222817.13543-1-jamrial@gmail.com> References: <20240209222817.13543-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3 v7] avformat/mov: add support for tile HEIF still images 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: fELWdkDRNojj Export each tile as its own stream, and the grid information as a Stream Group of type TILE_GRID. This also enables exporting other stream items like thumbnails, which may be present in non tiled HEIF images too. For those, the primary stream will be tagged with the default disposition. Based on a patch by Swaraj Hota Signed-off-by: James Almer --- Now supporting Image Overlay derived images, by parsing the iovl item type. libavformat/avformat.c | 8 + libavformat/avformat.h | 6 + libavformat/dump.c | 2 + libavformat/internal.h | 5 + libavformat/isom.h | 15 +- libavformat/mov.c | 484 +++++++++++++++++++++++++++++++++++++---- 6 files changed, 475 insertions(+), 45 deletions(-) diff --git a/libavformat/avformat.c b/libavformat/avformat.c index f53ba4ce58..eb898223d2 100644 --- a/libavformat/avformat.c +++ b/libavformat/avformat.c @@ -119,6 +119,14 @@ void ff_remove_stream(AVFormatContext *s, AVStream *st) ff_free_stream(&s->streams[ --s->nb_streams ]); } +void ff_remove_stream_group(AVFormatContext *s, AVStreamGroup *stg) +{ + av_assert0(s->nb_stream_groups > 0); + av_assert0(s->stream_groups[ s->nb_stream_groups - 1 ] == stg); + + ff_free_stream_group(&s->stream_groups[ --s->nb_stream_groups ]); +} + /* XXX: suppress the packet queue */ void ff_flush_packet_queue(AVFormatContext *s) { diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 97f68531ac..98954ce112 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -811,6 +811,12 @@ typedef struct AVIndexEntry { * The video stream contains still images. */ #define AV_DISPOSITION_STILL_IMAGE (1 << 20) +/** + * The video stream is intended to be merged with another stream before + * presentation. + * Used for example to signal the stream contains a tile from a HEIF grid. + */ +#define AV_DISPOSITION_TILE (1 << 21) /** * @return The AV_DISPOSITION_* flag corresponding to disp or a negative error diff --git a/libavformat/dump.c b/libavformat/dump.c index 756db8c87e..6123ca58a5 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -657,6 +657,8 @@ static void dump_stream_format(const AVFormatContext *ic, int i, av_log(NULL, log_level, " (still image)"); if (st->disposition & AV_DISPOSITION_NON_DIEGETIC) av_log(NULL, log_level, " (non-diegetic)"); + if (st->disposition & AV_DISPOSITION_TILE) + av_log(NULL, log_level, " (tile)"); av_log(NULL, log_level, "\n"); dump_metadata(NULL, st->metadata, extra_indent, log_level); diff --git a/libavformat/internal.h b/libavformat/internal.h index c66f959e9f..5603ca1ab5 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -637,6 +637,11 @@ void ff_remove_stream(AVFormatContext *s, AVStream *st); * is not yet attached to an AVFormatContext. */ void ff_free_stream_group(AVStreamGroup **pstg); +/** + * Remove a stream group from its AVFormatContext and free it. + * The stream group must be the last stream group of the AVFormatContext. + */ +void ff_remove_stream_group(AVFormatContext *s, AVStreamGroup *stg); unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id); diff --git a/libavformat/isom.h b/libavformat/isom.h index a4cca4c798..ade6d88faf 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -267,15 +267,24 @@ typedef struct MOVStreamContext { typedef struct HEIFItem { AVStream *st; + char *name; int item_id; int64_t extent_length; int64_t extent_offset; - int64_t size; + int tile_rows; + int tile_cols; int width; int height; int type; + int is_idat_relative; } HEIFItem; +typedef struct HEIFGrid { + HEIFItem *item; + int16_t *tile_id_list; + int nb_tiles; +} HEIFGrid; + typedef struct MOVContext { const AVClass *class; ///< class for private options AVFormatContext *fc; @@ -339,6 +348,10 @@ typedef struct MOVContext { int cur_item_id; HEIFItem *heif_item; int nb_heif_item; + HEIFGrid *heif_grid; + int nb_heif_grid; + int thmb_item_id; + int64_t idat_offset; int interleaved_read; } MOVContext; diff --git a/libavformat/mov.c b/libavformat/mov.c index 42b0135987..02662bead0 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -185,6 +185,30 @@ static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len, return p - dst; } +static AVStream *get_curr_st(MOVContext *c) +{ + AVStream *st = NULL; + + if (c->fc->nb_streams < 1) + return NULL; + + for (int i = 0; i < c->nb_heif_item; i++) { + HEIFItem *item = &c->heif_item[i]; + + if (!item->st) + continue; + if (item->st->id != c->cur_item_id) + continue; + + st = item->st; + break; + } + if (!st) + st = c->fc->streams[c->fc->nb_streams-1]; + + return st; +} + static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len) { AVStream *st; @@ -1767,9 +1791,9 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom) uint16_t color_primaries, color_trc, color_matrix; int ret; - if (c->fc->nb_streams < 1) + st = get_curr_st(c); + if (!st) return 0; - st = c->fc->streams[c->fc->nb_streams - 1]; ret = ffio_read_size(pb, color_parameter_type, 4); if (ret < 0) @@ -2117,9 +2141,9 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom) AVStream *st; int ret; - if (c->fc->nb_streams < 1) + st = get_curr_st(c); + if (!st) return 0; - st = c->fc->streams[c->fc->nb_streams-1]; if ((uint64_t)atom.size > (1<<30)) return AVERROR_INVALIDDATA; @@ -4951,12 +4975,10 @@ static int heif_add_stream(MOVContext *c, HEIFItem *item) st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; st->codecpar->codec_id = mov_codec_id(st, item->type); sc->ffindex = st->index; - c->trak_index = st->index; st->avg_frame_rate.num = st->avg_frame_rate.den = 1; st->time_base.num = st->time_base.den = 1; st->nb_frames = 1; sc->time_scale = 1; - sc = st->priv_data; sc->pb = c->fc->pb; sc->pb_is_copied = 1; @@ -7809,11 +7831,18 @@ static int mov_read_pitm(MOVContext *c, AVIOContext *pb, MOVAtom atom) return atom.size; } +static int mov_read_idat(MOVContext *c, AVIOContext *pb, MOVAtom atom) +{ + c->idat_offset = avio_tell(pb); + return 0; +} + static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) { + HEIFItem *heif_item; int version, offset_size, length_size, base_offset_size, index_size; int item_count, extent_count; - uint64_t base_offset, extent_offset, extent_length; + int64_t base_offset, extent_offset, extent_length; uint8_t value; if (c->found_moov) { @@ -7832,17 +7861,20 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) base_offset_size = (value >> 4) & 0xF; index_size = !version ? 0 : (value & 0xF); if (index_size) { - av_log(c->fc, AV_LOG_ERROR, "iloc: index_size != 0 not supported.\n"); + avpriv_report_missing_feature(c->fc, "iloc: index_size != 0"); return AVERROR_PATCHWELCOME; } item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); - if (!c->heif_item) { - c->heif_item = av_calloc(item_count, sizeof(*c->heif_item)); - if (!c->heif_item) - return AVERROR(ENOMEM); - c->nb_heif_item = item_count; - } + heif_item = av_realloc_array(c->heif_item, item_count, sizeof(*c->heif_item)); + if (!heif_item) + return AVERROR(ENOMEM); + c->heif_item = heif_item; + if (item_count > c->nb_heif_item) + memset(c->heif_item + c->nb_heif_item, 0, + sizeof(*c->heif_item) * (item_count - c->nb_heif_item)); + c->nb_heif_item = FFMAX(c->nb_heif_item, item_count); + c->cur_item_id = 0; av_log(c->fc, AV_LOG_TRACE, "iloc: item_count %d\n", item_count); for (int i = 0; i < item_count; i++) { @@ -7852,7 +7884,7 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (avio_feof(pb)) return AVERROR_INVALIDDATA; if (offset_type > 1) { - avpriv_request_sample(c->fc, "iloc offset type %d", offset_type); + avpriv_report_missing_feature(c->fc, "iloc offset type %d", offset_type); return AVERROR_PATCHWELCOME; } c->heif_item[i].item_id = item_id; @@ -7863,13 +7895,15 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) extent_count = avio_rb16(pb); if (extent_count > 1) { // For still AVIF images, we only support one extent item. - av_log(c->fc, AV_LOG_ERROR, "iloc: extent_count > 1 not supported\n"); + avpriv_report_missing_feature(c->fc, "iloc: extent_count > 1"); return AVERROR_PATCHWELCOME; } for (int j = 0; j < extent_count; j++) { if (rb_size(pb, &extent_offset, offset_size) < 0 || rb_size(pb, &extent_length, length_size) < 0) return AVERROR_INVALIDDATA; + if (offset_type == 1) + c->heif_item[i].is_idat_relative = 1; c->heif_item[i].extent_length = extent_length; c->heif_item[i].extent_offset = base_offset + extent_offset; av_log(c->fc, AV_LOG_TRACE, "iloc: item_idx %d, offset_type %d, " @@ -7884,7 +7918,7 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom) { - char item_name[128]; + AVBPrint item_name; int64_t size = atom.size; uint32_t item_type; int item_id; @@ -7894,27 +7928,32 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); // flags. size -= 4; - if (version != 2) { - av_log(c->fc, AV_LOG_ERROR, "infe: version != 2 not supported\n"); + if (version < 2) { + av_log(c->fc, AV_LOG_ERROR, "infe: version < 2 not supported\n"); return AVERROR_PATCHWELCOME; } - item_id = avio_rb16(pb); + item_id = version > 2 ? avio_rb32(pb) : avio_rb16(pb); avio_rb16(pb); // item_protection_index item_type = avio_rl32(pb); size -= 8; - size -= avio_get_str(pb, INT_MAX, item_name, sizeof(item_name)); - av_log(c->fc, AV_LOG_TRACE, "infe: item_id %d, item_type %s, item_name %s\n", - item_id, av_fourcc2str(item_type), item_name); + av_bprint_init(&item_name, 0, AV_BPRINT_SIZE_UNLIMITED); + ret = ff_read_string_to_bprint_overwrite(pb, &item_name, size); + if (ret < 0) { + av_bprint_finalize(&item_name, NULL); + return ret; + } - // Skip all but the primary item until support is added - if (item_id != c->primary_item_id) - return 0; + av_log(c->fc, AV_LOG_TRACE, "infe: item_id %d, item_type %s, item_name %s\n", + item_id, av_fourcc2str(item_type), item_name.str); + size -= ret + 1; if (size > 0) avio_skip(pb, size); + if (ret) + av_bprint_finalize(&item_name, &c->heif_item[c->cur_item_id].name); c->heif_item[c->cur_item_id].item_id = item_id; c->heif_item[c->cur_item_id].type = item_type; @@ -7925,9 +7964,6 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (ret < 0) return ret; break; - default: - av_log(c->fc, AV_LOG_TRACE, "infe: ignoring item_type %s\n", av_fourcc2str(item_type)); - break; } c->cur_item_id++; @@ -7937,6 +7973,7 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_iinf(MOVContext *c, AVIOContext *pb, MOVAtom atom) { + HEIFItem *heif_item; int entry_count; int version, ret; @@ -7954,13 +7991,14 @@ static int mov_read_iinf(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); // flags. entry_count = version ? avio_rb32(pb) : avio_rb16(pb); - if (!c->heif_item) { - c->heif_item = av_calloc(entry_count, sizeof(*c->heif_item)); - if (!c->heif_item) - return AVERROR(ENOMEM); - c->nb_heif_item = entry_count; - } - + heif_item = av_realloc_array(c->heif_item, entry_count, sizeof(*c->heif_item)); + if (!heif_item) + return AVERROR(ENOMEM); + c->heif_item = heif_item; + if (entry_count > c->nb_heif_item) + memset(c->heif_item + c->nb_heif_item, 0, + sizeof(*c->heif_item) * (entry_count - c->nb_heif_item)); + c->nb_heif_item = FFMAX(c->nb_heif_item, entry_count); c->cur_item_id = 0; for (int i = 0; i < entry_count; i++) { @@ -7977,11 +8015,124 @@ static int mov_read_iinf(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } +static int mov_read_iref_dimg(MOVContext *c, AVIOContext *pb, int version) +{ + HEIFItem *item = NULL; + HEIFGrid *grid; + int entries, i; + int from_item_id = version ? avio_rb32(pb) : avio_rb16(pb); + + for (int i = 0; i < c->nb_heif_grid; i++) { + if (c->heif_grid[i].item->item_id == from_item_id) { + av_log(c->fc, AV_LOG_ERROR, "More than one 'dimg' box " + "referencing the same 'grid'\n"); + return AVERROR_INVALIDDATA; + } + } + for (int i = 0; i < c->nb_heif_item; i++) { + if (c->heif_item[i].item_id != from_item_id) + continue; + item = &c->heif_item[i]; + + switch (item->type) { + case MKTAG('g','r','i','d'): + case MKTAG('i','o','v','l'): + break; + default: + avpriv_report_missing_feature(c->fc, "Derived item of type %s", + av_fourcc2str(item->type)); + return 0; + } + break; + } + if (!item) { + av_log(c->fc, AV_LOG_ERROR, "Missing grid information\n"); + return AVERROR_INVALIDDATA; + } + + grid = av_realloc_array(c->heif_grid, c->nb_heif_grid + 1U, + sizeof(*c->heif_grid)); + if (!grid) + return AVERROR(ENOMEM); + c->heif_grid = grid; + grid = &grid[c->nb_heif_grid++]; + + entries = avio_rb16(pb); + grid->tile_id_list = av_malloc_array(entries, sizeof(*grid->tile_id_list)); + if (!grid->tile_id_list) + return AVERROR(ENOMEM); + /* 'to' item ids */ + for (i = 0; i < entries; i++) + grid->tile_id_list[i] = version ? avio_rb32(pb) : avio_rb16(pb); + grid->nb_tiles = entries; + grid->item = item; + + av_log(c->fc, AV_LOG_TRACE, "dimg: from_item_id %d, entries %d\n", + from_item_id, entries); + + return 0; +} + +static int mov_read_iref_thmb(MOVContext *c, AVIOContext *pb, int version) +{ + int entries; + int to_item_id, from_item_id = version ? avio_rb32(pb) : avio_rb16(pb); + + entries = avio_rb16(pb); + if (entries > 1) { + avpriv_request_sample(c->fc, "thmb in iref referencing several items"); + return AVERROR_PATCHWELCOME; + } + /* 'to' item ids */ + to_item_id = version ? avio_rb32(pb) : avio_rb16(pb); + + if (to_item_id != c->primary_item_id) + return 0; + + c->thmb_item_id = from_item_id; + + av_log(c->fc, AV_LOG_TRACE, "thmb: from_item_id %d, entries %d\n", + from_item_id, entries); + + return 0; +} + static int mov_read_iref(MOVContext *c, AVIOContext *pb, MOVAtom atom) { - avio_rb32(pb); /* version and flags */ + int version = avio_r8(pb); + avio_rb24(pb); // flags atom.size -= 4; - return mov_read_default(c, pb, atom); + + if (version > 1) { + av_log(c->fc, AV_LOG_WARNING, "Unknown iref box version %d\n", version); + return 0; + } + + while (atom.size) { + uint32_t type, size = avio_rb32(pb); + int64_t next = avio_tell(pb); + + if (size < 14 || next < 0 || next > INT64_MAX - size) + return AVERROR_INVALIDDATA; + + next += size - 4; + type = avio_rl32(pb); + switch (type) { + case MKTAG('d','i','m','g'): + mov_read_iref_dimg(c, pb, version); + break; + case MKTAG('t','h','m','b'): + mov_read_iref_thmb(c, pb, version); + break; + default: + av_log(c->fc, AV_LOG_DEBUG, "Unknown iref type %s size %"PRIu32"\n", + av_fourcc2str(type), size); + } + + atom.size -= size; + avio_seek(pb, next, SEEK_SET); + } + return 0; } static int mov_read_ispe(MOVContext *c, AVIOContext *pb, MOVAtom atom) @@ -8104,10 +8255,6 @@ static int mov_read_iprp(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_log(c->fc, AV_LOG_TRACE, "ipma: property_index %d, item_id %d, item_type %s\n", index + 1, item_id, av_fourcc2str(ref->type)); - // Skip properties referencing items other than the primary item until support is added - if (item_id != c->primary_item_id) - continue; - c->cur_item_id = item_id; ret = mov_read_default(c, &ref->b.pub, @@ -8236,6 +8383,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = { { MKTAG('p','c','m','C'), mov_read_pcmc }, /* PCM configuration box */ { MKTAG('p','i','t','m'), mov_read_pitm }, { MKTAG('e','v','c','C'), mov_read_glbl }, +{ MKTAG('i','d','a','t'), mov_read_idat }, { MKTAG('i','r','e','f'), mov_read_iref }, { MKTAG('i','s','p','e'), mov_read_ispe }, { MKTAG('i','p','r','p'), mov_read_iprp }, @@ -8745,7 +8893,12 @@ static int mov_read_close(AVFormatContext *s) av_freep(&mov->aes_decrypt); av_freep(&mov->chapter_tracks); + for (i = 0; i < mov->nb_heif_item; i++) + av_freep(&mov->heif_item[i].name); av_freep(&mov->heif_item); + for (i = 0; i < mov->nb_heif_grid; i++) + av_freep(&mov->heif_grid[i].tile_id_list); + av_freep(&mov->heif_grid); return 0; } @@ -8885,6 +9038,224 @@ fail: return ret; } +static int read_image_grid(AVFormatContext *s, AVStreamGroup *stg, + AVStreamGroupTileGrid *tile_grid, HEIFGrid *grid) +{ + MOVContext *c = s->priv_data; + HEIFItem *item = grid->item; + int64_t offset = 0, pos = avio_tell(s->pb); + int x = 0, y = 0, i = 0; + int ret, flags, size; + + if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL)) { + av_log(c->fc, AV_LOG_INFO, "grid box with non seekable input\n"); + return AVERROR_PATCHWELCOME; + } + if (item->is_idat_relative) { + if (!c->idat_offset) { + av_log(c->fc, AV_LOG_ERROR, "missing idat box required by the image grid\n"); + return AVERROR_INVALIDDATA; + } + offset = c->idat_offset; + } + + avio_seek(s->pb, item->extent_offset + offset, SEEK_SET); + + avio_r8(s->pb); /* version */ + flags = avio_r8(s->pb); + + item->tile_rows = avio_r8(s->pb) + 1; + item->tile_cols = avio_r8(s->pb) + 1; + /* actual width and height of output image */ + tile_grid->width = (flags & 1) ? avio_rb32(s->pb) : avio_rb16(s->pb); + tile_grid->height = (flags & 1) ? avio_rb32(s->pb) : avio_rb16(s->pb); + + av_log(c->fc, AV_LOG_TRACE, "grid: grid_rows %d grid_cols %d output_width %d output_height %d\n", + item->tile_rows, item->tile_cols, tile_grid->width, tile_grid->height); + + avio_seek(s->pb, pos, SEEK_SET); + + size = grid->item->tile_rows * grid->item->tile_cols; + for (int i = 0; i < grid->item->tile_cols; i++) + tile_grid->coded_width += stg->streams[i]->codecpar->width; + for (int i = 0; i < size; i += grid->item->tile_cols) + tile_grid->coded_height += stg->streams[i]->codecpar->height; + + tile_grid->offsets = av_calloc(grid->nb_tiles, sizeof(*tile_grid->offsets)); + if (!tile_grid->offsets) + return AVERROR(ENOMEM); + + while (y < tile_grid->coded_height) { + int left_col = i; + + while (x < tile_grid->coded_width) { + if (i == grid->nb_tiles) { + ret = AVERROR(EINVAL); + goto fail; + } + + tile_grid->offsets[i].x = x; + tile_grid->offsets[i].y = y; + + x += stg->streams[i++]->codecpar->width; + } + + if (x > tile_grid->coded_width) { + avpriv_request_sample(s, "Non uniform HEIF tiles"); + ret = AVERROR_PATCHWELCOME; + goto fail; + } + + x = 0; + y += stg->streams[left_col]->codecpar->height; + } + + if (y > tile_grid->coded_height || i != grid->nb_tiles) { + avpriv_request_sample(s, "Non uniform HEIF tiles"); + ret = AVERROR_PATCHWELCOME; + goto fail; + } + + return 0; +fail: + av_freep(&tile_grid->offsets); + + return ret; +} + +static int read_image_overlay(AVFormatContext *s, AVStreamGroupTileGrid *tile_grid, + HEIFGrid *grid) +{ + MOVContext *c = s->priv_data; + HEIFItem *item = grid->item; + uint16_t canvas_fill_value[4]; + int64_t offset = 0, pos = avio_tell(s->pb); + int flags; + + if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL)) { + av_log(c->fc, AV_LOG_INFO, "iovl box with non seekable input\n"); + return AVERROR_PATCHWELCOME; + } + if (item->is_idat_relative) { + if (!c->idat_offset) { + av_log(c->fc, AV_LOG_ERROR, "missing idat box required by the image overlay\n"); + return AVERROR_INVALIDDATA; + } + offset = c->idat_offset; + } + + avio_seek(s->pb, item->extent_offset + offset, SEEK_SET); + + avio_r8(s->pb); /* version */ + flags = avio_r8(s->pb); + + for (int i = 0; i < 4; i++) + canvas_fill_value[i] = avio_rb16(s->pb); + av_log(c->fc, AV_LOG_TRACE, "iovl: canvas_fill_value { %u, %u, %u, %u }\n", + canvas_fill_value[0], canvas_fill_value[1], + canvas_fill_value[2], canvas_fill_value[3]); + for (int i = 0; i < 4; i++) + tile_grid->background[i] = canvas_fill_value[i]; + + /* actual width and height of output image */ + tile_grid->width = + tile_grid->coded_width = (flags & 1) ? avio_rb32(s->pb) : avio_rb16(s->pb); + tile_grid->height = + tile_grid->coded_height = (flags & 1) ? avio_rb32(s->pb) : avio_rb16(s->pb); + av_log(c->fc, AV_LOG_TRACE, "iovl: output_width %d, output_height %d\n", + tile_grid->width, tile_grid->height); + + tile_grid->offsets = av_calloc(grid->nb_tiles, sizeof(*tile_grid->offsets)); + if (!tile_grid->offsets) + return AVERROR(ENOMEM); + + for (int i = 0; i < grid->nb_tiles; i++) { + tile_grid->offsets[i].x = (flags & 1) ? avio_rb32(s->pb) : avio_rb16(s->pb); + tile_grid->offsets[i].y = (flags & 1) ? avio_rb32(s->pb) : avio_rb16(s->pb); + av_log(c->fc, AV_LOG_TRACE, "iovl: horizontal_offset[%d] %d, vertical_offset[%d] %d\n", + i, tile_grid->offsets[i].x, i, tile_grid->offsets[i].y); + } + + avio_seek(s->pb, pos, SEEK_SET); + + return 0; +} + +static int mov_parse_tiles(AVFormatContext *s) +{ + MOVContext *mov = s->priv_data; + + for (int i = 0; i < mov->nb_heif_grid; i++) { + AVStreamGroup *stg = avformat_stream_group_create(s, AV_STREAM_GROUP_PARAMS_TILE_GRID, NULL); + AVStreamGroupTileGrid *tile_grid; + HEIFGrid *grid = &mov->heif_grid[i]; + int err, loop = 1; + + if (!stg) + return AVERROR(ENOMEM); + + stg->id = grid->item->item_id; + tile_grid = stg->params.tile_grid; + + for (int j = 0; j < grid->nb_tiles; j++) { + int tile_id = grid->tile_id_list[j]; + + for (int k = 0; k < mov->nb_heif_item; k++) { + const HEIFItem *item = &mov->heif_item[k]; + AVStream *st = item->st; + + if (item->item_id != tile_id) + continue; + if (!st) { + av_log(s, AV_LOG_WARNING, "HEIF item id %d from grid id %d doesn't " + "reference a stream\n", + tile_id, grid->item->item_id); + ff_remove_stream_group(s, stg); + loop = 0; + break; + } + + st->codecpar->width = item->width; + st->codecpar->height = item->height; + + err = avformat_stream_group_add_stream(stg, st); + if (err == AVERROR(EEXIST)) + return AVERROR_INVALIDDATA; + else if (err < 0) + return err; + + st->disposition |= AV_DISPOSITION_TILE; + break; + } + + if (!loop) + break; + } + + if (!loop) + continue; + + switch (grid->item->type) { + case MKTAG('g','r','i','d'): + err = read_image_grid(s, stg, tile_grid, grid); + break; + case MKTAG('i','o','v','l'): + err = read_image_overlay(s, tile_grid, grid); + break; + default: + av_assert0(0); + } + if (err < 0) + return err; + + + if (grid->item->name) + av_dict_set(&stg->metadata, "title", grid->item->name, 0); + } + + return 0; +} + static int mov_read_header(AVFormatContext *s) { MOVContext *mov = s->priv_data; @@ -8901,6 +9272,8 @@ static int mov_read_header(AVFormatContext *s) mov->fc = s; mov->trak_index = -1; + mov->thmb_item_id = -1; + mov->primary_item_id = -1; /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */ if (pb->seekable & AVIO_SEEKABLE_NORMAL) atom.size = avio_size(pb); @@ -8923,20 +9296,43 @@ static int mov_read_header(AVFormatContext *s) av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb)); if (mov->found_iloc) { + if (mov->nb_heif_grid) { + err = mov_parse_tiles(s); + if (err < 0) + return err; + } + for (i = 0; i < mov->nb_heif_item; i++) { HEIFItem *item = &mov->heif_item[i]; MOVStreamContext *sc; AVStream *st; + int64_t offset = 0; - if (!item->st) + if (!item->st) { + if (item->item_id == mov->thmb_item_id) { + av_log(s, AV_LOG_ERROR, "HEIF thumbnail doesn't reference a stream\n"); + return AVERROR_INVALIDDATA; + } continue; + } + if (item->is_idat_relative) { + if (!mov->idat_offset) { + av_log(s, AV_LOG_ERROR, "Missing idat box for item %d\n", item->item_id); + return AVERROR_INVALIDDATA; + } + offset = mov->idat_offset; + } st = item->st; sc = st->priv_data; st->codecpar->width = item->width; st->codecpar->height = item->height; + sc->sample_sizes[0] = item->extent_length; - sc->chunk_offsets[0] = item->extent_offset; + sc->chunk_offsets[0] = item->extent_offset + offset; + + if (item->item_id == mov->primary_item_id) + st->disposition |= AV_DISPOSITION_DEFAULT; mov_build_index(mov, st); } From patchwork Fri Feb 9 22:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 46147 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:a586:b0:19e:8a94:b663 with SMTP id gd6csp1238493pzc; Fri, 9 Feb 2024 14:29:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXr8AFKRPidF2/YlFWuqaqKDalI63aEODwFFWcXyWkPYEeX1k1GQiM/1nZ5fo2LBbGiZ+3rzDV3W72nOI4TN4OzoaZEhduJBeIXOw== X-Google-Smtp-Source: AGHT+IGF+bHqJd/p6saQFwP76SuLNFqlLpSprfm7wpynR9f56ILrqqguuqwmBntcAyeAxKljGugj X-Received: by 2002:a2e:8704:0:b0:2d0:aa91:400f with SMTP id m4-20020a2e8704000000b002d0aa91400fmr164801lji.23.1707517761734; Fri, 09 Feb 2024 14:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707517761; cv=none; d=google.com; s=arc-20160816; b=L3VqOEIq0Ee9TnhgyobHhVPPOdenpmNsPSuwIrbQLY7/clF+HN3h+Gq+g0WqPIfpPJ YAmi5PcOdUtmnE3aidTMhB6qOq2IqNo444wvzBZaXHUsMHBdgSXVAxlcYmz6OGbOGh7s nhHuiEqlzvuh7hYH9XyWAVTBjMabPbACMrHkgXzN3wN18FbjTmNEc+gNRtgxHJE6PJFS FwY7S+SEZf0v06L3OvKT9OUuWFk0Q3bzSSPZSXe/IJm77AyFh1nC/2VqlLBOTe1n0oLZ SVs43EuoO9ZRf4jCB2RM7wZSnTk+gMNnyBK7qyzc6ZImn1oiygJR1BzDJY4TMfc8BHAG RlUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=15jVz9Pz3UohC32hb/m80v12j+zbOjO7hIf6M7S+hJ0=; fh=M5eoSnhIGXKl6hoUgqDsFLuBvumngOh3qmEZgaXs7KE=; b=tBCm+jigZf+mn/lESVLIsuUUykC6VNwtEdmam8TaUzWyOWyXVk32dV+I1/0Usgp2e0 p6qLeMOZjDb5lAamqLP7VgDi43Pjdfu/r/arfVWSp/NtdSL82nuyY2XUW9nPp2Sn84Lj +Fe64SGv2dKKs2CqdCabQNDSfc8O2GXAWRPUsBzGpIQHwRnNfsF8EWUILZc+Da1B/iB5 VBytIyfHACZTPIOinZShvsIAuAz97cOfwCoWsyeAZyRWv5Dl09NqJxFv+s2mcIKykxNE hn6dod8gXnBtILJOtL+YBZmCvUli1/ZwbUJ/GZzgvMSLQI9ydK5t+lnbg7t03PgS5Uxk 2/mw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=FCdQw0v1; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCU1B4m8OKm64yrloSY1uDlVR/IT3n+9msrj/XMWUBfDm4OPcUIEAfVELUvUhQ/xzj4k6YWrwAJxEMqZM/vnagT0DZfx28H9ULCZr9n12LGXZGbpCtqMGqoQKrRewq4QJoA/iIAH9ZHrw4SfcXPsyoYl7wbJWSEimRL3Vqs6n42p/uJRqcuRj36KzSr+S+JbtZ0fo8m1HU3UtsLKXJ6dMnAuAwemNBt+sIEsdy+p2RimZnX4y6XgWf2rPljsEFHPANSeFZ3B0MJFjdC2CTAGUdMLvL+zQFPOFZoWOFAtraemz1jiZ9n6VFJZUmUTdkmzky/TBO7jCtdSQywZklVB/CkwMlD2BYHJKbrqWFZUwbJvmIPOwjNal5KMSk3vhQ6P9YsaPDYKtn/R/RzTOnByDM1YqvySjIagAc+WMblI9aXBupNaCfRGl6rP+RCELKfJX412nhtc0q66d1mFdwEH0w6uXjlhn0A/1eDJowTmCcoffjUJlCIHjKn0Mp9wViRUACKpx2TIZTzwylfZCH3aOTtekO05p6z1hyP07bw+/Z0RqFjWRJ9mXE/5wqtwsZouBgqSEeo/vcoi9wOlnqHoTCkhXt4/yGBHlWgAJpmPwId/uIIEDpgJOwBFb/DwXLMqURyRTzydVdznwV+rdysO37v7moao9wa/vRLbFqyoLNAcNwYgXeSk27hrVDAD/TRJ0P8FWGmnWmSDi5BDUXlVtpXwTWiY6vi12mOjTdZFMz6O5YUIqoYgxvCeMp5feh4Ju3X0padxZ5y50m/4Mlm+uCGjGzFPv+av8Wriaj7XFLCSqJjPZ7S9ytoJXBObKWNERcxQSdPpHlccm+37ojDZMpG2yBvrrdkjFrh2DBSLbsXnBCZemOVFEusfXWh/kk4eUGdf8ykJFN9ePD8Kg+86jmevc0zjNgGkpSc3LwAJIcN8HbjmHkkcaZ4of25NFhr8ezJlKa OA3QJxo9kXI7DjjEBwaPVt2Nc+2uroOp5ThCbJqAVLMRs0NVrO1s2tBWXocAn4TjNIXJveY70L9KfDN9opIZ2KD44LiuBDqKr3hpDQb4KQVnaNj3aXwxZLMQmRXgpDqt27lko9h0qZhnMVXbDIVA96CG6uMoezbxranGSs+aq/7DnlTlAGqyzBPdqHfNzBFt9NYuscbecZ5ii55xT0OzPT1iE/y+MfTNnk0xGBRlkkxmYXOy7M4CO2EUmAY1udMmB95nj++T/HgM/xYfXrJRj9eW2ic8eCZ85w2AbWIZPtcU+YOQHoGcodYCem+GPBU8xfTfNHV9ZXBxy05rdBJKt1SHvkqWzz35YJvzC2rsNiRgJAi/ZWduGFSdvndTsO0yMdlJ873s4DG3jV1B+iJZkoaRb/oIxkxVQC0A1JK3e1An+ryrrf6Vf+a/1SV0DSRlEaaBeVcb0yxXGycsFJ4g82mUuixS5MRU4HSrRw9/LNUMvkIyr93uvN82SrpR4NTALA34B2nWzDrRYMwtCc+NPIAlT1M4zoRsZPQzeU9UnJCAK0LfJrAKlJ0YuIdOshNXq1bv7E0eJKnyqbG13q8egIQKCl6svBWqYIRdA/x0to2yUFj2MB2ts0xUgrS4C1ZHQTodE= Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l10-20020aa7c30a000000b0055ff318592dsi175200edq.460.2024.02.09.14.29.20; Fri, 09 Feb 2024 14:29:21 -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=@gmail.com header.s=20230601 header.b=FCdQw0v1; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B597168D10E; Sat, 10 Feb 2024 00:29:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8556468D0F2 for ; Sat, 10 Feb 2024 00:28:57 +0200 (EET) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-296cca9169bso1064866a91.3 for ; Fri, 09 Feb 2024 14:28:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707517735; x=1708122535; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dFDgbM6wTpnvGAny8ZiZcomaSJHMgyUHKb2zIr6yTtE=; b=FCdQw0v1E16vhcbk3W6hjNsSOIE4uJrz2b6AVfwzQUHfXMDyZ6C68s1nhSlN5OjGVP OWs1Yiekm7r/DdJDHEx5cw2nPHtEDB/FFv+n2X0Chz3M1vZ4+ZU4lji9A2rEcqLl6hra WccYZWQoXONPLORiItubMiG72exXAZwBtIrBj7m4ijDQfxTIwKZnK+QOIeEJ+HjDrE72 GY686rNZenJGuMIuT6nU9F9I8HMZ9Gh3JOr49FWVunUHgUqR9OGnAfxXbcfxeI+Ygowh z+CAJTu3vxLwVMhFPgbS2W/AvT+oPTU109NnpZ/EEehVpVf/s07q3tMi9PY8mn0Q4v5f POsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707517735; x=1708122535; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dFDgbM6wTpnvGAny8ZiZcomaSJHMgyUHKb2zIr6yTtE=; b=l+teRF0QPKRlJzgQvGgqO37Rlc/evvSCWVFnMw+I4/HSFsCc+gpcQGsSxh5JfKjejK wmYJhYU7xyFa7Jti42YqjVIfn4U+lJVF0jx8EQshWfisyuOsFixmTCxGcIHzMUOIfDu4 pSfv/YdLz9cdbvTS3sgfW4JNRUF+W276J3SimRzEHP3vCISY8mejWsNPeewWmJaCa1yo fDmNKGU+AMWUMAEcNBMa5YPqQP4hnq0xQPnye9yyiDuXmbNNKEQjB6W7+ip5NVl3DMTQ uQ84XcDgbyOWZZuRJkBUGwsELQWaXm/y3ezGHHtECoMYIw3bxiiisQOnxjnuW50rQMwT OhUA== X-Gm-Message-State: AOJu0YzkzvukqjppNol5J9oQtWmt7ikULrLLoLPMv+T73WG1sJWo+EkS 3SF+BnaCH7Rnyq/eJ34x7+tJNwCow5gWgG3/wLCtx3bh9iQ/NxO2xAMX7U9h X-Received: by 2002:a17:90a:ca08:b0:297:f03:d8e8 with SMTP id x8-20020a17090aca0800b002970f03d8e8mr383402pjt.2.1707517734986; Fri, 09 Feb 2024 14:28:54 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id ca1-20020a17090af30100b00296bf413fd0sm2330888pjb.35.2024.02.09.14.28.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 14:28:54 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Feb 2024 19:28:17 -0300 Message-ID: <20240209222817.13543-3-jamrial@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209222817.13543-1-jamrial@gmail.com> References: <20240209222817.13543-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3 v6] fate/mov: test remuxing all stream heif items 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UbOQcFKy/dQa Signed-off-by: James Almer --- tests/fate/mov.mak | 2 +- tests/ref/fate/mov-heic-demux-still-image-multiple-items | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 4850c8aa94..1be7a0d15a 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -161,7 +161,7 @@ fate-mov-heic-demux-still-image-1-item: CMD = framemd5 -i $(TARGET_SAMPLES)/heif FATE_MOV_FFMPEG-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \ += fate-mov-heic-demux-still-image-multiple-items -fate-mov-heic-demux-still-image-multiple-items: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy +fate-mov-heic-demux-still-image-multiple-items: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy -map 0 # Resulting remux should have: # 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED diff --git a/tests/ref/fate/mov-heic-demux-still-image-multiple-items b/tests/ref/fate/mov-heic-demux-still-image-multiple-items index c850c1ff9c..753cef267a 100644 --- a/tests/ref/fate/mov-heic-demux-still-image-multiple-items +++ b/tests/ref/fate/mov-heic-demux-still-image-multiple-items @@ -2,10 +2,17 @@ #version: 2 #hash: MD5 #extradata 0, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 1, 100, 5444bf01e03182c73ae957179d560f4d #tb 0: 1/1 #media_type 0: video #codec_id 0: hevc #dimensions 0: 1280x720 #sar 0: 0/1 +#tb 1: 1/1 +#media_type 1: video +#codec_id 1: hevc +#dimensions 1: 1280x720 +#sar 1: 0/1 #stream#, dts, pts, duration, size, hash 0, 0, 0, 1, 111554, 03ceabfab39afd2e2e796b9362111f32 +1, 0, 0, 1, 112393, daa001d351c088a5bc328459e2501c95 From patchwork Sat Feb 10 23:53:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 46170 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:a586:b0:19e:8a94:b663 with SMTP id gd6csp1766920pzc; Sat, 10 Feb 2024 15:54:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXvwrW10Eh2Ju7eskd5KpqSjD9Ko0wgilUYevRv/79f3hkqx4cV+eedXOQkYSaiLKN84qLRtFce2cMmmQDbqLnABLuk8XwyZevVDg== X-Google-Smtp-Source: AGHT+IGjd8imorWJ6opUSigzwXw4KRUfsHvMsbIwT4GXbD8xfq7JZlvBwC8+La6vH3ado4lkIZTp X-Received: by 2002:a17:907:9485:b0:a3c:2e4f:f93a with SMTP id dm5-20020a170907948500b00a3c2e4ff93amr2814189ejc.1.1707609272082; Sat, 10 Feb 2024 15:54:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707609272; cv=none; d=google.com; s=arc-20160816; b=z6iRZkUyI3y6b0ZvIp+c90qp12Skc0iqcSyIK2wcRQt4/rmsHpS1tFvYhwDNkZqY9w Bg9kK1w9B3Cxg2ubVfyTcNF7QYTTIOI8eYxDeY+cr+yWZjxP9xSzsVOJjd4Blg+ryIIW 8D38CejVLmuq7Gh0kuZlTixU6U0xh5Mv9YF6MpscfX6+2t6swuWsjInX/h5vDpGOsU3q jQvyENqeNglrBeFjoML7MKLhh0NNtGR+HGC7ft7KLHm31vz2NLBTA3REG0oPr7LNwlGr meZPKQnFJq+2yIGI/ZFC9EqMPab1vzL68Tng2ZriKoeB31GaZiLEofZxn86RnrHu9aJG 8KRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=OCAwCXdhHi/XdEKZ7aL1GNpD4Q2Wpc4/4GO22gnNAv8=; fh=lmi5lfUsUMYiY57opoVRn78tjZdLF1ZFP710rudazcc=; b=BRWun/dlQLDSS8Awv7QMCPK66ho22Uic3tK1yLCq5cQiQkhYHJzZhDOdiFoI/ViKvi 5xdL+jInvkXJKzHuiVV5J07+wtyGieq3cVR+rpW29LGJ4cKjSAJ7+MWVtnw/NrctWdmM ammqO+wa316XhM8eVNTVjbv7QXqussrSbOBd9qJuBShBKioqoAqpWsjUK8n1HgdZI7vd PRiwa1GuwgoFsZ/FJxxQlrvn/GS/aslpGPIOkdFGEe4SoVRZYKNYecUKhTeq6mbYt8Cn Pjy0P+gsDLKNdUKfa75WsxTgbjIdgj/2oe5k+oXPdvA6ZCXagECfMiWrkd/Jzp+A8DQi VHJg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=iIMvfzLi; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCVZRIv8ET/p8KjL5884LpLp2paLM0bffm4v896shIvyFLTTvSLQbZKKPmLgGU9+U9d3jgzTCAjueHL+v2E7KgL4ywiZivHs2oZ96a5yKMhsOE7U/cY8MoQPUmBBQ4eTMUgtX0UPqbzu/lEGiK1JKvyLfp/dzDSdEggXYfuSSYN1s97tZKoMblKM+NBHdPaBvjIujxBL75nXmnEJrilaNGxxMUaUe4c6Tw36TwgAaRzwZCB1l08ZoL0GKBHSEazUcMZ0EGrhZRv/SK1DiBm6OcgizB2aNpSozZmK8d3Dfqe6LEkrc2Bes/AdE4QCP9GWajX/JP7tcJRyE/5eoy+NEGeXK5fW6D6+aOLqBZhEuDuaFZn1tvG+x9MOg1EiooZ/8ZqT1gcah2SLr6kkw4TPRyQW2ep8MK2rwi2spFRFxoQTHrPr8ryo2XlSOlNa74xf7JJtxgbBuQ86/qBk6D50pf41YK/Hdaa247qichsXyjh+omEE4yGCxY8BJLXBwEW8jOljy+sLCRddV26Ze54CK9DN2PPXXxGdyJCnEta2A+VTrmfh2QwmWxPVeVS/RD9hd3W+cKmCrXU38L1jjIpt0FvnHHFtUuSDuNI2PeYV2LevwANfosQ7isNIOAv9geudfie7muLVIFxgK1uZBreyeJtkZHXpnuMv0zsThvNX0CXK7xr5yW1etRFls+vzedVhJhD9Y0g6X8s73ulKvKGGXVfOGZmpAobkXlBEHXi+KA/0RtM6y2sAEO62g1rNljYUC3mWBx4ua6rIDg4wuqzRr+ivk3Z7e/a64+JAwqEEwT+qi9zOoMVV9v5NmwBZi8n/N+itVdJslUBvXDg/bbfpSGdybvNsu0HNAb42XFzphJ94NvJ4GA5SgYRk2S8wsIvWx/tsRaOkJ7CXXofJYvzdmLWQrNgiiTWaWOdfjh7dnIH29v2s2tUzvviWmXHNjvbEti8GlN lOGkjfi26EJl1q/bOhlNf1XH6Sl8dl2Vwe+9eSUTGKu5rgJBE3iDi80Z8TsTOFDLpOFrML/CbogBxLtlvTeXNBjCpQSeVgWptSnXOjB7MCSbhKABrK/RKIu4G1QueOCbnY5KgDk0NmirCG1DgDU4aKJ26SNEF8Eb2/G0IYBiacqBd79sqtEAu6nxJx+qPIY2N2GanS2H9do8mZdKw0uhP8SuVodGXSHdixpcOIRhF9r8ctIVAinbZjpTH+V41vq5ZE6R7r43I2cgeWvh1Nb4oi+dimEpszINHzyKi8GvHgQBW4klWDtW19MYvoPS93vwMIMr1xA99HQOhVLNzw2a3LF7ICs4ZTjlqPX/uYqwiTO8g9U4nwDxaxD7yDu2suz511eb15ZV891Jipf6DmGqyMlLs/+rBwIjiiBXEgVcfo6CGNDbhi+ee5N8dXxW95pTlPCPpIHv6CABU1Fgms4Mf/HwQUb5UmFy8VcncT0gNwUnn9YfSloLxy0nn0ft0k3LNGeFgjrkq3U9Mv/6uQlBscrZFRy3ldaSMM4G3qeIu773NIDOuc9ptIbc5kM2BYMjVoULL+ztR525N1VWUhnzFwte/nIqk/vLW8ztY+Ev1jV66Sdfjuk4vIhggCEc67etjV Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id lf7-20020a170906ae4700b00a376c823f14si2283458ejb.127.2024.02.10.15.54.31; Sat, 10 Feb 2024 15:54:32 -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=@gmail.com header.s=20230601 header.b=iIMvfzLi; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0279968CA86; Sun, 11 Feb 2024 01:54:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F006C68C4C4 for ; Sun, 11 Feb 2024 01:54:22 +0200 (EET) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3bfff8c4b94so857122b6e.2 for ; Sat, 10 Feb 2024 15:54:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707609261; x=1708214061; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VUa4d8Ug0WX3qyJLVhWWqA5mm0EbaNTYV2FWbimHpJw=; b=iIMvfzLiiQ0vIfaDGjOc3Dh+2tO1evorpT2f3TrqkLDiBPzoeRrde4bgE/lgjvLGpz OrB2nOLtBXWPojH4U6bT/GcAieZEBmBw//xFcYHbDtrgyM0wn9HoEZ/RBa2WaxSy2kpT rgp0fKWc4HDe+o3K2ymgMb8MS/FzaEmPV1BsG5wBsbkTrQ2UZT6UvtKann/O5nQV/Dgu yE8+lnVhXrUjDh8tuIrQsVOqBX585sdqwo7rfuBzjZJKmRMCh9wCPA8iMRRG2JUpc7Rj kE5MaD6BEcH2SAuAYCcRkhmhH7xRqlYUlGnY9oG4us/6basILXBBchggVGNfWWiaSPg+ P8bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707609261; x=1708214061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VUa4d8Ug0WX3qyJLVhWWqA5mm0EbaNTYV2FWbimHpJw=; b=aeJHT8+gvIdYfKmKLZon5Ml91QeQ95KQAGFdlBBb9jKJieEQKn+ErkW1hfC7UgD7EI XB50I7g0G+NLkH/+77BdkbkQ1Vh07KJJHGCXrq19EGqqnTnCkSWaTdimrfAqqqQ1l7Tf zZuabZl0QIsW7W+e8gKHFvL/xgLDIzBZowWRyvDN8+r40g+mwa20e62B6fpHbIv7RCmi 36JBm6k0xNjVfDl8I4Ht5ZRQpZrTs1JFZ/XwbYe/ofgKOmHk6MY05DOx+pDF2sOXFoYo PzukCmxhYjxlLf9LSsUcwWTrs3a6w6XOSc3MCO6VgWAjBIy2Yk5ZFTtLgmh2IQX+aTne pKSQ== X-Gm-Message-State: AOJu0YykbEWRmbstJ+C4H0Jbj5Np3zk6oMPQchPtAN872tz2V+YCj4eD GywF+u1jysTq5QRsIUhOcbYPyMH3kHfm05Nexsou4FsRoNUoIdOly33BTZz0 X-Received: by 2002:a05:6808:124c:b0:3be:494e:9379 with SMTP id o12-20020a056808124c00b003be494e9379mr4231860oiv.16.1707609260493; Sat, 10 Feb 2024 15:54:20 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id t16-20020a056a00139000b006e0404f419dsm2852275pfg.125.2024.02.10.15.54.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 15:54:19 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 10 Feb 2024 20:53:58 -0300 Message-ID: <20240210235358.64999-1-jamrial@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209222817.13543-1-jamrial@gmail.com> References: <20240209222817.13543-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] fate/mov: add tests for HEIF samples with derived images 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: OV301oEVNWPA Map the group to remux all streams in it. Signed-off-by: James Almer --- tests/fate/mov.mak | 8 +++++ .../ref/fate/mov-heic-demux-still-image-grid | 32 +++++++++++++++++++ .../ref/fate/mov-heic-demux-still-image-iovl | 18 +++++++++++ 3 files changed, 58 insertions(+) create mode 100644 tests/ref/fate/mov-heic-demux-still-image-grid create mode 100644 tests/ref/fate/mov-heic-demux-still-image-iovl diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 1be7a0d15a..a8206a1b58 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -163,6 +163,14 @@ FATE_MOV_FFMPEG-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \ += fate-mov-heic-demux-still-image-multiple-items fate-mov-heic-demux-still-image-multiple-items: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C003.heic -c:v copy -map 0 +FATE_MOV_FFMPEG-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \ + += fate-mov-heic-demux-still-image-grid +fate-mov-heic-demux-still-image-grid: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C007.heic -c:v copy -map 0:g:0 + +FATE_MOV_FFMPEG-$(call FRAMEMD5, MOV, HEVC, HEVC_PARSER) \ + += fate-mov-heic-demux-still-image-iovl +fate-mov-heic-demux-still-image-iovl: CMD = framemd5 -i $(TARGET_SAMPLES)/heif-conformance/C015.heic -c:v copy -map 0:g:0 + # Resulting remux should have: # 1. first audio stream with AV_DISPOSITION_HEARING_IMPAIRED # 2. second audio stream with AV_DISPOSITION_VISUAL_IMPAIRED | DESCRIPTIONS diff --git a/tests/ref/fate/mov-heic-demux-still-image-grid b/tests/ref/fate/mov-heic-demux-still-image-grid new file mode 100644 index 0000000000..6fde8fff28 --- /dev/null +++ b/tests/ref/fate/mov-heic-demux-still-image-grid @@ -0,0 +1,32 @@ +#format: frame checksums +#version: 2 +#hash: MD5 +#extradata 0, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 1, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 2, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 3, 100, 5444bf01e03182c73ae957179d560f4d +#tb 0: 1/1 +#media_type 0: video +#codec_id 0: hevc +#dimensions 0: 1280x720 +#sar 0: 0/1 +#tb 1: 1/1 +#media_type 1: video +#codec_id 1: hevc +#dimensions 1: 1280x720 +#sar 1: 0/1 +#tb 2: 1/1 +#media_type 2: video +#codec_id 2: hevc +#dimensions 2: 1280x720 +#sar 2: 0/1 +#tb 3: 1/1 +#media_type 3: video +#codec_id 3: hevc +#dimensions 3: 1280x720 +#sar 3: 0/1 +#stream#, dts, pts, duration, size, hash +0, 0, 0, 1, 111554, 03ceabfab39afd2e2e796b9362111f32 +1, 0, 0, 1, 111481, e5db978adbe4de7ee50fe73abc39fcfa +2, 0, 0, 1, 111451, 08700213113cadbb6628ecb8253c1c2a +3, 0, 0, 1, 111353, 5de942e14c848e5e22fad5d88fb13776 diff --git a/tests/ref/fate/mov-heic-demux-still-image-iovl b/tests/ref/fate/mov-heic-demux-still-image-iovl new file mode 100644 index 0000000000..753cef267a --- /dev/null +++ b/tests/ref/fate/mov-heic-demux-still-image-iovl @@ -0,0 +1,18 @@ +#format: frame checksums +#version: 2 +#hash: MD5 +#extradata 0, 100, 5444bf01e03182c73ae957179d560f4d +#extradata 1, 100, 5444bf01e03182c73ae957179d560f4d +#tb 0: 1/1 +#media_type 0: video +#codec_id 0: hevc +#dimensions 0: 1280x720 +#sar 0: 0/1 +#tb 1: 1/1 +#media_type 1: video +#codec_id 1: hevc +#dimensions 1: 1280x720 +#sar 1: 0/1 +#stream#, dts, pts, duration, size, hash +0, 0, 0, 1, 111554, 03ceabfab39afd2e2e796b9362111f32 +1, 0, 0, 1, 112393, daa001d351c088a5bc328459e2501c95