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 56F9A44999 for ; Mon, 31 Oct 2022 10:16:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F1B4D68BDDD; Mon, 31 Oct 2022 12:16:40 +0200 (EET) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 70CEC68BD94 for ; Mon, 31 Oct 2022 12:16:35 +0200 (EET) Received: by mail-pj1-f42.google.com with SMTP id r61-20020a17090a43c300b00212f4e9cccdso15425749pjg.5 for ; Mon, 31 Oct 2022 03:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spin-digital-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=fkXpDmB7gnVg/LeMmXj2crK8LhIsJKhBI+gDc4PdbEg=; b=6G6sLckQ9J75PwKgz8C6SgJFJ6vR46zi0cCNUvgLPJiEw4KCSj4s8niBb1Pn7nBWT9 8DMTGvkU/+Uu2007/JVfZuvZkNOJ5wUdnvB2c1BNJUcCYn34KVmVcrDkiLBRlhxUY+1r n1dG50KdkSJBXsdY/J+sgLgjYOop/w6NevuEF+4UCLWHW6xcCy81ARp4NuZtt+u4L9vh vRtEaOcSLqv+FZrwT6jjEz0io+rlWbsG3ihvaun9kPZRd+on7DD9aZlzQdbvNoUNOF0u ZPvQk6djlLR83NZUCVmJNIF/r7T9WAHVc7jOUYq6PeyCOEAv9YjGZG+tMQiJQABYKwF+ eLhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fkXpDmB7gnVg/LeMmXj2crK8LhIsJKhBI+gDc4PdbEg=; b=AOnKUn19i9a0/LbAz0yzZbgIy3Acru5/rFaqg2saa2KwQ3e4oqLxNe/NFRJ4rYAyg6 jvzjeNezM6nhD3yZAZv06JSsxyk5J1h+I0xV5jw0Z8rln2RAAbk0DmVNQLi6Z7IqLHKi WURef3g3z1a+FLvG9hzyI0OkVjXMYOBKJ/Ma4WbG0mH0sry5HxOG/XdvV2bAX3Z7KoWS WohVVDKbALwots4VftEQ1W+4Lwq4ZI1BvUjY8nKsXwWVFW7t63b2RmOMYMvACzxwz/qY gCWodT4arGcnyNaaiIW8x9f0QF3lnj+OfcMS2rHdNYFkYOsbMBkCrATP47HkkIwwQp6p UFbw== X-Gm-Message-State: ACrzQf1FWN+bH+cD8CvIzzLYNRCI0Uualm0tY/R8mtvTYhcsWYlUmpBB Y1T3i+/FLI/MReAmDjd6JbGtYlR5zrvQeIORwCWixf/yYMn0kw== X-Google-Smtp-Source: AMsMyM7sR+yJ/KhrD8z9a1QM081g3JOxmlS5uh4GY6NkuHrr01Ke1aH4yQmjU8dSU/YqaDC6d0sJ8AybTTfLb+hSPqA= X-Received: by 2002:a17:902:e493:b0:186:9de4:a7cd with SMTP id i19-20020a170902e49300b001869de4a7cdmr13572913ple.66.1667211393124; Mon, 31 Oct 2022 03:16:33 -0700 (PDT) MIME-Version: 1.0 References: <20221024140645.4945-1-thomas.ff@spin-digital.com> <20221024140645.4945-4-thomas.ff@spin-digital.com> <621697ae-1c24-811d-c2e9-6c044699f37f@gmail.com> In-Reply-To: <621697ae-1c24-811d-c2e9-6c044699f37f@gmail.com> From: Thomas Siedel Date: Mon, 31 Oct 2022 11:16:20 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH v2 03/10] avcodec: add bitstream parser for H266/VVC 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="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 24 Oct 2022 at 16:38, James Almer wrote: > On 10/24/2022 11:06 AM, Thomas Siedel wrote: > > +static int combine_au(AVCodecParserContext *ctx, AVCodecContext *avctx, > > + const uint8_t **buf, int *buf_size) > > +{ > > This is being called only when you first assembled AUs from what's > assumed to be raw input. When PARSER_FLAG_COMPLETE_FRAMES is set, it > should also parse the AU for bitstream information. > Yes, currently, "combine_au" is only called when PARSER_FLAG_COMPLETE_FRAMES is disabled, but I do not really understand what the issue is here. As far as I know, all bitstream information is parsed properly for any kind of supported content (currently, ES, MP4, and TS are supported). Would you happen to have an example of a use case where PARSER_FLAG_COMPLETE_FRAMES is enabled, and the bitstream information is needed or not parsed correctly from the current implementation? The current behavior is pretty similar to other codec parser implementations like hevc, avc, and av1. Why should the vvc parser code differ from the (default) behavior of other codecs? > > + VVCParserContext *s = ctx->priv_data; > > + CodedBitstreamFragment *pu = &s->picture_unit; > > + int ret; > > + > > + s->cbc->log_ctx = avctx; > > + > > + if (avctx->extradata_size && !s->parsed_extradata) { > > + s->parsed_extradata = 1; > > + > > + if ((ret = ff_cbs_read(s->cbc, pu, avctx->extradata, > avctx->extradata_size)) < 0) > > ff_cbs_read_extradata_from_codec() > > > + av_log(avctx, AV_LOG_WARNING, "Failed to parse > extradata.\n"); > > + > > + ff_cbs_fragment_reset(pu); > > + } > > + av_packet_unref(&s->last_au); > > + ret = parse_nal_units(ctx, *buf, *buf_size, avctx); > > + if (ret == 0) { > > + if (s->last_au.size) { > > + *buf = s->last_au.data; > > + *buf_size = s->last_au.size; > > + } else { > > + //no output > > + ret = 1; > > + } > > + } > > + s->cbc->log_ctx = NULL; > > + return ret; > > +} > > + > > +static int vvc_parser_parse(AVCodecParserContext *ctx, AVCodecContext > *avctx, > > + const uint8_t **poutbuf, int *poutbuf_size, > > + const uint8_t *buf, int buf_size) > > +{ > > + int next; > > + VVCParserContext *s = ctx->priv_data; > > + ParseContext *pc = &s->pc; > > + > > + if (avctx->extradata && !s->parsed_extradata) { > > + av_log(avctx, AV_LOG_INFO, "extra data is not supported > yet.\n"); > > + return AVERROR_PATCHWELCOME; > > + } > > + > > + if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) { > > + next = buf_size; > > + } else { > > + int ret, flush = !buf_size; > > + next = find_frame_end(ctx, buf, buf_size); > > + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) > > + goto no_out; > > + ret = combine_au(ctx, avctx, &buf, &buf_size); > > + if (ret > 0 && flush) { > > + buf_size = 0; > > + ret = combine_au(ctx, avctx, &buf, &buf_size); > > + } > > + if (ret != 0) { > > + buf_size = next; > > + goto no_out; > > + } > > + } > > + *poutbuf = buf; > > + *poutbuf_size = buf_size; > > + return next; > > +no_out: > > + *poutbuf = NULL; > > + *poutbuf_size = 0; > > + return buf_size; > > +} > _______________________________________________ > 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". > _______________________________________________ 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".