From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 07F8245D4A for ; Wed, 7 Jun 2023 13:36:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F077568BEB7; Wed, 7 Jun 2023 16:36:20 +0300 (EEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9A40B68AAB6 for ; Wed, 7 Jun 2023 16:36:14 +0300 (EEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230607133611euoutp015d92d22d89b99c1d7abf0db74e3e9a21~mY_rxbxJY0129501295euoutp01p for ; Wed, 7 Jun 2023 13:36:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230607133611euoutp015d92d22d89b99c1d7abf0db74e3e9a21~mY_rxbxJY0129501295euoutp01p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1686144971; bh=tPTfcolSGhH9lQQfhc2FHOFjKKIK5/gjwZAxvTPNwuQ=; h=From:To:In-Reply-To:Subject:Date:References:From; b=ogshD6b9i3BEhm+H+s5lXHOftXpvGVbl5WlFSvob9+j1HCCy5jdBMDBvrZF1VBcNQ O/9jRCQl9mcFQ9tOgYzhLXUU1E6uisBByyKiT/LkcsnNMku1SpWLT7QyoSVOyI/Rl4 nuTTJbqnp1r7Ojx39V5R/cVOwj9y2N9RhwJXOXco= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230607133611eucas1p155902f111a1c2b2571ddf3a835113442~mY_rrzwgo1658116581eucas1p1V for ; Wed, 7 Jun 2023 13:36:11 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 54.B9.11320.AC780846; Wed, 7 Jun 2023 14:36:11 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230607133610eucas1p25d68aaf2f8853a8181610b39c0be2d5f~mY_rYmM7P2754427544eucas1p2M for ; Wed, 7 Jun 2023 13:36:10 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230607133610eusmtrp1524c2cbe88873c57a119063239bb3af0~mY_rYGRB52611826118eusmtrp1O for ; Wed, 7 Jun 2023 13:36:10 +0000 (GMT) X-AuditID: cbfec7f4-993ff70000022c38-8d-648087ca503b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A9.AB.10549.AC780846; Wed, 7 Jun 2023 14:36:10 +0100 (BST) Received: from AMDN5164 (unknown [106.210.132.171]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230607133610eusmtip1876b6b41c630e5e42bebf4381d22bba3~mY_rJSz3-1346213462eusmtip1M for ; Wed, 7 Jun 2023 13:36:10 +0000 (GMT) From: "Dawid Kozinski/Multimedia \(PLT\) /SRPOL/Staff Engineer/Samsung Electronics" To: "'FFmpeg development discussions and patches'" In-Reply-To: <60cedee7-fe0e-8764-42d5-241875adaab5@gmail.com> Date: Wed, 7 Jun 2023 15:36:10 +0200 Message-ID: <007601d99945$05594570$100bd050$@samsung.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIIelptq0D17biTn6AgVzFIzVRndQFTPE9cAhgi0nivBjoNcA== Content-Language: pl X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJIsWRmVeSWpSXmKPExsWy7djPc7qn2xtSDKZdYbb49ukMswOjx59F m1kCGK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LYz0DC0t9IxMLPUMjc1jrYxMlfTtbFJSczLLUov07RL0 Mnp2X2AraFavuL32FmsD4zTZLkZODgkBE4kzB68wdzFycQgJLGWUWPK1mxEiISWxdOkiKFtY 4s+1LjaIohYmiSUbX7OAJNgEciTWzp7IBGKLCPhIdK9fzwpRtJdRYsH23WAJTgFbiU/TtjOD 2MICxRJ/b/Wzg9gsAioSlxbtBLN5BSwlLt5YzwxhC0qcnPkEbAGzgIHEkoW/mCBsbYllC18z Q1ykIPHz6TKgZRxAi50klh1WgCgRkbjxqIVxAqPQLCSTZiGZNAvJpFlIWhYwsqxiFEktLc5N zy021CtOzC0uzUvXS87P3cQIjIltx35u3sE479VHvUOMTByMhxglOJiVRHiz7OtThHhTEiur Uovy44tKc1KLDzGaAr02kVlKNDkfGJV5JfGGZgamhiZmlgamlmbGSuK8ngUdiUIC6Yklqdmp qQWpRTB9TBycUg1MU2tz6720RZ9KuAmv8w9XK2USmLPlzDGubRLyhqesnJbIhL27HChlmsRq 3bJtl3T/DZ/yLTf3sW1yM1zO3b9Zd8uHEsmrAVUWYmEfG/76/93N4jLn+VHvshefNytdNOIt 2d7WvzPVUUFR+yrn0QuO1U+sr4Qws/Z8ljvyW/Iix0vRJ66t3m15ocfVZDOkUoy2CDD1VjM9 aVzeo2lvc2HJ0/s3wx7pd8Vey+SzbJm7yXfi6Z1meVMZOx87hktMsQneuWtzzqUE+UK5C+x5 Ag48ly9qX6strJZXnt1gYcost/P5Q+X5N3mYqo31VVUMbuennQz2dmf89WNS+eKFkv6+rN++ 908yWlvO5s1cr8RSnJFoqMVcVJwIAGGXc4oSAwAA X-CMS-MailID: 20230607133610eucas1p25d68aaf2f8853a8181610b39c0be2d5f X-Msg-Generator: CA X-RootMTR: 20230526103158eucas1p1e8b2adfc43aaf57c62e23e78571df817 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230526103158eucas1p1e8b2adfc43aaf57c62e23e78571df817 References: <20230526103145.1277-1-d.kozinski@samsung.com> <60cedee7-fe0e-8764-42d5-241875adaab5@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH v23 04/10] avformat/evc_demuxer: Added demuxer to handle reading EVC video files X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > -----Original Message----- > From: ffmpeg-devel On Behalf Of James > Almer > Sent: poniedzia=B3ek, 29 maja 2023 15:08 > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH v23 04/10] avformat/evc_demuxer: Added > demuxer to handle reading EVC video files > = > On 5/26/2023 7:31 AM, Dawid Kozinski wrote: > > +static int get_temporal_id(const uint8_t *bits, int bits_size) { > > + int temporal_id =3D 0; > > + short t =3D 0; > > + > > + if (bits_size >=3D EVC_NALU_HEADER_SIZE) { > > + unsigned char *p =3D (unsigned char *)bits; > > + // forbidden_zero_bit > > + if ((p[0] & 0x80) !=3D 0) > > + return -1; > > + > > + for (int i =3D 0; i < EVC_NALU_HEADER_SIZE; i++) > > + t =3D (t << 8) | p[i]; > = > I think this can be replaced with AV_RB16. > = > > + > > + temporal_id =3D (t >> 6) & 0x0007; > > + } > > + > > + return temporal_id; > > +} > = > [...] > = > > +static uint32_t read_nal_unit_length(const uint8_t *bits, int > > +bits_size) { > > + uint32_t nalu_len =3D 0; > > + > > + if (bits_size >=3D EVC_NALU_LENGTH_PREFIX_SIZE) { > > + > > + int t =3D 0; > > + unsigned char *p =3D (unsigned char *)bits; > > + > > + for (int i =3D 0; i < EVC_NALU_LENGTH_PREFIX_SIZE; i++) > > + t =3D (t << 8) | p[i]; > = > AV_RB32. > = > > + > > + nalu_len =3D t; > > + if (nalu_len =3D=3D 0) // Invalid bitstream size > > + return 0; > > + } > > + > > + return nalu_len; > > +} > = > [...] > = > > +static int evc_frame_merge_filter(AVBSFContext *bsf, AVPacket *out) { > > + EVCMergeContext *ctx =3D bsf->priv_data; > > + AVPacket *in =3D ctx->in; > > + > > + int free_space =3D 0; > > + size_t nalu_size =3D 0; > > + uint8_t *nalu =3D NULL; > > + int au_end_found =3D 0; > > + int err; > > + > > + err =3D ff_bsf_get_packet_ref(bsf, in); > > + if (err < 0) > > + return err; > > + > > + nalu_size =3D read_nal_unit_length(in->data, > EVC_NALU_LENGTH_PREFIX_SIZE); > > + if(nalu_size <=3D 0) { > > + av_packet_unref(in); > > + return AVERROR_INVALIDDATA; > > + } > > + > > + nalu =3D in->data + EVC_NALU_LENGTH_PREFIX_SIZE; > > + nalu_size =3D in->size - EVC_NALU_LENGTH_PREFIX_SIZE; > > + > > + // NAL unit parsing needed to determine if end of AU was found > > + err =3D parse_nal_unit(nalu, nalu_size, bsf); > > + if (err < 0) { > > + av_log(bsf, AV_LOG_ERROR, "NAL Unit parsing error\n"); > > + av_packet_unref(in); > > + > > + return err; > > + } > > + > > + au_end_found =3D end_of_access_unit_found(bsf); > > + > > + free_space =3D ctx->au_buffer.capacity - ctx->au_buffer.data_size; > > + while( free_space < in->size ) { > > + ctx->au_buffer.capacity *=3D 2; > > + free_space =3D ctx->au_buffer.capacity - > > + ctx->au_buffer.data_size; > > + > > + if(free_space >=3D in->size) { > > + ctx->au_buffer.data =3D av_realloc(ctx->au_buffer.data, ct= x- > >au_buffer.capacity); > > + } > > + } > > + > > + memcpy(ctx->au_buffer.data + ctx->au_buffer.data_size, in->data, > > + in->size); > = > This is including the Annex-B's nal_unit_lenght value into the assembled packet. I > assume libxevd expects this? Also, is it defined as part of the ISOBMFF > encapsulation? Patch 07/10 does not seem to strip it. Could you expand on this topic? What do you mean by "Patch 07/10 does not seem to strip it"? Patch 7/10 expands the implementation of the MOV Muxer to support the EVC stream. The function ff_isom_write_evcc parses the received data, extracts NAL units of types SPS, PPS, APS, SEI, and inserts their contents into the corresponding elements of the arrays array, which is a component of the EVCDecoderConfigurationRecord structure. Additionally, the ff_isom_write_evcc function populates the relevant fields of the EVCDecoderConfigurationRecord structure based on the parsed SPS NAL unit data, and then calls the evcc_write function, which writes the EVCDecoderConfigurationRecord to the stream. It seems that I don't understand what's wrong with our implementation ( I mean MOV muxer for EVC) and it seems I need your help in this matter. I need an explanation of what's wrong and what should be done to fix the issue. > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://protect2.fireeye.com/v1/url?k=3Dd9b5596c-b83e4c5f-d9b4d223- > 000babff9bb7-060f807600ae9b45&q=3D1&e=3D9deb391f-9dfe-412c-b7d8- > 09a65325c2ec&u=3Dhttps%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmp > eg-devel > = > To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org > with subject "unsubscribe". _______________________________________________ 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".