From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 2C9EE4E920
	for <ffmpegdev@gitmailbox.com>; Tue, 18 Mar 2025 12:58:56 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14A2B687A34;
	Tue, 18 Mar 2025 14:58:53 +0200 (EET)
Received: from out203-205-221-209.mail.qq.com (out203-205-221-209.mail.qq.com
 [203.205.221.209])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F3BBF6879F2
 for <ffmpeg-devel@ffmpeg.org>; Tue, 18 Mar 2025 14:58:44 +0200 (EET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com;
 s=s201512; t=1742302706;
 bh=auQWYTgJYaVJRL+gTxXzlWmERS6yTqn0A2md7tTuJlc=;
 h=From:To:Cc:Subject:Date;
 b=eK62JbOgx5zo6TiHT6DaOF4Ae7kh1wInlFpRVwt8IUS4zrjkhyK6Vci1LIOhawg4R
 fBtURw63xy/uTYDdY4mn9PyZR/bV5bDgaFFkxUnQh6kYQUOzDktUOIsVTiGjSAwPee
 pB2y2js6MnPk7vWlSDjE2bmW9LJHgBfshNisyn10=
Received: from localhost.localdomain ([119.147.10.242])
 by newxmesmtplogicsvrszgpua8-1.qq.com (NewEsmtp) with SMTP
 id E9922649; Tue, 18 Mar 2025 20:58:25 +0800
X-QQ-mid: xmsmtpt1742302705tzy6aig67
Message-ID: <tencent_4F40F79A859F25AB544E1C70172D469AAF08@qq.com>
X-QQ-XMAILINFO: NssJ/YX50roaFixrFkxVsfzSOBothECeP32WKskG40kKsc+pdG44/ugD4DnUUj
 1DW6YmgLzbecEviffGo3UbkMJ2fjz/2TtlFeKJL6NkphzEYG01YZgc2+1CYdZycjLeYfEmTlYaic
 aWKBwi/NLH33DNlJ31QRhhAuL4qGpzgoN37YYY0eq7Q4X4SWoFOxewtd2JePFgPj8svIJR2zOuKM
 fNtN604bIWgYOmMOzOsQWDRRInM2u4gcraShomrMCNeGHTG1kARFUmTgOQkX5je+0u30lD5eV9jv
 l6P0FKJEpcN6zZNc9lrqcABvqOu1Kb4OpUvA1Pck+aaaLDMPdd3kihz6zHdOSDeP29iYIpyF4nkD
 tYM9OQZTXLNLCYYqOJ2Wu9DU86bjF5D7pmS4UWEidnGYNSupq61YUtdiAblgJBVHTx3Nmbl10NL+
 bymH+DsnDRtgg4R4fEwR+KdUOO4nOQUKd6lbVHCIfQk0TjLUKJhmer0HjiXrcc+uLHS3OFdPubLl
 HeN1Xk6VF67W+t1oAxqEdaOWDu6JtG3LRsNGCsczR6PsSjv8XvMhMAaw9Jx/JCo73aad8gkMNM6a
 iciD7ZK/NHbeGva/PiWvuMmByUrLRa4TXDFFoTKoycemC3Vq7rgtWW5XqwOffZr4XP8Umv9q1qG9
 6dAUz4CxK+nIINEOL4wrWyHKacnCpHCBrG1BMzztBLY5l5JqU0rdfwzLOcxfPmrxvUQup9R6dwkb
 vBTEAAA7Y8HKJE6k5zCnkTj6f6doBbCjX7nQsRnh9z/JbQjX0GQfRD4QsDqg/42icdxkTPCpOHBe
 GMkFz9VooqQYqazS+tHhApb79vmcrrTlpoE8HNd1Q7mzX+keZcCjjREUJ8fHUJ40CNPuySwwpHoF
 sdNn4gFY9KJvhntZB/CiZBbL4INeOgUZ1q31IdXQWDCZXtNPweTLuULdfFzvuYUB1KN2c1TkLpSo
 wGbMwNi/WkUiJoQKxESLEVQipiIE9hevFxNPQMh/M=
X-QQ-XMRINFO: NS+P29fieYNw95Bth2bWPxk=
From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Date: Tue, 18 Mar 2025 20:58:24 +0800
X-OQ-MSGID: <20250318125824.5892-1-quinkblack@foxmail.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH RFC 0/6] MP4 editlist and HEVC decoder
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Zhao Zhili <zhilizhao@tencent.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/tencent_4F40F79A859F25AB544E1C70172D469AAF08@qq.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: Zhao Zhili <zhilizhao@tencent.com>

Fix #11510

#11510 revealed multiple issues related to mp4 demuxer, hevc decoder
and videotoolbox.

1. mp4 demuxer output packets have rewind due to editlist,

POC		 POC
916 -----------> 944

then rewind back to

916 -----------> 944 942

2. Both POC 916 and POC 944 are CRA nalu, so no flush on output.

3. When decoding POC the second time, POC still inside DPB buffer.

Patch 1/6 fix videotoolbox which shouldn't reset when confronted with
    ReferenceMissingErr

Patch 2/6 is trial.

Patch 3/6 allow duplicated POC in DPB buffer. I'm not quite sure the
side effect.

Patch 4 to 6 add a flag to indicate the start of a new sequence, so
the decoder can flush on output. I know it looks suspicious, please
comment.

There are more general stream rewind issues to be resolved.

Zhao Zhili (6):
  avcodec/vt: Don't restart decoder when confronted with
    ReferenceMissingErr
  avformat/mov: generalize sgpd_sync index lookup
  avcodec/hevc: Don't drop packet with duplicate POC
  avcodec/packet: Add AV_PKT_FLAG_NEW_SEQUENCE flag
  avformat/mov: Notify new sequence at the start of editlist
  avcodec/hevc: Check AV_PKT_FLAG_NEW_SEQUENCE and flush pictures out

 libavcodec/hevc/hevcdec.c |  3 +++
 libavcodec/hevc/refs.c    |  4 ++--
 libavcodec/packet.h       | 10 ++++++++++
 libavcodec/videotoolbox.c | 10 ++++++----
 libavformat/avformat.h    |  2 ++
 libavformat/mov.c         | 21 ++++++++++++++-------
 6 files changed, 37 insertions(+), 13 deletions(-)

-- 
2.46.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".