From patchwork Wed May 17 21:23:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 41696 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1202369pzb; Wed, 17 May 2023 06:24:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Bf5ywDnvOxT6IOWTO5XnwSSfKkHKwo3Cp2Wgdj4OBVFnPW0q5d68avIc623p1KLaTSmvw X-Received: by 2002:aa7:ce0d:0:b0:50b:df56:8d68 with SMTP id d13-20020aa7ce0d000000b0050bdf568d68mr1904754edv.9.1684329860909; Wed, 17 May 2023 06:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329860; cv=none; d=google.com; s=arc-20160816; b=j6KStzvbKtpXORzcsLCYhdBC9bRNi3lZ2F4TBEvvY1NgXTkLxvkqKItApXdDSoBZuZ n9IVTLCZQBrrxnGKDy/KBHdzq/y4HFcMV40HBx68JR6oIJCaiOwE3kPCTWr17Rgag2sX e0GbmHYjW1hGU6EAXwX1OIace79t7yrlRRyoev9xFa43dvCATN9T4SpXgWvlBNWlCYdL fc9OdeyY85ugdYdIpBFWtAulICuz5FS1jErZSVSQVzV2kjt9FMc2S8LWmUonF2J86+67 NuJZCawUuiUpQSm3eF6yyzfOm3ySqgmk16CCtFVtoUPLUlfVD9RC9VvIRksm84/Cj9Bc 2IZA== 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:date:to:from:message-id :dkim-signature:delivered-to; bh=OsBIOZ2n4ZIzU8efsxsdo2n3hOcfH/IWpt7kFPby0y4=; b=QQuqdZfZKUg5LxslDy/wZ7na3AZlSmFayjcyjypG9xBLypwJBPCsj0MGkK6nBnzPUV WiQ4fBuacLjmsrlT98+RtWSsIXKBe4K8HS6CXfHwCOaoAHLCJ0tT6s1k0bxOvjnAFcKu vnicK5lXRUqn4XiPwRXFhIRQAsrS29hwQNF7Y3frY3oLy3LbvnUUe21G0RvmAmkWISG7 Pv0ejf7AA9LrP6XRsLW78+lnjBO+FdEByDTg5lC21j2pA153pBrf/zuhMYtsrXmvis81 ZW4YKOeRhp9y6KVneQZEEe6ucepUnSbhGBvcO9zhAKDI3Fx97HYZMBGWcNa4NDLlEPKR DW1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=oMtLMo85; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b16-20020aa7df90000000b0050bc6d73961si15262403edy.129.2023.05.17.06.24.20; Wed, 17 May 2023 06:24:20 -0700 (PDT) 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=@foxmail.com header.s=s201512 header.b=oMtLMo85; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6833868C0D2; Wed, 17 May 2023 16:23:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-239.mail.qq.com (out203-205-221-239.mail.qq.com [203.205.221.239]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5686B68BFDE for ; Wed, 17 May 2023 16:23:48 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1684329819; bh=GQV5m9PsKDYqmbaERRQbjxyHU3YHLmx6n9qq5yLSCLk=; h=From:To:Cc:Subject:Date; b=oMtLMo85a7k7fVXqGlrQgChi+oK1nJ82dqT+CJwFBoNZxrG2XXGMkXg3ZoLE9z+Z9 G+PZskfpNhnZzUgFZbKGPmzx0swhzJCdPKYOxcjbX+PKS2W4SBj5zjFO7isSVEf7BU tSJVeoBI0OH8RVsUo7vt+XABFIkUJvjzNcpH1KeM= Received: from localhost.localdomain ([119.147.10.197]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 5E5A2C20; Wed, 17 May 2023 21:23:37 +0800 X-QQ-mid: xmsmtpt1684329817tv0zwocfn Message-ID: X-QQ-XMAILINFO: Nh9rHd4LJNLEo2wWAubhcYXDiMfZgtIypdWgb/As5BtGXEJJHs+MPk7JOoD+kt U25Thn8+Z3HI7u1U2wLocmGqorxmaK937pEDQW9J3KdMt80Jd7ESXzlo6xEHqKturdHUijpGfQBV i5jWpJ4UB+QPNFgaJHzplzEJ/oL78eAuDrUOnbnGMyrqWpz+uNcecR04m4XAvHni6jDiWDe7/3LC Jpe2XNxDNfi8hK2tUqf9qjI49lEGB1C5jMYBFc2JZsU0autET4IS6mhSZWnCuuJgo2qS/0AYsxvX Ch+NFHZeXcda9S41P/qbQWF/wm0xGoQ4NAx/5KcgCn1t29SPsXbNNwCKCSZbTZ8f5eo8dv2nqddZ ApgUv8cGAmf6cXoqI7Hifp1uO1h8BNha9SzPoPe8wIOhL5KKQQ2XANtmqA+5IZIXWGlw2iA4WO8F DD7wyL+xHMmNtTkqYuonxe70bw869mickvu6fjbe93hfCa8axfYr3Hs9sKBRTh5iwVCRRV9SrBIz IH8cy4Dpkl8ASCBN4A96VLhm3QeJmFm0paMxu3KMbJly1Ve7kI20QKlGXbccwnvjm2m5SSVkBNzh m6+zaXy9XcDOfZyphrFplvZLK+H9qMMSGqlb5vUkriWPjHPSCQaUGopsEOlXB0ZnWb8HgXKKxVA7 /2Pw72dG9hi9XRcYDxE1nZO4XVhLIfbz7Unc8NwYV7atbg0lVsZncbq3nH8juCgvP6o4XBAKNB0o WaY98tdaEttLUdnajwK8Rr4Oryq2VZp/cdBpMv9wc/bBjn6sMjXeHflroUOAuqsoJ+N+jmXgFsZB 1Uj5l+TrbHiboWz/HFDAoAdKMH0MzoFoLcN3Yv8AgZ8nSx36G2ZuSz9b45xZMihGlM1UGivHuL15 oubRvZCVDLUkF8+GGsbdWs3bAeWrCnNAudRJtS/wm2NalbmAYcd5F1rEgraEs7XaD5mWEJDiHYjf OKvPTHz4L+uVBC7rhzf8aXXhLhyEZeT5Ni4yc1XLQ1IjV9JNxgNZWcuSFPN72Z From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 May 2023 05:23:38 +0800 X-OQ-MSGID: <20230517212343.1874354-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] avcodec/cbs: add API to discard units by AVDiscard 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 4PmfPfvRB8wF From: Zhao Zhili --- libavcodec/cbs.c | 21 +++++++++++++++++++++ libavcodec/cbs.h | 17 +++++++++++++++++ libavcodec/cbs_internal.h | 6 ++++++ 3 files changed, 44 insertions(+) diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index 504197e06d..cf5211249b 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -1026,3 +1026,24 @@ int ff_cbs_make_unit_writable(CodedBitstreamContext *ctx, av_buffer_unref(&ref); return 0; } + +void ff_cbs_discard_units(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + enum AVDiscard skip, + int flags) +{ + if (!ctx->codec->discarded_unit) + return; + + for (int i = frag->nb_units - 1; i >= 0; i--) { + if (ctx->codec->discarded_unit(ctx, &frag->units[i], skip)) { + // discard all units + if (!(flags & DISCARD_FLAG_KEEP_NON_VCL)) { + ff_cbs_fragment_free(frag); + return; + } + + ff_cbs_delete_unit(frag, i); + } + } +} diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h index ee21623dac..b4131db5fe 100644 --- a/libavcodec/cbs.h +++ b/libavcodec/cbs.h @@ -26,6 +26,7 @@ #include "codec_id.h" #include "codec_par.h" +#include "defs.h" #include "packet.h" @@ -432,5 +433,21 @@ int ff_cbs_make_unit_refcounted(CodedBitstreamContext *ctx, int ff_cbs_make_unit_writable(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit); +enum CbsDiscardFlags { + DISCARD_FLAG_NONE = 0, + + /** + * keep non-vcl units even if the picture has been dropped. + */ + DISCARD_FLAG_KEEP_NON_VCL = 0x01, +}; + +/** + * Discard units accroding to 'skip'. + */ +void ff_cbs_discard_units(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + enum AVDiscard skip, + int flags); #endif /* AVCODEC_CBS_H */ diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h index e585c77934..077954eee5 100644 --- a/libavcodec/cbs_internal.h +++ b/libavcodec/cbs_internal.h @@ -133,6 +133,12 @@ typedef struct CodedBitstreamType { CodedBitstreamUnit *unit, PutBitContext *pbc); + // Return 1 when the unit should be dropped according to 'skip', + // 0 otherwise. + int (*discarded_unit)(CodedBitstreamContext *ctx, + const CodedBitstreamUnit *unit, + enum AVDiscard skip); + // Read the data from all of frag->units and assemble it into // a bitstream for the whole fragment. int (*assemble_fragment)(CodedBitstreamContext *ctx, From patchwork Wed May 17 21:23:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 41698 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1202617pzb; Wed, 17 May 2023 06:24:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wUHclUhAYFWvQ+PEE90SPN97kTqQfVMqq5V7qrNget/WquQHZ9sWzkl2/GHbCLTB3oj+h X-Received: by 2002:a17:907:1b17:b0:94f:432f:243e with SMTP id mp23-20020a1709071b1700b0094f432f243emr36041418ejc.14.1684329879418; Wed, 17 May 2023 06:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329879; cv=none; d=google.com; s=arc-20160816; b=Dwx+T/Z1cO8xmI3W7YyH23gS8FpybloqNWn15EYmIIm9sH1J3KFWwuUVQ/7vPvGT5T 0pnAMBqVk3dTdlnIt889K+hbyVVpZFDm5bofwsGU7/3jEpxlGB5k/72DDWq07jy/3zkG w3qWksl7fDV09OhcLgehLz5HvsHkqxszVcfJSevC17Ig4BWNDw3j1mRwzyJUsecO+0LH hYlSvipKUOjuxUmATGhKGroCw0/RWR9FjCbYa6M5kunu1Rh+7onJVU2RUu7s1QhzLVQs QgePDwWqwihK1LUZiU7FkUVEqFOgcLpVfgFX170BOFGUb9hC10eEPixVThfHCzb+PS81 Q76w== 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:date :to:from:message-id:dkim-signature:delivered-to; bh=1rWB+748NfPy4N+CJgksXIkvFs/rUWQWgDGN1zVRRek=; b=kqywmquoOquNDVO2Y0BndIHAoXhL9WjGxwU8cv2Mt9fqwlpM8cu7R7Bq8h8Kc0c5l2 DH3LYkfpZg5GDieNjRn4fKgJE+KQ7w1rnPm9MF23rWYRiRDClaKLdRRJWSqB8bsTvZxZ AsB+J0MUYUQtiygKMvqYcCyYaVSRSIS42larPA3p3G6vbrgbTFIrCOgRSMGIe3Ib9GmK h9aDwrGgx3Ys7jqcn/znUolN/ihcO5Hp+kofon/bVJtT0DfAtq9OQkaTVliHUPH7pHy3 oLxwBlzH1fma38kPI/URWcC5GpTCrrmY44RqztJgOFF4nQ6qf7em5mVESF1CUE34MlUH LZ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=fUUKLa7u; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i5-20020a170906250500b0094f442c8a6dsi15968234ejb.291.2023.05.17.06.24.39; Wed, 17 May 2023 06:24:39 -0700 (PDT) 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=@foxmail.com header.s=s201512 header.b=fUUKLa7u; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3BA8868C094; Wed, 17 May 2023 16:23:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-240.mail.qq.com (out203-205-221-240.mail.qq.com [203.205.221.240]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8516A68BFDE for ; Wed, 17 May 2023 16:23:49 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1684329819; bh=TRQOcW+IvHqcS/Z/TJH5njecbPY8z7OqjteZlun81ss=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fUUKLa7urpJIKlc7pYrHVbSWXGOsplLu8bwQ9bAJSddzrdj+58eFQlmLr3N4BotP7 XetypsZO6xndnxNKroQZabe6zoi27TJkmtswz9F4ZgchCEUZ4TbfdqxXJSiPcfmfb5 kYkW55RenN6VWXG2e2bXftyTjIIRspUDXbU1I+MU= Received: from localhost.localdomain ([119.147.10.197]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 5E5A2C20; Wed, 17 May 2023 21:23:37 +0800 X-QQ-mid: xmsmtpt1684329818toycdh0qf Message-ID: X-QQ-XMAILINFO: MOAO5R/161EuWsv18r2y0Pr1pR/3WStKC+OF76+a3xjVu9FAD9yNxEQTiS9y2B 6ug+de9jtXyJ/gFpg5gxiDNZMCbK2K6D75r8GCJaOIbRKNSloCydcZ3lLeTpsfyQAYutF4rFRiyO XTOdCEOegKmUXx3Pj+MAQF63iDYPTRpfX6jy1zWpCew+Mrpokh5UmiljeMx3SynTx1ooi+TalYgy wpNYZ6GqJAk34x5hhQeC/WKPwN+KGVYK55+D09Iowr1XQFTrPdjSnz1JuetTIPAxTkVsEfy5Zw1X rgBcYIBXXqnjd0g4BSrJpGPd4XDz+SBUxLBOuMNDY8HuQE3ETWU9QLykaur0DYRPj/O2MubmeLZW 4VjZsNQL+qSgtd/VhpXbl3zhRcXUE47q4NiLsmet/ysjH6LZpiDzpq/Jkj9CwvqNpWZV2fs17GGT 46gWYQvRc6aP6ZdmgyyhRplNQ+pUyN3k69CEnuxqr6Y3XzjfVtxYcDH2R5V7CI2EKnJlG3/AyQnZ xP2tO607CQMkIPyg/FKehyy6H0lvSxC3SObhOQSrCBqxtofNe2BzKars10iUSI1uFeV6uag/llwY UCuiYXI7V2vxEuxExQEHHzK5BrdxUpBz46iBcCPOgE4D9MHxzlgoJaLJ4hIUTS2Rh7wmL+icUz+W ykRrb9KYeAva+rbsWEqdtdrkoGobyd+PHXkj1DSgM5TWjx/SgKX0PjnzLNlWPtOX+YMAvDl+mK9p enjK6Ad9KRX0Ey5l+1BatEsNAKY2Ex7u74PFqXuRjTn8kCKvtVdcunsU4ZJ063ZS5QCDbBdodn2d fGJbSVObe2RmgB4nzz4Vw80sEWaFYbQcG0SYeB2fJKPhqHgmx92AdpkZi8A1PhSMKXQkrBYKSABD lVlXxbpM+6TfRSEseiC1gy5wQ5sLJINHiZvaVq8Vn1wyht9Ko80r+pl5CoDnc3JBbnLxexfwocjO w0hY88nic8HR+uWt24/WBsx2nlyLbKdmPst/26hyqCDLqsDFNOZQ== From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 May 2023 05:23:39 +0800 X-OQ-MSGID: <20230517212343.1874354-2-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230517212343.1874354-1-quinkblack@foxmail.com> References: <20230517212343.1874354-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/6] avcodec/cbs_h2645: add discarded_unit implementation for H.264 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: IVlwr+oD8ViD From: Zhao Zhili --- libavcodec/cbs_h2645.c | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 80e48829af..c616ac2202 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -1213,6 +1213,58 @@ static int cbs_h265_write_nal_unit(CodedBitstreamContext *ctx, return 0; } +static int cbs_h264_discarded_nal_unit(CodedBitstreamContext *ctx, + const CodedBitstreamUnit *unit, + enum AVDiscard skip) +{ + H264RawNALUnitHeader *header; + H264RawSliceHeader *slice; + int slice_type_i, slice_type_b, slice_type_si; + + if (skip <= AVDISCARD_DEFAULT) + return 0; + + // keep non-VCL + if (unit->type != H264_NAL_SLICE && + unit->type != H264_NAL_IDR_SLICE && + unit->type != H264_NAL_AUXILIARY_SLICE) + return 0; + + if (skip >= AVDISCARD_ALL) + return 1; + + if (skip >= AVDISCARD_NONKEY && unit->type != H264_NAL_IDR_SLICE) + return 1; + + header = (H264RawNALUnitHeader *)unit->content; + if (!header) { + av_log(ctx->log_ctx, AV_LOG_WARNING, + "h264 nal unit header is null, missing decompose?\n"); + return 0; + } + + if (skip >= AVDISCARD_NONREF && !header->nal_ref_idc) + return 1; + + slice = (H264RawSliceHeader *)unit->content; + if (!slice) { + av_log(ctx->log_ctx, AV_LOG_WARNING, + "h264 slice header is null, missing decompose?\n"); + return 0; + } + + slice_type_i = slice->slice_type % 5 == 2; + slice_type_b = slice->slice_type % 5 == 1; + slice_type_si = slice->slice_type % 5 == 4; + + if (skip >= AVDISCARD_BIDIR && slice_type_b) + return 1; + if (skip >= AVDISCARD_NONINTRA && !slice_type_i && !slice_type_si) + return 1; + + return 0; +} + static int cbs_h2645_unit_requires_zero_byte(enum AVCodecID codec_id, CodedBitstreamUnitType type, int nal_unit_index) @@ -1441,6 +1493,7 @@ const CodedBitstreamType ff_cbs_type_h264 = { .split_fragment = &cbs_h2645_split_fragment, .read_unit = &cbs_h264_read_nal_unit, .write_unit = &cbs_h264_write_nal_unit, + .discarded_unit = &cbs_h264_discarded_nal_unit, .assemble_fragment = &cbs_h2645_assemble_fragment, .flush = &cbs_h264_flush, From patchwork Wed May 17 21:23:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 41695 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1202251pzb; Wed, 17 May 2023 06:24:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xLkrMdiqo3QGSNG+cUxAwDSZefBKJx+6z0FvjRIJd0aWFC+gvCNEETmw+TdrDCPF/1RbH X-Received: by 2002:aa7:d49a:0:b0:50c:646:da42 with SMTP id b26-20020aa7d49a000000b0050c0646da42mr2172124edr.28.1684329851384; Wed, 17 May 2023 06:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329851; cv=none; d=google.com; s=arc-20160816; b=i76KomrrJsBE/CeO8BAfrs27AuHxetFJSdvJwlXpZ6gJsNn9wYV7HfV3+/Qnczz1MA etHWM+3db6DdLlzZrpc2jSAgw0esbqWOdTrBg28XpsmzmB8YY7yI1dPwx3fKai8lbqzE tUhGzSQc9rSXy618j6qO7mRasriMEs3CFS3FyUbh/ZmzTvfUcRldMYsduWZMWxntFeUk m/QLZPUK/kZ8plPXRNU0G2RkMS+jwbk1GVxdRG5KpC5VIzAzvW+kxjpDJX5iY32ulhDV yMmqYjYvFzT+oypTr2tSHDPaZx3AiR6G2oc9LIkvunvTxCd1drfsSEOZbg0bE0R+82HT 7lHw== 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:date :to:from:message-id:dkim-signature:delivered-to; bh=sIEPmZ0h3eYXWw4FlB4lRHUkGqtrBlrR5DIfM1EoggE=; b=GPbnGTea/ZquRpAV3iF/3GndBOCp1xUYV8oTB6+xQs/lpR/5ExWNwhlTj2wDt/ybaQ aAz0F9Pn+Tf5q/VelmbeKqAiW2txronEvRBMDg3Gj6KEEPxyWx/kf1ij3XZ4ziEsG4+N 28/wft1s0UkBLo57f3kQDz7Tcsob13TXCoxJroZ1Q78as9RJciz+XsLl6iAqT6mBsfIK SnBa7jFCEwWXvyboDpzcLPMW5Pb+rlYo13uFBsjlAQzEkbxOc9lV9J0bV2wMKhoilxVi lI4M/Evv3iVIsz72a226Jd0H5cyQkGZm7ZfcHYBZo1XHJpWM5N22UQl42bVIdTL49Wz+ 8ICA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=KXis81LM; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b4-20020aa7c904000000b0050daa85e701si14262286edt.608.2023.05.17.06.24.10; Wed, 17 May 2023 06:24:11 -0700 (PDT) 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=@foxmail.com header.s=s201512 header.b=KXis81LM; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8A2F268A084; Wed, 17 May 2023 16:23:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-205.mail.qq.com (out203-205-221-205.mail.qq.com [203.205.221.205]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 540CD68BFB7 for ; Wed, 17 May 2023 16:23:47 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1684329819; bh=4N8jpIMH6mVzEd8OAG2wR5B75er6xzvf0fPo/9DDOQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KXis81LM0c6yR4I+ixPIyrP7w86HbROyv+mNnUGuxAIgEM0l7Zy8lJoPw1al4djuV pveD/c3EkC2u2HLn+Bw1vnfu/jCpOgR3BoIsUFRt4vxGzwG1RAebg23orgfr3v5tHN vdHXNHBv3AJoPbZI+DL2xj3IQxQp0VfIi8181HeU= Received: from localhost.localdomain ([119.147.10.197]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 5E5A2C20; Wed, 17 May 2023 21:23:37 +0800 X-QQ-mid: xmsmtpt1684329819t6oulu9ib Message-ID: X-QQ-XMAILINFO: ME9VhegEez81xlvzBFevIA4pEugVaxrEV+qIz7a0ZTuUE4RHbDI6kRmGnOJE6Y cIrcU6sWFTlczCk9Hf6Zt6+upNmYfcOB5Sv6Y2Fj77CSnPNDkSnDRSNCnAJ9hK+ErUjjq8NJGANU dbpKzF+1O5MYoqpHrUbJyVyTe3H0mRV3wVu9sexnd6vxNVMdmR2Yv35me10YH0uBi69OyhxMT9S6 3hk7sicA848Wt7G3QH/unxidvkJ4+WtLmmbYGaTWfOTASVs5cIZT0CgFRdMkHKmRxd7bo3VwOx+W 47daxkscEjUJq8u46gGrHxzYDh+U4/1WEVRO0d4xsp5R7KLJZdJeTM1xW7jW4ui5LHROCksay5YA wUBHegMLwd79Dzfu1gzMyzk6C0UQFM/+pJoLRv4T4MDerOQAnth7XXrukV+E7I6oS/70E45kcZ9+ uJgkjjzutVv4aqMJDM8rKFwH5bAkszra//PzNioPHGd9IwzRpTB5D0EptbGXf+IzNqDb51ipdyI3 Drood09ycqmldKrvdlp5+m1ie3Sz4U+nDAZp+bb/RdT7ptwI4+Nbm+a9MT0mMw/aUE3PktjsBseY eP68u3IpBmypYZrM3ac7oF+CPw1YJPR8Y5eNkKeOnQFOeKjUWT/2yMTtoG66XGOBsf6WOxaarNJT I0asv5bs0nqNYae7p7QJbMwNVr5T1mGokZr/U8JR0h3sOa1Etr0aET8zTSh/Y7wC9qh+q6bkI4fY rGP70Liyh5C5YUsz8zqPfNO5EYM16NADGGBjV6fSEMIbnneazhctfJrQeAGb5RfnWbdudbWyIriF 7hjQcXikfnwOAm1g6vhV/RaZnR6Xns6e0vqDuZTD03riN71G0K2AdDxVBqDd8M0dBp1YBHtJOIov yRvvtjlah9AcB068GWzMvlPtakN+xTgoF6YzNIEg1IN+fDapCV+GZpcjiH0yuTL+HRz8QGqjXp6M iHC4YMn2zGE1AoQ9hUMuuxW4bSQ8agCadcFAjTKlej7mg9hJ0qapowgW1lPvWDNdb8sCWVGORugf WKRXzF02wa8Se+YDAW From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 May 2023 05:23:40 +0800 X-OQ-MSGID: <20230517212343.1874354-3-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230517212343.1874354-1-quinkblack@foxmail.com> References: <20230517212343.1874354-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/cbs_h2645: add discard_unit implementation for H.265 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: HAulCLer/SJ2 From: Zhao Zhili --- libavcodec/cbs_h2645.c | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index c616ac2202..f2e59f1ac7 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -1265,6 +1265,79 @@ static int cbs_h264_discarded_nal_unit(CodedBitstreamContext *ctx, return 0; } +static int cbs_h265_discarded_nal_unit(CodedBitstreamContext *ctx, + const CodedBitstreamUnit *unit, + enum AVDiscard skip) +{ + H265RawSliceHeader *slice; + + if (skip <= AVDISCARD_DEFAULT) + return 0; + + switch (unit->type) { + case HEVC_NAL_BLA_W_LP: + case HEVC_NAL_BLA_W_RADL: + case HEVC_NAL_BLA_N_LP: + case HEVC_NAL_IDR_W_RADL: + case HEVC_NAL_IDR_N_LP: + case HEVC_NAL_CRA_NUT: + // IRAP slice + if (skip < AVDISCARD_ALL) + return 0; + break; + + case HEVC_NAL_TRAIL_R: + case HEVC_NAL_TRAIL_N: + case HEVC_NAL_TSA_N: + case HEVC_NAL_TSA_R: + case HEVC_NAL_STSA_N: + case HEVC_NAL_STSA_R: + case HEVC_NAL_RADL_N: + case HEVC_NAL_RADL_R: + case HEVC_NAL_RASL_N: + case HEVC_NAL_RASL_R: + // Slice + break; + default: + // Don't discard non-slice nal. + return 0; + } + + if (skip >= AVDISCARD_NONKEY) + return 1; + + slice = (H265RawSliceHeader *)unit->content; + if (!slice) { + av_log(ctx->log_ctx, AV_LOG_WARNING, + "h265 slice header is null, missing decompose?\n"); + return 0; + } + + if (skip >= AVDISCARD_NONINTRA && slice->slice_type != HEVC_SLICE_I) + return 1; + if (skip >= AVDISCARD_BIDIR && slice->slice_type == HEVC_SLICE_B) + return 1; + + if (skip >= AVDISCARD_NONREF) { + switch (unit->type) { + case HEVC_NAL_TRAIL_N: + case HEVC_NAL_TSA_N: + case HEVC_NAL_STSA_N: + case HEVC_NAL_RADL_N: + case HEVC_NAL_RASL_N: + case HEVC_NAL_VCL_N10: + case HEVC_NAL_VCL_N12: + case HEVC_NAL_VCL_N14: + // non-ref + return 1; + default: + break; + } + } + + return 0; +} + static int cbs_h2645_unit_requires_zero_byte(enum AVCodecID codec_id, CodedBitstreamUnitType type, int nal_unit_index) @@ -1510,6 +1583,7 @@ const CodedBitstreamType ff_cbs_type_h265 = { .split_fragment = &cbs_h2645_split_fragment, .read_unit = &cbs_h265_read_nal_unit, .write_unit = &cbs_h265_write_nal_unit, + .discarded_unit = &cbs_h265_discarded_nal_unit, .assemble_fragment = &cbs_h2645_assemble_fragment, .flush = &cbs_h265_flush, From patchwork Wed May 17 21:23:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 41694 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1202083pzb; Wed, 17 May 2023 06:24:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/vED1gY+oc6ShOhtBf7Z4KqPJQfMMrUSzmEtuDxEZUWULGaUggqdGdmQcKfxAxfREFduM X-Received: by 2002:aa7:c1cd:0:b0:506:8dba:bd71 with SMTP id d13-20020aa7c1cd000000b005068dbabd71mr2544951edp.27.1684329840777; Wed, 17 May 2023 06:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329840; cv=none; d=google.com; s=arc-20160816; b=cbBFGIxZr+DuEnphZM2XMyFjM0QYZUI4TCeOKnwGX1s6IAIDDfRzZD6/0IY0Hm9OyR azRDOB/dZlMu+Oi0t+6tgnETBRa6H6Ft2OFzHLcgc9tH1Xckea10Jlh9bBCrRefH9tiK wAQznnczdQd8ouKDFep7iBylamDUkTgZD7AyC0f07RIKL8RNWQULEXnEfj9UUo4mb2MF uYkaYxnfKmjXAKtHkdruVotakFhwoacF8goSIM/oZNeUDKtjTJG6QfiAr8TZwLAfCNog QoEK44dI3ib9XQMlykwzOU9finXHCr0imMgG+3TZaLyfwIqJkedIGvRdNfQPKRAxuZKe Ai3Q== 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:date :to:from:message-id:dkim-signature:delivered-to; bh=BX5l223EhRpfNBQO9T0Ppd3yyhQ1vvEtf6s79gqOdRo=; b=K3IG4nFSe3gv3Y6Svie7JMuqBu8uL+dOxcm7AT9QgUH3R+34JCFNR8rpOWKoEugCx/ ReFOyFBuaiID8DQq1DfcNH/ZF75GheUrVinLa+tTG6g06GcCdOFSI8HbTSi8yDNGLSFY gDiPlbVvK/eLvChzoh6oqxAnojzoUEzhAmrLwJQbYHWQKKreb+wob3mEul/N6BvO43yW ugtzGVuo/g8+AQ1g9SO57c3NUOl8eCZe8BL+c6B35n+M9fT5+6rZgWPcj+4v/SsJyly1 lDz62PkUG+QEm4B1AWQngHvCgJoAzFddTaFgrilUcbB+phZmCFcIFU1onZ/GwPuNcYf/ JMPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=IgVfuSky; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y11-20020aa7c24b000000b00510d79615adsi789972edo.373.2023.05.17.06.24.00; Wed, 17 May 2023 06:24:00 -0700 (PDT) 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=@foxmail.com header.s=s201512 header.b=IgVfuSky; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B0EB668C084; Wed, 17 May 2023 16:23:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-239.mail.qq.com (out203-205-221-239.mail.qq.com [203.205.221.239]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51C2B68A084 for ; Wed, 17 May 2023 16:23:47 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1684329820; bh=TCKwGwB/IXw1xVREfZMsHP1KMCW72bIBjpZXTzgRcmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IgVfuSkyK+ph1hoHSghy1VuxgnBU2qmCSpHJel2NyRZ3UpQ9UHToT+eXZK5Y5v7hI Pc9LNVaLzn+SzMX9JU272VmJd7dusfghWFM1pf3vnbTGUEnofzTo6CDEMaLr60p4RX JzQ9i0x7n7G6GI98SUJRaW73nr2aXZv0q87BEMFY= Received: from localhost.localdomain ([119.147.10.197]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 5E5A2C20; Wed, 17 May 2023 21:23:37 +0800 X-QQ-mid: xmsmtpt1684329819to8bpbi50 Message-ID: X-QQ-XMAILINFO: M4n1VKkvaIfIvlw4UKp62TRMyC7PpgKZat+wVP4Mn1QUbUuL7eK42w5AqKnTWe jDHHIrCwOq2ZgvTINmL07s/U3VafJgXboxf1fk8hxjdfGHJfoidpr5XjLUXBE+FVRHC4nu8cc1Yb P61xbKLIgdPrl+k80QoZupVbuS3boT7i+YmPo5+IuxmqeprzmPDvxeNOeFGwymkdHDbFrG6VLMyI ZsVaccTf4A9B8a0Oelb6WRN/CvnvYBl0o83ysLtMABhXgZI62atlV7g6kQUQp/qm6dkU7Jjhqs4+ q/tHQ6HIJ1D+1SRdj5Ki1xkiD/Nw580lhPzDAbzMPa2/iHCqMuCbFeKlqKbZLmVz3UigcpEUupVm CeJ99VuOADpMjNWARMzhDWKuJVv61kN1Vf1ZXW2VbWgJKPQ6fzNV3jt8GwoeLB8y1+Z7Ck1DSkDI CT9/Okb79HvagWuxxzpUJGJ8yllUbJqOz++oZgI1/zHUGMv56s7TZMmxDoTroDkjMBCvNodCfwGs 7ySSsm+hzuKjajZDzdsFj1pAir4wX+vpAI+DCubUW8QKwp3y/Wis7ndoDPuC+r/G/o53EnRwzAv5 4ogKIy49XA0OgjJ28+W0BKdMY2LXRezLT8RW7VNU920tzxFMme2YILoJX/XnH+c3P0gjUuhmYXpD Q6P1S2rGPby4lWxE9UPbDOuQmXq7cMvzVjQieNYf1g+3buUMwwMSl0Nf27pmjw/0KTPUZsPvDM4w 40K5n6yd6z1TBl6LduzFttX1Ikzq95D9I+w6AKJjFCXTuid1BPUcmSRBGhmhewG7xr9WTI84KDyT xCQqeBPZh5ObB3vDxtehavExwGBnLUeTIL4HVSO9/DJ/TZbVOxVzM7GCTieO3cHInmwF8aH3Xtdx ZflXRs0WCnb3rhGExU4tlB5ArmomW9LB6PwXCmEInIKZ2ez8EdWwZmhZGHvE4zqRUb4eETlFXtQz 0sfPH8S14lpHCfCY0QCa907U7A9+IaI81OUIH4PfLdlr6aLKxwFA== From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 May 2023 05:23:41 +0800 X-OQ-MSGID: <20230517212343.1874354-4-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230517212343.1874354-1-quinkblack@foxmail.com> References: <20230517212343.1874354-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/6] avcodec/filter_units_bsf: add skip frame 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: zN1Dbpf1rUvB From: Zhao Zhili --- libavcodec/filter_units_bsf.c | 42 +++++++++++++++++++++++++++++++++-- libavcodec/version.h | 2 +- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/libavcodec/filter_units_bsf.c b/libavcodec/filter_units_bsf.c index 38756baf42..e4c2cadbd5 100644 --- a/libavcodec/filter_units_bsf.c +++ b/libavcodec/filter_units_bsf.c @@ -34,6 +34,8 @@ typedef struct FilterUnitsContext { const char *pass_types; const char *remove_types; + enum AVDiscard discard; + int discard_flags; enum { NOOP, @@ -109,7 +111,7 @@ static int filter_units_filter(AVBSFContext *bsf, AVPacket *pkt) if (err < 0) return err; - if (ctx->mode == NOOP) + if (ctx->mode == NOOP && ctx->discard <= AVDISCARD_DEFAULT) return 0; err = ff_cbs_read_packet(ctx->cbc, frag, pkt); @@ -118,6 +120,8 @@ static int filter_units_filter(AVBSFContext *bsf, AVPacket *pkt) goto fail; } + ff_cbs_discard_units(ctx->cbc, frag, ctx->discard, ctx->discard_flags); + if (ctx->mode != NOOP) { for (i = frag->nb_units - 1; i >= 0; i--) { for (j = 0; j < ctx->nb_types; j++) { if (frag->units[i].type == ctx->type_list[j]) @@ -127,6 +131,7 @@ static int filter_units_filter(AVBSFContext *bsf, AVPacket *pkt) : j >= ctx->nb_types) ff_cbs_delete_unit(frag, i); } + } if (frag->nb_units == 0) { // Don't return packets with nothing in them. @@ -175,7 +180,7 @@ static int filter_units_init(AVBSFContext *bsf) av_log(bsf, AV_LOG_ERROR, "Failed to parse remove_types.\n"); return err; } - } else { + } else if (ctx->discard == AVDISCARD_NONE) { return 0; } @@ -183,9 +188,11 @@ static int filter_units_init(AVBSFContext *bsf) if (err < 0) return err; + if (ctx->discard == AVDISCARD_NONE) { // Don't actually decompose anything, we only want the unit data. ctx->cbc->decompose_unit_types = ctx->type_list; ctx->cbc->nb_decompose_unit_types = 0; + } if (bsf->par_in->extradata) { CodedBitstreamFragment *frag = &ctx->fragment; @@ -225,6 +232,37 @@ static const AVOption filter_units_options[] = { OFFSET(remove_types), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS }, + { "discard", "Remove the selected frames", + OFFSET(discard), AV_OPT_TYPE_INT, + { .i64 = AVDISCARD_NONE }, INT_MIN, INT_MAX, FLAGS, "discard"}, + { "none" , "discard none", + 0, AV_OPT_TYPE_CONST, + { .i64 = AVDISCARD_NONE }, INT_MIN, INT_MAX, FLAGS, "discard"}, + { "default" , "discard none, but can be changed after dynamically", + 0, AV_OPT_TYPE_CONST, + { .i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, FLAGS, "discard"}, + { "nonref", "discard all non-reference frames", + 0, AV_OPT_TYPE_CONST, + { .i64 = AVDISCARD_NONREF }, INT_MIN, INT_MAX, FLAGS, "discard"}, + { "bidir", "discard all bidirectional frames", + 0, AV_OPT_TYPE_CONST, + { .i64 = AVDISCARD_BIDIR }, INT_MIN, INT_MAX, FLAGS, "discard"}, + { "nonintra", "discard all frames except I frames", + 0, AV_OPT_TYPE_CONST, + { .i64 = AVDISCARD_NONINTRA }, INT_MIN, INT_MAX, FLAGS, "discard"}, + { "nonkey", "discard all frames except keyframes", + 0, AV_OPT_TYPE_CONST, + { .i64 = AVDISCARD_NONKEY }, INT_MIN, INT_MAX, FLAGS, "discard"}, + { "all", "discard all frames", + 0, AV_OPT_TYPE_CONST, + { .i64 = AVDISCARD_ALL }, INT_MIN, INT_MAX, FLAGS, "discard"}, + + { "discard_flags", "flags to control the discard frame behavior", + OFFSET(discard_flags), AV_OPT_TYPE_FLAGS, + { .i64 = DISCARD_FLAG_NONE }, INT_MIN, INT_MAX, FLAGS, "discard_flags"}, + { "keep_non_vcl", "non-vcl units even if the picture has been dropped", + 0, AV_OPT_TYPE_CONST, + { .i64 = DISCARD_FLAG_KEEP_NON_VCL }, INT_MIN, INT_MAX, FLAGS, "discard_flags"}, { NULL } }; diff --git a/libavcodec/version.h b/libavcodec/version.h index 7531c6c42a..c20072197d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #include "version_major.h" #define LIBAVCODEC_VERSION_MINOR 14 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ From patchwork Wed May 17 21:23:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 41697 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1202490pzb; Wed, 17 May 2023 06:24:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+1bENmQ2StNPmyzeHk1uEQFzSRHv6sEidUlt6B5GEUP6pRfBqT1/s4EX73Ed4DwWn09zX X-Received: by 2002:aa7:c405:0:b0:50d:1e11:eb9 with SMTP id j5-20020aa7c405000000b0050d1e110eb9mr2353740edq.1.1684329870005; Wed, 17 May 2023 06:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329869; cv=none; d=google.com; s=arc-20160816; b=twlOrBKj2iUxxWLXWVZfptatzJ6bTZQpwhs/L98OLXEAbDVOiPHvQnjLN5O946YwGC etPP9zcVztmZZVOECrq393Cw1Khw+wBrBm8FPxtb7mcK3x+9TjkjYVV4PmQ4Xo+U/sGA fZMxPPg9W1/GcxRQq3jxJfKh/gNeLOkphLny/vyE2Rcbpj/fuxtkChllRDDPPHu7UcM7 ZDkJ+oyl68EFACoMAbqeJaMoGA+xhqXV6/XJFhToyqR/QxN1Aw1spkRJpv9ruCIZ17qF V8bkBDdthckBOfd6vtU96l0E+n8CmavMdAdtA6gZkvOInljlOosQBVUGK5utzGZda0tq MdMg== 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:date :to:from:message-id:dkim-signature:delivered-to; bh=4ls3UUcaOjYAe4ZIzSThUPGoE+HFejiZaHh4AuifDTU=; b=HOJb9AtBUWF3J3qrD14rZIOn5gpEzRuCDttIs/yFqy5a1doNytC1spQaK6siSyPW+r jfvrlWgR/vB+4pBSue8POmGBe7HTg9L9IgsWfbtg/u786rGFp0oa8zJuaNSTVxYNFRJo SWbXkYMVv9jJZhEa44fp61FBgre2RCh6O5SQqx5AgNsu2JH35mOa66Pp/s2Fq/umGvcc CZdkAg6JEh6Au2b8sHFm1LaKuxeMS8DDiGl7fYC6+JMyoPp9rIlnozFEofcbU1uNytTM igvptJ0tzUemIr1I3D46GzsE7R7g5RxHIX3juu+PT0jDblpFzj1aAT68y1x/YdMnPshp a4yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=M+F7+5xs; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f22-20020aa7d856000000b0050d83c66852si15047289eds.330.2023.05.17.06.24.29; Wed, 17 May 2023 06:24:29 -0700 (PDT) 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=@foxmail.com header.s=s201512 header.b=M+F7+5xs; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3BEBD68C0C1; Wed, 17 May 2023 16:23:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-251-53.mail.qq.com (out203-205-251-53.mail.qq.com [203.205.251.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D10968C081 for ; Wed, 17 May 2023 16:23:48 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1684329821; bh=Xuts4c8yij6gKNPHQzw2GjsbbK04Ui3JPLdYBqf+itE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=M+F7+5xs6sXP482lTb9jzey4W90kxAQSpRUo5VUcB5DSpNwkc4KxJgL+D6Ckep50L Xk2X3aSNfW0NKMkKSYQu6EV/Wh0G6xpQR4HXoZ6HpGWW6fT8XjkpycP9X64errT2mh 4p/bSmBmdAYmnto/tQKyOYvcnHkdZ7geSWxeVUKk= Received: from localhost.localdomain ([119.147.10.197]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 5E5A2C20; Wed, 17 May 2023 21:23:37 +0800 X-QQ-mid: xmsmtpt1684329820t4raacx1o Message-ID: X-QQ-XMAILINFO: MyWLjIMK70OKisJaZF0B3emOgnhdtIJ7bZKMcsuUnQKo7ATpTVGA2f8z5ar1GW v+miBIPzMqUL8t3K7jxJUBpCB74DyB4jalfh3/tl5HUI7CIJY6wY4yagnxE1DaWBk/Cfm3ujiUuE joYyhYq3MrFom1og2KolyLP5stfaB3vl9ZQyAKI7mlXJL4yFcjdR5x7ocFzkx7gEsgN+t3so2Scr YAcdhJep4YFZq8PExXbHioCtjCf5ubhpj5n1O0aimD1bH4hCgLuTKywfTGSxFCQ/j0pfW39VZiTW Z7J+rzIGQnrEgz4bfB5svdQ9EiabC71nJNU6TJcHysQYdQ3y/Q2MoHdCqJIVr3vrg0S3sns7xCD4 NT5q1V4vp8cGlMm3IpWiCVihFi0F3E84i3RyBMKmuAXo9kAZKxZPmpZ+NwuUrw3BNf2KO/ky9c+h TS5zaNgOBZq3g48HV2TsCcrG//geV3lclFLqol/7Lb/zXWVO/9RsMgHPV/olHefKvdzv0UpbxSCb phezFOc0pl4pyfqJCvffjmtrhTKwF6C+4IrU9S6lkz5YsKcn8ImjsRQp90ZMPTZXmTPps+oEm9xV n8jdem9ESvgYgBmG5BdF89fwRJYCwnBu2pnVankeRJb6qPLEu5HOYrXZjC8qGb4Yko6Iwao3DZuX n6ihmEMGYJ1bev3x9y43Cbw2QKh9d0Cu5KbMHxLHJCDkxm8VZS5PglSI+ewBilaktRAihaTGPwCk BoJo6Gle6XGEhcYrgQM+MUAchvVZgjhMXfUjAZuQHpadCWIxNgyhll35ZIrU1qaY7+IgDonMijkB TBBp/ocpxyhggnJTHPiCk1J+Qqx7nvlSbtjz1gXbr5fo+F7ZFIEk+DsFF5nTC/jROq2wVLWBrBQw VWwT20H4or8Xsw94FO7kaWfFO0XXd2zmz+Rz0kGSTzc6o+Se78UPDMRSmdWlvaZi8AloBXS4n29l 370Dse2VdyTxyATDj2ukMnWXgwLzIyE49oSTD0v/I0mygHpAykicm8rtaN7EVribTYKBkYUaGTdz EwzycLqem5SJNJHDCr From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 May 2023 05:23:42 +0800 X-OQ-MSGID: <20230517212343.1874354-5-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230517212343.1874354-1-quinkblack@foxmail.com> References: <20230517212343.1874354-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/6] avcodec/filter_units_bsf: reindent after previous commit 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Nw1oYOa036bF From: Zhao Zhili --- libavcodec/filter_units_bsf.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavcodec/filter_units_bsf.c b/libavcodec/filter_units_bsf.c index e4c2cadbd5..9336753148 100644 --- a/libavcodec/filter_units_bsf.c +++ b/libavcodec/filter_units_bsf.c @@ -122,15 +122,15 @@ static int filter_units_filter(AVBSFContext *bsf, AVPacket *pkt) ff_cbs_discard_units(ctx->cbc, frag, ctx->discard, ctx->discard_flags); if (ctx->mode != NOOP) { - for (i = frag->nb_units - 1; i >= 0; i--) { - for (j = 0; j < ctx->nb_types; j++) { - if (frag->units[i].type == ctx->type_list[j]) - break; + for (i = frag->nb_units - 1; i >= 0; i--) { + for (j = 0; j < ctx->nb_types; j++) { + if (frag->units[i].type == ctx->type_list[j]) + break; + } + if (ctx->mode == REMOVE ? j < ctx->nb_types + : j >= ctx->nb_types) + ff_cbs_delete_unit(frag, i); } - if (ctx->mode == REMOVE ? j < ctx->nb_types - : j >= ctx->nb_types) - ff_cbs_delete_unit(frag, i); - } } if (frag->nb_units == 0) { @@ -189,9 +189,9 @@ static int filter_units_init(AVBSFContext *bsf) return err; if (ctx->discard == AVDISCARD_NONE) { - // Don't actually decompose anything, we only want the unit data. - ctx->cbc->decompose_unit_types = ctx->type_list; - ctx->cbc->nb_decompose_unit_types = 0; + // Don't actually decompose anything, we only want the unit data. + ctx->cbc->decompose_unit_types = ctx->type_list; + ctx->cbc->nb_decompose_unit_types = 0; } if (bsf->par_in->extradata) { From patchwork Wed May 17 21:23:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 41699 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1202744pzb; Wed, 17 May 2023 06:24:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CKqrn6lE2URDu0AfmGpvDhx9DHwIpFJRViy7K3KuXYBSXsczmpbyecMvXNh5Pg1VW4Ic7 X-Received: by 2002:a17:907:e91:b0:967:769e:a098 with SMTP id ho17-20020a1709070e9100b00967769ea098mr32229365ejc.15.1684329890286; Wed, 17 May 2023 06:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329890; cv=none; d=google.com; s=arc-20160816; b=QDWESdhlB5lb6JI8GN+NoUQCbC0mjSm+il/gPLb6dYmFRMMnNNh1LFbU3KKrNZZgkj bv4kTZIq6023C+3wuDDlL61EDxflWn6lNi9kGocSzMuF1LT5PSIZKODsx4YKzWNIu1dR GNr22Y6xTiYn5rcwI7sE+b/cKP/gLBiqoE7Mbay1U57xzOsxCAJDYeUjxSC++kXnBK8Z IGaA/8jzzBho3mSTrff+o5NBadeNYd57mZPRb+fQi9Bs8idFWTRNZUIB+0xi91alMqov H/ZGRi5WKTZyS71PpkbnozTm8bMO+v7ovF2mMTcH1Ins3HfuNNMNY1HsWrwDl9OUexek JpAA== 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:date :to:from:message-id:dkim-signature:delivered-to; bh=zOiL5ke6jraTfGRm4hOtPdBex3exRbvZ3Z63xPm9piY=; b=iaRSJyYm1IBQokZu34r7qNM4acWa9zk+VO6vnNn9poDWtQ7m5Ex+anDTkKfXXh5hMI KJIs/oL/TUJgo7Po99IKf8XFvV8CM9IL7ALMFP8JKWN/LsD97RBRb+OPyFFyn/yogOED I4C8SbbjbzVl4SPcqHF43ErobSIUCifliWxCoLAZMZKnleUtIKja1N6kkSREzFu9edAI rt+Ne33zJoevooNSucMBKAC2FFoO9ej25BZK1Hf3AyOHnlX6pqEzKCLdxOrnoT08o0Kj RjqbU71AdwUuGqqf2RYW/6VeJDugimxJ94iiH3ndnML9Y2aTxO8Z9hw7OvnM5Wq//5b7 B5Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=WtHgeRpY; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q6-20020a1709066b0600b00965e6dbcc1esi15497598ejr.451.2023.05.17.06.24.49; Wed, 17 May 2023 06:24:50 -0700 (PDT) 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=@foxmail.com header.s=s201512 header.b=WtHgeRpY; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 59A6068C11E; Wed, 17 May 2023 16:24:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-251-59.mail.qq.com (out203-205-251-59.mail.qq.com [203.205.251.59]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA01B68C084 for ; Wed, 17 May 2023 16:23:49 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1684329821; bh=V5ej7RAO8fx2H+L3OxK67KdBQ4m3kM07IMiRQ03PBl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WtHgeRpY+ThkPNd5YT8k5atE/M259DIOVjLJP8cNjKJt+NxbBhb7hwRUK9h5B7raV KLs7U2b4ldqInYVanjBhWEy+mY+lTaKw6w5yCSNc/HYpAuTkWLGoASr2zGhxqMmAK+ 7yFQMy7d3ZCGAA1AXFH6g+3qPa8Yaz0CmTNXdOO0= Received: from localhost.localdomain ([119.147.10.197]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 5E5A2C20; Wed, 17 May 2023 21:23:37 +0800 X-QQ-mid: xmsmtpt1684329820t7ik281em Message-ID: X-QQ-XMAILINFO: OZsapEVPoiO6/2X6miSdEoJDqfTm3otB5xmNqKx5W0XRaa1FG1jFW8Wboh9b1F qZo1veCZYzE2mSDY3rE8MODy5+AHdo9qllWnnBQ7Zn2QWUrNR+gZXe4Lb3WOAGhOK99YTxo+NTDH /QyUfy57++5AeFTUWl3Bt260zkdJJtc0za0R7j3Qqky+uXeIRdcI5HGjtezk1LNl6vHbqR7odO06 tGAAAsORZCBIHxXoasAnP0hgg5oZj7Tv7VzJg5ZLHUO99A7tyB+MEwdC4YvB8cTkwjvIjYspTht1 9vPr3eMwmFGhaUXvKuQk4IalnJIBdEkuWs/3SkBPDf7gltJXEhlPogYrSbAUcG/zzjEEgRxyGvXi trIjoNgug4gcBRR4mvH6dSbKC609MLNNXJxrI3X16Cdb5AkNJlXKl8VOcG1d22AtY7huv+4FvaoW ZPgw8oHfTCSvIiCfUnZcBHVQ7sI+LPjxnFXr6Fy9H+VijCCgzoogcS8Hxw4YYKbKl52p8L6toIsv uceaxz9PKdRe/mT3TPYTvdjUs3vpL74ipmEayCAgHsHvgSXoGY2Tc+ByRmn065WJTFDQRuuLCYGl EX/GbOARjz2kUecqJBaoNEMHPuoSuturBMR9Yr/jDlmbAw0baVhuakTTePM/G7HE2Iab0rM3orll MKXn9vX29nzjcKR+oElt0fFRUshygTxd45CCf1kbV8+s7MamuVi6vVT0nmpgj3kAYik+6mbKtfdB lNs2mYVLryt72u0HXYT65JPUPlQFrdSOC3JNJD1uh+lSb/g5+qIHu8V8/s1edXo8xBUiFmdorN7L aXXmt9AHTsY5LzA0rAjNY6T4y7CnkqeGO+M7JltK44CCSDMy/k2DhMYjAaufHreBs7AvFGzappcz 81p9B/nfzHvfdoXw8nCYgmDyyD00mq6ugGBvgIlvSbwX4PiEfMry0ojSKuf544zXQpDnQ3Qws0Kk E6ms/5e41uAiFl0KBX4L3ehhZt0bp0/qKH3t9MhVEouJR2c34UTAEPJ6ffsw72H0/8L2UHuTHaFT jU0dcY5bgKn/0AEjgZwWw7aYLIKqw= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 May 2023 05:23:43 +0800 X-OQ-MSGID: <20230517212343.1874354-6-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230517212343.1874354-1-quinkblack@foxmail.com> References: <20230517212343.1874354-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/6] fate/cbs: add tests for discard_units 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0Bp+7KFcfIdO From: Zhao Zhili --- tests/fate/cbs.mak | 28 ++++++++++ tests/ref/fate/cbs-h264-discard-bidir | 37 +++++++++++++ tests/ref/fate/cbs-h264-discard-nonintra | 8 +++ tests/ref/fate/cbs-h264-discard-nonkey | 3 ++ tests/ref/fate/cbs-h264-discard-nonref | 67 ++++++++++++++++++++++++ tests/ref/fate/cbs-hevc-discard-bidir | 3 ++ tests/ref/fate/cbs-hevc-discard-nonintra | 3 ++ tests/ref/fate/cbs-hevc-discard-nonkey | 3 ++ tests/ref/fate/cbs-hevc-discard-nonref | 26 +++++++++ 9 files changed, 178 insertions(+) create mode 100644 tests/ref/fate/cbs-h264-discard-bidir create mode 100644 tests/ref/fate/cbs-h264-discard-nonintra create mode 100644 tests/ref/fate/cbs-h264-discard-nonkey create mode 100644 tests/ref/fate/cbs-h264-discard-nonref create mode 100644 tests/ref/fate/cbs-hevc-discard-bidir create mode 100644 tests/ref/fate/cbs-hevc-discard-nonintra create mode 100644 tests/ref/fate/cbs-hevc-discard-nonkey create mode 100644 tests/ref/fate/cbs-hevc-discard-nonref +format|filename=cbs-hevc-discard-nonref.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=1.720000|size=48625|bit_rate=226162|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/fate/cbs.mak b/tests/fate/cbs.mak index a93e58ea9f..3d1ccf3897 100644 --- a/tests/fate/cbs.mak +++ b/tests/fate/cbs.mak @@ -12,6 +12,19 @@ FATE_CBS_$(1) += fate-cbs-$(1)-$(2) fate-cbs-$(1)-$(2): CMD = md5 -c:v $(3) -i $(TARGET_SAMPLES)/$(4) -c:v copy -y -bsf:v $(1)_metadata -f $(5) endef +define FATE_CBS_DISCARD_TEST +# (codec, discard_type, sample_file, output_format, dep) +FATE_CBS_$(1)_DISCARD += fate-cbs-$(1)-discard-$(2) + +tests/data/fate/cbs-$(1)-discard-$2.$(4): TAG = GEN +tests/data/fate/cbs-$(1)-discard-$2.$(4): ffmpeg$(PROGSSUF)$(EXESUF) $(5) | tests/data + $(M)$(TARGET_EXEC) $(TARGET_PATH)/ffmpeg$(PROGSSUF)$(EXESUF) -nostdin \ + -i $(3) -c:v copy -an -bsf:v filter_units=discard=$(2) \ + -f $(4) $(TARGET_PATH)/tests/data/fate/cbs-$(1)-discard-$(2).$(4) -y 2>/dev/null +fate-cbs-$(1)-discard-$2: ffprobe tests/data/fate/cbs-$(1)-discard-$(2).$(4) +fate-cbs-$(1)-discard-$2: CMD = ffprobe_demux $(TARGET_PATH)/tests/data/fate/cbs-$(1)-discard-$(2).$(4) +endef + # AV1 read/write FATE_CBS_AV1_CONFORMANCE_SAMPLES = \ @@ -67,6 +80,13 @@ $(foreach N,$(FATE_CBS_H264_SAMPLES),$(eval $(call FATE_CBS_TEST,h264,$(basename FATE_CBS_H264-$(call FATE_CBS_DEPS, H264, H264, H264, H264, H264) = $(FATE_CBS_h264) +$(eval $(call FATE_CBS_DISCARD_TEST,h264,nonref,$(TARGET_SAMPLES)/h264/interlaced_crop.mp4,mp4)) +$(eval $(call FATE_CBS_DISCARD_TEST,h264,bidir,$(TARGET_SAMPLES)/h264/interlaced_crop.mp4,mp4)) +$(eval $(call FATE_CBS_DISCARD_TEST,h264,nonintra,$(TARGET_SAMPLES)/h264/interlaced_crop.mp4,mp4)) +$(eval $(call FATE_CBS_DISCARD_TEST,h264,nonkey,$(TARGET_SAMPLES)/h264/interlaced_crop.mp4,mp4)) + +FATE_CBS_H264-$(call ALLYES, MP4_MUXER, H264_PARSER, FILTER_UNITS_BSF, H264_MUXER) += $(FATE_CBS_h264_DISCARD) + FATE_H264_REDUNDANT_PPS-$(call REMUX, H264, MOV_DEMUXER H264_REDUNDANT_PPS_BSF \ H264_DECODER H264_PARSER RAWVIDEO_ENCODER) \ @@ -133,6 +153,14 @@ FATE_CBS_HEVC_SAMPLES = \ $(foreach N,$(FATE_CBS_HEVC_SAMPLES),$(eval $(call FATE_CBS_TEST,hevc,$(basename $(N)),hevc,hevc-conformance/$(N),hevc))) FATE_CBS_HEVC-$(call FATE_CBS_DEPS, HEVC, HEVC, HEVC, HEVC, HEVC) = $(FATE_CBS_hevc) + +$(eval $(call FATE_CBS_DISCARD_TEST,hevc,nonref,$(TARGET_PATH)/tests/data/hevc-mp4.mov,mp4,tests/data/hevc-mp4.mov)) +$(eval $(call FATE_CBS_DISCARD_TEST,hevc,bidir,$(TARGET_PATH)/tests/data/hevc-mp4.mov,mp4,tests/data/hevc-mp4.mov)) +$(eval $(call FATE_CBS_DISCARD_TEST,hevc,nonintra,$(TARGET_PATH)/tests/data/hevc-mp4.mov,mp4,tests/data/hevc-mp4.mov)) +$(eval $(call FATE_CBS_DISCARD_TEST,hevc,nonkey,$(TARGET_PATH)/tests/data/hevc-mp4.mov,mp4,tests/data/hevc-mp4.mov)) + +FATE_CBS_HEVC-$(call ALLYES, MP4_MUXER, HEVC_PARSER, FILTER_UNITS_BSF, HEVC_MUXER) += $(FATE_CBS_hevc_DISCARD) + FATE_SAMPLES_AVCONV += $(FATE_CBS_HEVC-yes) fate-cbs-hevc: $(FATE_CBS_HEVC-yes) diff --git a/tests/ref/fate/cbs-h264-discard-bidir b/tests/ref/fate/cbs-h264-discard-bidir new file mode 100644 index 0000000000..f161ee392c --- /dev/null +++ b/tests/ref/fate/cbs-h264-discard-bidir @@ -0,0 +1,37 @@ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=-1024|dts_time=-0.080000|duration=512|duration_time=0.040000|size=22583|pos=48|flags=K__|data_hash=CRC32:69e4d65d +packet|codec_type=video|stream_index=0|pts=2048|pts_time=0.160000|dts=-512|dts_time=-0.040000|duration=512|duration_time=0.040000|size=4023|pos=22631|flags=___|data_hash=CRC32:0013cf12 +packet|codec_type=video|stream_index=0|pts=4096|pts_time=0.320000|dts=1536|dts_time=0.120000|duration=512|duration_time=0.040000|size=4214|pos=26654|flags=___|data_hash=CRC32:3d1a75de +packet|codec_type=video|stream_index=0|pts=6144|pts_time=0.480000|dts=3584|dts_time=0.280000|duration=512|duration_time=0.040000|size=4067|pos=30868|flags=___|data_hash=CRC32:0ae6ba93 +packet|codec_type=video|stream_index=0|pts=8192|pts_time=0.640000|dts=5632|dts_time=0.440000|duration=512|duration_time=0.040000|size=4223|pos=34935|flags=___|data_hash=CRC32:653ad50a +packet|codec_type=video|stream_index=0|pts=10240|pts_time=0.800000|dts=7680|dts_time=0.600000|duration=512|duration_time=0.040000|size=4757|pos=39158|flags=___|data_hash=CRC32:9c63fc60 +packet|codec_type=video|stream_index=0|pts=12288|pts_time=0.960000|dts=9728|dts_time=0.760000|duration=512|duration_time=0.040000|size=26559|pos=43915|flags=K__|data_hash=CRC32:3d91ff30 +packet|codec_type=video|stream_index=0|pts=14336|pts_time=1.120000|dts=11776|dts_time=0.920000|duration=512|duration_time=0.040000|size=3419|pos=70474|flags=___|data_hash=CRC32:a16c6e06 +packet|codec_type=video|stream_index=0|pts=16384|pts_time=1.280000|dts=13824|dts_time=1.080000|duration=512|duration_time=0.040000|size=4270|pos=73893|flags=___|data_hash=CRC32:75f5fba0 +packet|codec_type=video|stream_index=0|pts=18432|pts_time=1.440000|dts=15872|dts_time=1.240000|duration=512|duration_time=0.040000|size=6351|pos=78163|flags=___|data_hash=CRC32:b71a5f72 +packet|codec_type=video|stream_index=0|pts=20480|pts_time=1.600000|dts=17920|dts_time=1.400000|duration=512|duration_time=0.040000|size=5504|pos=84514|flags=___|data_hash=CRC32:f4513593 +packet|codec_type=video|stream_index=0|pts=22528|pts_time=1.760000|dts=19968|dts_time=1.560000|duration=512|duration_time=0.040000|size=5330|pos=90018|flags=___|data_hash=CRC32:e0e58cfc +packet|codec_type=video|stream_index=0|pts=24576|pts_time=1.920000|dts=22016|dts_time=1.720000|duration=512|duration_time=0.040000|size=25829|pos=95348|flags=K__|data_hash=CRC32:0ffa1941 +packet|codec_type=video|stream_index=0|pts=26624|pts_time=2.080000|dts=24064|dts_time=1.880000|duration=512|duration_time=0.040000|size=3788|pos=121177|flags=___|data_hash=CRC32:b7d88c97 +packet|codec_type=video|stream_index=0|pts=28672|pts_time=2.240000|dts=26112|dts_time=2.040000|duration=512|duration_time=0.040000|size=5277|pos=124965|flags=___|data_hash=CRC32:836281be +packet|codec_type=video|stream_index=0|pts=30720|pts_time=2.400000|dts=28160|dts_time=2.200000|duration=512|duration_time=0.040000|size=4423|pos=130242|flags=___|data_hash=CRC32:16ce42d5 +packet|codec_type=video|stream_index=0|pts=32768|pts_time=2.560000|dts=30208|dts_time=2.360000|duration=512|duration_time=0.040000|size=4789|pos=134665|flags=___|data_hash=CRC32:c3253157 +packet|codec_type=video|stream_index=0|pts=34816|pts_time=2.720000|dts=32256|dts_time=2.520000|duration=512|duration_time=0.040000|size=4543|pos=139454|flags=___|data_hash=CRC32:2b284455 +packet|codec_type=video|stream_index=0|pts=36864|pts_time=2.880000|dts=34304|dts_time=2.680000|duration=512|duration_time=0.040000|size=24224|pos=143997|flags=K__|data_hash=CRC32:f4545b97 +packet|codec_type=video|stream_index=0|pts=38912|pts_time=3.040000|dts=36352|dts_time=2.840000|duration=512|duration_time=0.040000|size=3804|pos=168221|flags=___|data_hash=CRC32:9e182c9d +packet|codec_type=video|stream_index=0|pts=40960|pts_time=3.200000|dts=38400|dts_time=3.000000|duration=512|duration_time=0.040000|size=4832|pos=172025|flags=___|data_hash=CRC32:9177a3b3 +packet|codec_type=video|stream_index=0|pts=43008|pts_time=3.360000|dts=40448|dts_time=3.160000|duration=512|duration_time=0.040000|size=5169|pos=176857|flags=___|data_hash=CRC32:4b98426d +packet|codec_type=video|stream_index=0|pts=45056|pts_time=3.520000|dts=42496|dts_time=3.320000|duration=512|duration_time=0.040000|size=5428|pos=182026|flags=___|data_hash=CRC32:1b44d316 +packet|codec_type=video|stream_index=0|pts=47104|pts_time=3.680000|dts=44544|dts_time=3.480000|duration=512|duration_time=0.040000|size=5354|pos=187454|flags=___|data_hash=CRC32:e9e88511 +packet|codec_type=video|stream_index=0|pts=49152|pts_time=3.840000|dts=46592|dts_time=3.640000|duration=512|duration_time=0.040000|size=24046|pos=192808|flags=K__|data_hash=CRC32:ce41a6fe +packet|codec_type=video|stream_index=0|pts=51200|pts_time=4.000000|dts=48640|dts_time=3.800000|duration=512|duration_time=0.040000|size=4427|pos=216854|flags=___|data_hash=CRC32:69f58de5 +packet|codec_type=video|stream_index=0|pts=53248|pts_time=4.160000|dts=50688|dts_time=3.960000|duration=512|duration_time=0.040000|size=5196|pos=221281|flags=___|data_hash=CRC32:82877b2a +packet|codec_type=video|stream_index=0|pts=55296|pts_time=4.320000|dts=52736|dts_time=4.120000|duration=512|duration_time=0.040000|size=6958|pos=226477|flags=___|data_hash=CRC32:14b54257 +packet|codec_type=video|stream_index=0|pts=57344|pts_time=4.480000|dts=54784|dts_time=4.280000|duration=512|duration_time=0.040000|size=5007|pos=233435|flags=___|data_hash=CRC32:7b5d6eff +packet|codec_type=video|stream_index=0|pts=59392|pts_time=4.640000|dts=56832|dts_time=4.440000|duration=512|duration_time=0.040000|size=1864|pos=238442|flags=___|data_hash=CRC32:32f9a8b3 +packet|codec_type=video|stream_index=0|pts=61440|pts_time=4.800000|dts=58880|dts_time=4.600000|duration=512|duration_time=0.040000|size=22592|pos=240306|flags=K__|data_hash=CRC32:413e519a +packet|codec_type=video|stream_index=0|pts=61952|pts_time=4.840000|dts=60928|dts_time=4.760000|duration=512|duration_time=0.040000|size=158|pos=262898|flags=___|data_hash=CRC32:aedfe6be +packet|codec_type=video|stream_index=0|pts=62464|pts_time=4.880000|dts=61440|dts_time=4.800000|duration=512|duration_time=0.040000|size=332|pos=263056|flags=___|data_hash=CRC32:4d2e6f42 +packet|codec_type=video|stream_index=0|pts=63488|pts_time=4.960000|dts=61952|dts_time=4.840000|duration=512|duration_time=0.040000|size=326|pos=263388|flags=___|data_hash=CRC32:c9e610e6 +packet|codec_type=video|stream_index=0|pts=64000|pts_time=5.000000|dts=62976|dts_time=4.920000|duration=512|duration_time=0.040000|size=235|pos=263714|flags=___|data_hash=CRC32:5b757bc6 +stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=avc1|codec_tag=0x31637661|width=640|height=360|coded_width=640|coded_height=360|closed_captions=0|film_grain=0|has_b_frames=2|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|level=41|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=tt|refs=1|is_avc=true|nal_length_size=4|id=0x1|r_frame_rate=25/1|avg_frame_rate=125/18|time_base=1/12800|start_pts=0|start_time=0.000000|duration_ts=64512|duration=5.040000|bit_rate=418890|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=35|nb_read_frames=N/A|nb_read_packets=35|extradata_size=54|extradata_hash=CRC32:148701ce|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposit ion:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=GPAC ISO Video Handler|tag:vendor_id=[0][0][0][0] +format|filename=cbs-h264-discard-bidir.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=5.040000|size=265025|bit_rate=420674|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2avc1mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/ref/fate/cbs-h264-discard-nonintra b/tests/ref/fate/cbs-h264-discard-nonintra new file mode 100644 index 0000000000..3fc237255a --- /dev/null +++ b/tests/ref/fate/cbs-h264-discard-nonintra @@ -0,0 +1,8 @@ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=-1024|dts_time=-0.080000|duration=512|duration_time=0.040000|size=22583|pos=48|flags=K__|data_hash=CRC32:69e4d65d +packet|codec_type=video|stream_index=0|pts=12288|pts_time=0.960000|dts=9728|dts_time=0.760000|duration=512|duration_time=0.040000|size=26559|pos=22631|flags=K__|data_hash=CRC32:3d91ff30 +packet|codec_type=video|stream_index=0|pts=24576|pts_time=1.920000|dts=22016|dts_time=1.720000|duration=512|duration_time=0.040000|size=25829|pos=49190|flags=K__|data_hash=CRC32:0ffa1941 +packet|codec_type=video|stream_index=0|pts=36864|pts_time=2.880000|dts=34304|dts_time=2.680000|duration=512|duration_time=0.040000|size=24224|pos=75019|flags=K__|data_hash=CRC32:f4545b97 +packet|codec_type=video|stream_index=0|pts=49152|pts_time=3.840000|dts=46592|dts_time=3.640000|duration=512|duration_time=0.040000|size=24046|pos=99243|flags=K__|data_hash=CRC32:ce41a6fe +packet|codec_type=video|stream_index=0|pts=61440|pts_time=4.800000|dts=58880|dts_time=4.600000|duration=512|duration_time=0.040000|size=22592|pos=123289|flags=K__|data_hash=CRC32:413e519a +stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=avc1|codec_tag=0x31637661|width=640|height=360|coded_width=640|coded_height=360|closed_captions=0|film_grain=0|has_b_frames=2|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|level=41|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=tt|refs=1|is_avc=true|nal_length_size=4|id=0x1|r_frame_rate=25/12|avg_frame_rate=75/59|time_base=1/12800|start_pts=0|start_time=0.000000|duration_ts=60416|duration=4.720000|bit_rate=247174|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=6|nb_read_frames=N/A|nb_read_packets=6|extradata_size=54|extradata_hash=CRC32:148701ce|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|dispositio n:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=GPAC ISO Video Handler|tag:vendor_id=[0][0][0][0] +format|filename=cbs-h264-discard-nonintra.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=4.720000|size=146761|bit_rate=248747|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2avc1mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/ref/fate/cbs-h264-discard-nonkey b/tests/ref/fate/cbs-h264-discard-nonkey new file mode 100644 index 0000000000..033235af55 --- /dev/null +++ b/tests/ref/fate/cbs-h264-discard-nonkey @@ -0,0 +1,3 @@ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=-1024|dts_time=-0.080000|duration=512|duration_time=0.040000|size=22583|pos=48|flags=K__|data_hash=CRC32:69e4d65d +stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=avc1|codec_tag=0x31637661|width=640|height=360|coded_width=640|coded_height=360|closed_captions=0|film_grain=0|has_b_frames=2|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|level=41|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=tt|refs=1|is_avc=true|nal_length_size=4|id=0x1|r_frame_rate=25/1|avg_frame_rate=25/1|time_base=1/12800|start_pts=0|start_time=0.000000|duration_ts=512|duration=0.040000|bit_rate=4516600|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=1|nb_read_frames=N/A|nb_read_packets=1|extradata_size=54|extradata_hash=CRC32:148701ce|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:t imed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=GPAC ISO Video Handler|tag:vendor_id=[0][0][0][0] +format|filename=cbs-h264-discard-nonkey.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=0.040000|size=23463|bit_rate=4692600|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2avc1mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/ref/fate/cbs-h264-discard-nonref b/tests/ref/fate/cbs-h264-discard-nonref new file mode 100644 index 0000000000..b63eec1abd --- /dev/null +++ b/tests/ref/fate/cbs-h264-discard-nonref @@ -0,0 +1,67 @@ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=-1024|dts_time=-0.080000|duration=512|duration_time=0.040000|size=22583|pos=48|flags=K__|data_hash=CRC32:69e4d65d +packet|codec_type=video|stream_index=0|pts=2048|pts_time=0.160000|dts=-512|dts_time=-0.040000|duration=512|duration_time=0.040000|size=4023|pos=22631|flags=___|data_hash=CRC32:0013cf12 +packet|codec_type=video|stream_index=0|pts=1024|pts_time=0.080000|dts=0|dts_time=0.000000|duration=512|duration_time=0.040000|size=1098|pos=26654|flags=___|data_hash=CRC32:0fa0e9cb +packet|codec_type=video|stream_index=0|pts=4096|pts_time=0.320000|dts=1536|dts_time=0.120000|duration=512|duration_time=0.040000|size=4214|pos=27752|flags=___|data_hash=CRC32:3d1a75de +packet|codec_type=video|stream_index=0|pts=3072|pts_time=0.240000|dts=2048|dts_time=0.160000|duration=512|duration_time=0.040000|size=1119|pos=31966|flags=___|data_hash=CRC32:2f0223aa +packet|codec_type=video|stream_index=0|pts=6144|pts_time=0.480000|dts=3584|dts_time=0.280000|duration=512|duration_time=0.040000|size=4067|pos=33085|flags=___|data_hash=CRC32:0ae6ba93 +packet|codec_type=video|stream_index=0|pts=5120|pts_time=0.400000|dts=4096|dts_time=0.320000|duration=512|duration_time=0.040000|size=964|pos=37152|flags=___|data_hash=CRC32:c8ce52dc +packet|codec_type=video|stream_index=0|pts=8192|pts_time=0.640000|dts=5632|dts_time=0.440000|duration=512|duration_time=0.040000|size=4223|pos=38116|flags=___|data_hash=CRC32:653ad50a +packet|codec_type=video|stream_index=0|pts=7168|pts_time=0.560000|dts=6144|dts_time=0.480000|duration=512|duration_time=0.040000|size=1042|pos=42339|flags=___|data_hash=CRC32:9979a4e9 +packet|codec_type=video|stream_index=0|pts=10240|pts_time=0.800000|dts=7680|dts_time=0.600000|duration=512|duration_time=0.040000|size=4757|pos=43381|flags=___|data_hash=CRC32:9c63fc60 +packet|codec_type=video|stream_index=0|pts=9216|pts_time=0.720000|dts=8192|dts_time=0.640000|duration=512|duration_time=0.040000|size=1184|pos=48138|flags=___|data_hash=CRC32:b8909a00 +packet|codec_type=video|stream_index=0|pts=12288|pts_time=0.960000|dts=9728|dts_time=0.760000|duration=512|duration_time=0.040000|size=26559|pos=49322|flags=K__|data_hash=CRC32:3d91ff30 +packet|codec_type=video|stream_index=0|pts=11264|pts_time=0.880000|dts=10240|dts_time=0.800000|duration=512|duration_time=0.040000|size=1143|pos=75881|flags=___|data_hash=CRC32:cae51d5c +packet|codec_type=video|stream_index=0|pts=14336|pts_time=1.120000|dts=11776|dts_time=0.920000|duration=512|duration_time=0.040000|size=3419|pos=77024|flags=___|data_hash=CRC32:a16c6e06 +packet|codec_type=video|stream_index=0|pts=13312|pts_time=1.040000|dts=12288|dts_time=0.960000|duration=512|duration_time=0.040000|size=1130|pos=80443|flags=___|data_hash=CRC32:53fdc474 +packet|codec_type=video|stream_index=0|pts=16384|pts_time=1.280000|dts=13824|dts_time=1.080000|duration=512|duration_time=0.040000|size=4270|pos=81573|flags=___|data_hash=CRC32:75f5fba0 +packet|codec_type=video|stream_index=0|pts=15360|pts_time=1.200000|dts=14336|dts_time=1.120000|duration=512|duration_time=0.040000|size=1121|pos=85843|flags=___|data_hash=CRC32:bcef6ae6 +packet|codec_type=video|stream_index=0|pts=18432|pts_time=1.440000|dts=15872|dts_time=1.240000|duration=512|duration_time=0.040000|size=6351|pos=86964|flags=___|data_hash=CRC32:b71a5f72 +packet|codec_type=video|stream_index=0|pts=17408|pts_time=1.360000|dts=16384|dts_time=1.280000|duration=512|duration_time=0.040000|size=1190|pos=93315|flags=___|data_hash=CRC32:bb46179d +packet|codec_type=video|stream_index=0|pts=20480|pts_time=1.600000|dts=17920|dts_time=1.400000|duration=512|duration_time=0.040000|size=5504|pos=94505|flags=___|data_hash=CRC32:f4513593 +packet|codec_type=video|stream_index=0|pts=19456|pts_time=1.520000|dts=18432|dts_time=1.440000|duration=512|duration_time=0.040000|size=1242|pos=100009|flags=___|data_hash=CRC32:14765239 +packet|codec_type=video|stream_index=0|pts=22528|pts_time=1.760000|dts=19968|dts_time=1.560000|duration=512|duration_time=0.040000|size=5330|pos=101251|flags=___|data_hash=CRC32:e0e58cfc +packet|codec_type=video|stream_index=0|pts=21504|pts_time=1.680000|dts=20480|dts_time=1.600000|duration=512|duration_time=0.040000|size=1273|pos=106581|flags=___|data_hash=CRC32:47e84071 +packet|codec_type=video|stream_index=0|pts=24576|pts_time=1.920000|dts=22016|dts_time=1.720000|duration=512|duration_time=0.040000|size=25829|pos=107854|flags=K__|data_hash=CRC32:0ffa1941 +packet|codec_type=video|stream_index=0|pts=23552|pts_time=1.840000|dts=22528|dts_time=1.760000|duration=512|duration_time=0.040000|size=1208|pos=133683|flags=___|data_hash=CRC32:c36f1ddc +packet|codec_type=video|stream_index=0|pts=26624|pts_time=2.080000|dts=24064|dts_time=1.880000|duration=512|duration_time=0.040000|size=3788|pos=134891|flags=___|data_hash=CRC32:b7d88c97 +packet|codec_type=video|stream_index=0|pts=25600|pts_time=2.000000|dts=24576|dts_time=1.920000|duration=512|duration_time=0.040000|size=1189|pos=138679|flags=___|data_hash=CRC32:f1000036 +packet|codec_type=video|stream_index=0|pts=28672|pts_time=2.240000|dts=26112|dts_time=2.040000|duration=512|duration_time=0.040000|size=5277|pos=139868|flags=___|data_hash=CRC32:836281be +packet|codec_type=video|stream_index=0|pts=27648|pts_time=2.160000|dts=26624|dts_time=2.080000|duration=512|duration_time=0.040000|size=1354|pos=145145|flags=___|data_hash=CRC32:60d42d85 +packet|codec_type=video|stream_index=0|pts=30720|pts_time=2.400000|dts=28160|dts_time=2.200000|duration=512|duration_time=0.040000|size=4423|pos=146499|flags=___|data_hash=CRC32:16ce42d5 +packet|codec_type=video|stream_index=0|pts=29696|pts_time=2.320000|dts=28672|dts_time=2.240000|duration=512|duration_time=0.040000|size=1466|pos=150922|flags=___|data_hash=CRC32:bb24a5a6 +packet|codec_type=video|stream_index=0|pts=32768|pts_time=2.560000|dts=30208|dts_time=2.360000|duration=512|duration_time=0.040000|size=4789|pos=152388|flags=___|data_hash=CRC32:c3253157 +packet|codec_type=video|stream_index=0|pts=31744|pts_time=2.480000|dts=30720|dts_time=2.400000|duration=512|duration_time=0.040000|size=1437|pos=157177|flags=___|data_hash=CRC32:25effcab +packet|codec_type=video|stream_index=0|pts=34816|pts_time=2.720000|dts=32256|dts_time=2.520000|duration=512|duration_time=0.040000|size=4543|pos=158614|flags=___|data_hash=CRC32:2b284455 +packet|codec_type=video|stream_index=0|pts=33792|pts_time=2.640000|dts=32768|dts_time=2.560000|duration=512|duration_time=0.040000|size=1547|pos=163157|flags=___|data_hash=CRC32:fec8c6fd +packet|codec_type=video|stream_index=0|pts=36864|pts_time=2.880000|dts=34304|dts_time=2.680000|duration=512|duration_time=0.040000|size=24224|pos=164704|flags=K__|data_hash=CRC32:f4545b97 +packet|codec_type=video|stream_index=0|pts=35840|pts_time=2.800000|dts=34816|dts_time=2.720000|duration=512|duration_time=0.040000|size=1424|pos=188928|flags=___|data_hash=CRC32:9fea2803 +packet|codec_type=video|stream_index=0|pts=38912|pts_time=3.040000|dts=36352|dts_time=2.840000|duration=512|duration_time=0.040000|size=3804|pos=190352|flags=___|data_hash=CRC32:9e182c9d +packet|codec_type=video|stream_index=0|pts=37888|pts_time=2.960000|dts=36864|dts_time=2.880000|duration=512|duration_time=0.040000|size=1286|pos=194156|flags=___|data_hash=CRC32:80fc98bb +packet|codec_type=video|stream_index=0|pts=40960|pts_time=3.200000|dts=38400|dts_time=3.000000|duration=512|duration_time=0.040000|size=4832|pos=195442|flags=___|data_hash=CRC32:9177a3b3 +packet|codec_type=video|stream_index=0|pts=39936|pts_time=3.120000|dts=38912|dts_time=3.040000|duration=512|duration_time=0.040000|size=1448|pos=200274|flags=___|data_hash=CRC32:ddfa0b77 +packet|codec_type=video|stream_index=0|pts=43008|pts_time=3.360000|dts=40448|dts_time=3.160000|duration=512|duration_time=0.040000|size=5169|pos=201722|flags=___|data_hash=CRC32:4b98426d +packet|codec_type=video|stream_index=0|pts=41984|pts_time=3.280000|dts=40960|dts_time=3.200000|duration=512|duration_time=0.040000|size=1451|pos=206891|flags=___|data_hash=CRC32:aea0b422 +packet|codec_type=video|stream_index=0|pts=45056|pts_time=3.520000|dts=42496|dts_time=3.320000|duration=512|duration_time=0.040000|size=5428|pos=208342|flags=___|data_hash=CRC32:1b44d316 +packet|codec_type=video|stream_index=0|pts=44032|pts_time=3.440000|dts=43008|dts_time=3.360000|duration=512|duration_time=0.040000|size=1576|pos=213770|flags=___|data_hash=CRC32:cbb3eee1 +packet|codec_type=video|stream_index=0|pts=47104|pts_time=3.680000|dts=44544|dts_time=3.480000|duration=512|duration_time=0.040000|size=5354|pos=215346|flags=___|data_hash=CRC32:e9e88511 +packet|codec_type=video|stream_index=0|pts=46080|pts_time=3.600000|dts=45056|dts_time=3.520000|duration=512|duration_time=0.040000|size=1503|pos=220700|flags=___|data_hash=CRC32:b9ee459e +packet|codec_type=video|stream_index=0|pts=49152|pts_time=3.840000|dts=46592|dts_time=3.640000|duration=512|duration_time=0.040000|size=24046|pos=222203|flags=K__|data_hash=CRC32:ce41a6fe +packet|codec_type=video|stream_index=0|pts=48128|pts_time=3.760000|dts=47104|dts_time=3.680000|duration=512|duration_time=0.040000|size=1584|pos=246249|flags=___|data_hash=CRC32:4438c672 +packet|codec_type=video|stream_index=0|pts=51200|pts_time=4.000000|dts=48640|dts_time=3.800000|duration=512|duration_time=0.040000|size=4427|pos=247833|flags=___|data_hash=CRC32:69f58de5 +packet|codec_type=video|stream_index=0|pts=50176|pts_time=3.920000|dts=49152|dts_time=3.840000|duration=512|duration_time=0.040000|size=1494|pos=252260|flags=___|data_hash=CRC32:b78c9e7d +packet|codec_type=video|stream_index=0|pts=53248|pts_time=4.160000|dts=50688|dts_time=3.960000|duration=512|duration_time=0.040000|size=5196|pos=253754|flags=___|data_hash=CRC32:82877b2a +packet|codec_type=video|stream_index=0|pts=52224|pts_time=4.080000|dts=51200|dts_time=4.000000|duration=512|duration_time=0.040000|size=1485|pos=258950|flags=___|data_hash=CRC32:84553d2d +packet|codec_type=video|stream_index=0|pts=55296|pts_time=4.320000|dts=52736|dts_time=4.120000|duration=512|duration_time=0.040000|size=6958|pos=260435|flags=___|data_hash=CRC32:14b54257 +packet|codec_type=video|stream_index=0|pts=54272|pts_time=4.240000|dts=53248|dts_time=4.160000|duration=512|duration_time=0.040000|size=1189|pos=267393|flags=___|data_hash=CRC32:845381ae +packet|codec_type=video|stream_index=0|pts=57344|pts_time=4.480000|dts=54784|dts_time=4.280000|duration=512|duration_time=0.040000|size=5007|pos=268582|flags=___|data_hash=CRC32:7b5d6eff +packet|codec_type=video|stream_index=0|pts=56320|pts_time=4.400000|dts=55296|dts_time=4.320000|duration=512|duration_time=0.040000|size=454|pos=273589|flags=___|data_hash=CRC32:eccc8273 +packet|codec_type=video|stream_index=0|pts=59392|pts_time=4.640000|dts=56832|dts_time=4.440000|duration=512|duration_time=0.040000|size=1864|pos=274043|flags=___|data_hash=CRC32:32f9a8b3 +packet|codec_type=video|stream_index=0|pts=58368|pts_time=4.560000|dts=57344|dts_time=4.480000|duration=512|duration_time=0.040000|size=361|pos=275907|flags=___|data_hash=CRC32:fe582a76 +packet|codec_type=video|stream_index=0|pts=61440|pts_time=4.800000|dts=58880|dts_time=4.600000|duration=512|duration_time=0.040000|size=22592|pos=276268|flags=K__|data_hash=CRC32:413e519a +packet|codec_type=video|stream_index=0|pts=60416|pts_time=4.720000|dts=59392|dts_time=4.640000|duration=512|duration_time=0.040000|size=385|pos=298860|flags=___|data_hash=CRC32:aee406fc +packet|codec_type=video|stream_index=0|pts=61952|pts_time=4.840000|dts=60928|dts_time=4.760000|duration=512|duration_time=0.040000|size=158|pos=299245|flags=___|data_hash=CRC32:aedfe6be +packet|codec_type=video|stream_index=0|pts=62464|pts_time=4.880000|dts=61440|dts_time=4.800000|duration=512|duration_time=0.040000|size=332|pos=299403|flags=___|data_hash=CRC32:4d2e6f42 +packet|codec_type=video|stream_index=0|pts=63488|pts_time=4.960000|dts=61952|dts_time=4.840000|duration=512|duration_time=0.040000|size=326|pos=299735|flags=___|data_hash=CRC32:c9e610e6 +packet|codec_type=video|stream_index=0|pts=64000|pts_time=5.000000|dts=62976|dts_time=4.920000|duration=512|duration_time=0.040000|size=235|pos=300061|flags=___|data_hash=CRC32:5b757bc6 +stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=avc1|codec_tag=0x31637661|width=640|height=360|coded_width=640|coded_height=360|closed_captions=0|film_grain=0|has_b_frames=2|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|level=41|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=tt|refs=1|is_avc=true|nal_length_size=4|id=0x1|r_frame_rate=25/1|avg_frame_rate=1625/126|time_base=1/12800|start_pts=0|start_time=0.000000|duration_ts=64512|duration=5.040000|bit_rate=476584|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=65|nb_read_frames=N/A|nb_read_packets=65|extradata_size=54|extradata_hash=CRC32:148701ce|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|dispos ition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=GPAC ISO Video Handler|tag:vendor_id=[0][0][0][0] +format|filename=cbs-h264-discard-nonref.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=5.040000|size=302420|bit_rate=480031|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2avc1mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/ref/fate/cbs-hevc-discard-bidir b/tests/ref/fate/cbs-hevc-discard-bidir new file mode 100644 index 0000000000..65dbe73226 --- /dev/null +++ b/tests/ref/fate/cbs-hevc-discard-bidir @@ -0,0 +1,3 @@ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=48000|duration_time=0.040000|size=7454|pos=44|flags=KD_|data_hash=CRC32:4c4c3bab +stream|index=0|codec_name=hevc|profile=2|codec_type=video|codec_tag_string=hev1|codec_tag=0x31766568|width=416|height=240|coded_width=416|coded_height=240|closed_captions=0|film_grain=0|has_b_frames=3|sample_aspect_ratio=N/A|display_aspect_ratio=N/A|pix_fmt=yuv420p10le|level=60|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=unknown|refs=1|id=0x1|r_frame_rate=25/1|avg_frame_rate=25/1|time_base=1/1200000|start_pts=0|start_time=0.000000|duration_ts=48000|duration=0.040000|bit_rate=1490800|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=1|nb_read_frames=N/A|nb_read_packets=1|extradata_size=121|extradata_hash=CRC32:bd471302|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|dis position:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=VideoHandler|tag:vendor_id=[0][0][0][0] +format|filename=cbs-hevc-discard-bidir.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=0.040000|size=8347|bit_rate=1669400|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/ref/fate/cbs-hevc-discard-nonintra b/tests/ref/fate/cbs-hevc-discard-nonintra new file mode 100644 index 0000000000..dc726b895f --- /dev/null +++ b/tests/ref/fate/cbs-hevc-discard-nonintra @@ -0,0 +1,3 @@ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=48000|duration_time=0.040000|size=7454|pos=44|flags=KD_|data_hash=CRC32:4c4c3bab +stream|index=0|codec_name=hevc|profile=2|codec_type=video|codec_tag_string=hev1|codec_tag=0x31766568|width=416|height=240|coded_width=416|coded_height=240|closed_captions=0|film_grain=0|has_b_frames=3|sample_aspect_ratio=N/A|display_aspect_ratio=N/A|pix_fmt=yuv420p10le|level=60|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=unknown|refs=1|id=0x1|r_frame_rate=25/1|avg_frame_rate=25/1|time_base=1/1200000|start_pts=0|start_time=0.000000|duration_ts=48000|duration=0.040000|bit_rate=1490800|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=1|nb_read_frames=N/A|nb_read_packets=1|extradata_size=121|extradata_hash=CRC32:bd471302|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|dis position:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=VideoHandler|tag:vendor_id=[0][0][0][0] +format|filename=cbs-hevc-discard-nonintra.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=0.040000|size=8347|bit_rate=1669400|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/ref/fate/cbs-hevc-discard-nonkey b/tests/ref/fate/cbs-hevc-discard-nonkey new file mode 100644 index 0000000000..e032a801f0 --- /dev/null +++ b/tests/ref/fate/cbs-hevc-discard-nonkey @@ -0,0 +1,3 @@ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=48000|duration_time=0.040000|size=7454|pos=44|flags=KD_|data_hash=CRC32:4c4c3bab +stream|index=0|codec_name=hevc|profile=2|codec_type=video|codec_tag_string=hev1|codec_tag=0x31766568|width=416|height=240|coded_width=416|coded_height=240|closed_captions=0|film_grain=0|has_b_frames=3|sample_aspect_ratio=N/A|display_aspect_ratio=N/A|pix_fmt=yuv420p10le|level=60|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=unknown|refs=1|id=0x1|r_frame_rate=25/1|avg_frame_rate=25/1|time_base=1/1200000|start_pts=0|start_time=0.000000|duration_ts=48000|duration=0.040000|bit_rate=1490800|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=1|nb_read_frames=N/A|nb_read_packets=1|extradata_size=121|extradata_hash=CRC32:bd471302|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|dis position:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=VideoHandler|tag:vendor_id=[0][0][0][0] +format|filename=cbs-hevc-discard-nonkey.mp4|nb_streams=1|nb_programs=0|format_name=mov,mp4,m4a,3gp,3g2,mj2|start_time=0.000000|duration=0.040000|size=8347|bit_rate=1669400|probe_score=100|tag:major_brand=isom|tag:minor_version=512|tag:compatible_brands=isomiso2mp41|tag:encoder=Lavf60.5.100 diff --git a/tests/ref/fate/cbs-hevc-discard-nonref b/tests/ref/fate/cbs-hevc-discard-nonref new file mode 100644 index 0000000000..ce173b4abb --- /dev/null +++ b/tests/ref/fate/cbs-hevc-discard-nonref @@ -0,0 +1,26 @@ +packet|codec_type=video|stream_index=0|pts=-144000|pts_time=-0.120000|dts=-144000|dts_time=-0.120000|duration=48000|duration_time=0.040000|size=7454|pos=44|flags=KD_|data_hash=CRC32:4c4c3bab +packet|codec_type=video|stream_index=0|pts=-96000|pts_time=-0.080000|dts=-96000|dts_time=-0.080000|duration=48000|duration_time=0.040000|size=2622|pos=7498|flags=_D_|data_hash=CRC32:a49f2745 +packet|codec_type=video|stream_index=0|pts=-48000|pts_time=-0.040000|dts=-48000|dts_time=-0.040000|duration=48000|duration_time=0.040000|size=4672|pos=10120|flags=_D_|data_hash=CRC32:37967f67 +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=144000|duration_time=0.120000|size=4624|pos=14792|flags=___|data_hash=CRC32:f2b7eb13 +packet|codec_type=video|stream_index=0|pts=144000|pts_time=0.120000|dts=144000|dts_time=0.120000|duration=144000|duration_time=0.120000|size=4192|pos=19416|flags=___|data_hash=CRC32:6538ec17 +packet|codec_type=video|stream_index=0|pts=288000|pts_time=0.240000|dts=288000|dts_time=0.240000|duration=48000|duration_time=0.040000|size=2521|pos=23608|flags=___|data_hash=CRC32:eb27f045 +packet|codec_type=video|stream_index=0|pts=336000|pts_time=0.280000|dts=336000|dts_time=0.280000|duration=48000|duration_time=0.040000|size=1343|pos=26129|flags=___|data_hash=CRC32:a719dc68 +packet|codec_type=video|stream_index=0|pts=384000|pts_time=0.320000|dts=384000|dts_time=0.320000|duration=144000|duration_time=0.120000|size=952|pos=27472|flags=___|data_hash=CRC32:afeae5db +packet|codec_type=video|stream_index=0|pts=528000|pts_time=0.440000|dts=528000|dts_time=0.440000|duration=144000|duration_time=0.120000|size=760|pos=28424|flags=___|data_hash=CRC32:1eacc92c +packet|codec_type=video|stream_index=0|pts=672000|pts_time=0.560000|dts=672000|dts_time=0.560000|duration=48000|duration_time=0.040000|size=2591|pos=29184|flags=___|data_hash=CRC32:17372325 +packet|codec_type=video|stream_index=0|pts=720000|pts_time=0.600000|dts=720000|dts_time=0.600000|duration=48000|duration_time=0.040000|size=1188|pos=31775|flags=___|data_hash=CRC32:e9ce977b +packet|codec_type=video|stream_index=0|pts=768000|pts_time=0.640000|dts=768000|dts_time=0.640000|duration=144000|duration_time=0.120000|size=794|pos=32963|flags=___|data_hash=CRC32:8d140f74 +packet|codec_type=video|stream_index=0|pts=912000|pts_time=0.760000|dts=912000|dts_time=0.760000|duration=144000|duration_time=0.120000|size=746|pos=33757|flags=___|data_hash=CRC32:3b811942 +packet|codec_type=video|stream_index=0|pts=1056000|pts_time=0.880000|dts=1056000|dts_time=0.880000|duration=48000|duration_time=0.040000|size=2603|pos=34503|flags=___|data_hash=CRC32:a486f249 +packet|codec_type=video|stream_index=0|pts=1104000|pts_time=0.920000|dts=1104000|dts_time=0.920000|duration=48000|duration_time=0.040000|size=1005|pos=37106|flags=___|data_hash=CRC32:27839d4c +packet|codec_type=video|stream_index=0|pts=1152000|pts_time=0.960000|dts=1152000|dts_time=0.960000|duration=144000|duration_time=0.120000|size=459|pos=38111|flags=___|data_hash=CRC32:eb775bfc +packet|codec_type=video|stream_index=0|pts=1296000|pts_time=1.080000|dts=1296000|dts_time=1.080000|duration=144000|duration_time=0.120000|size=502|pos=38570|flags=___|data_hash=CRC32:ea021457 +packet|codec_type=video|stream_index=0|pts=1440000|pts_time=1.200000|dts=1440000|dts_time=1.200000|duration=48000|duration_time=0.040000|size=2734|pos=39072|flags=___|data_hash=CRC32:6999b39c +packet|codec_type=video|stream_index=0|pts=1488000|pts_time=1.240000|dts=1488000|dts_time=1.240000|duration=48000|duration_time=0.040000|size=1246|pos=41806|flags=___|data_hash=CRC32:0f9f3622 +packet|codec_type=video|stream_index=0|pts=1536000|pts_time=1.280000|dts=1536000|dts_time=1.280000|duration=144000|duration_time=0.120000|size=572|pos=43052|flags=___|data_hash=CRC32:7d6d8758 +packet|codec_type=video|stream_index=0|pts=1680000|pts_time=1.400000|dts=1680000|dts_time=1.400000|duration=144000|duration_time=0.120000|size=749|pos=43624|flags=___|data_hash=CRC32:69746ad8 +packet|codec_type=video|stream_index=0|pts=1824000|pts_time=1.520000|dts=1824000|dts_time=1.520000|duration=48000|duration_time=0.040000|size=1483|pos=44373|flags=___|data_hash=CRC32:3e9468fc +packet|codec_type=video|stream_index=0|pts=1872000|pts_time=1.560000|dts=1872000|dts_time=1.560000|duration=144000|duration_time=0.120000|size=638|pos=45856|flags=___|data_hash=CRC32:dc0f1d30 +packet|codec_type=video|stream_index=0|pts=2016000|pts_time=1.680000|dts=2016000|dts_time=1.680000|duration=48000|duration_time=0.040000|size=1070|pos=46494|flags=___|data_hash=CRC32:49a62247 +stream|index=0|codec_name=hevc|profile=2|codec_type=video|codec_tag_string=hev1|codec_tag=0x31766568|width=416|height=240|coded_width=416|coded_height=240|closed_captions=0|film_grain=0|has_b_frames=3|sample_aspect_ratio=N/A|display_aspect_ratio=N/A|pix_fmt=yuv420p10le|level=60|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=unknown|refs=1|id=0x1|r_frame_rate=25/1|avg_frame_rate=300/23|time_base=1/1200000|start_pts=0|start_time=0.000000|duration_ts=2064000|duration=1.720000|bit_rate=206608|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=24|nb_read_frames=N/A|nb_read_packets=24|extradata_size=121|extradata_hash=CRC32:bd471302|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails= 0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=und|tag:handler_name=VideoHandler|tag:vendor_id=[0][0][0][0]