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 696E945C65 for ; Mon, 29 May 2023 12:48:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA5E068BF89; Mon, 29 May 2023 15:48:30 +0300 (EEST) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2234768BF89 for ; Mon, 29 May 2023 15:48:24 +0300 (EEST) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6ad13a1fbceso2443312a34.2 for ; Mon, 29 May 2023 05:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685364502; x=1687956502; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eZcj+AunM0kFSp1YEzbBdrILeS59BfOLKmZsVrN/hoU=; b=n6pZ2cY8fz/BB1pLXxn5iRaTzJNucDXEt0psWV+EYf9VLpXrugrNHOupAVkNf0nOak 2dQFwzWZiYxSEumYGLn23T2X1nKviKFx0ZR+Nu1pryVyPTI03BkFpUtw/7VJpZkmeqgn jp/nFmpRgSx6YxTIVl3gpbDyhWqIp/bkaiCz9cuGd0L7thyuTatkf6SNZoDvQkolAuLj KfkJgX6IfgbSES77X5iw4OqZ8EpYwzx54lQgI9PVMcwRcPAc/MoQ8cRBFyVKMt2bkkpd xT3A6Xa+nzsLkf15fZ/v2BoZkYfcCfH9xVigATUwHBft08ak/zTy9hZN76rJpvSylhrd KrjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685364502; x=1687956502; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eZcj+AunM0kFSp1YEzbBdrILeS59BfOLKmZsVrN/hoU=; b=JHNex4QFu0mV0nRVHskI1dQflXLSYcu33HSZb9oLeT6QCpDPp0bCSyAUA6krJIpPDo Aw0/C/I+csCNLPoVZD6SiZIDKJIGH81hwrhoskfN5C+47KnljJxgt9IEN3kheQBZTrNv XM/5Cgl3vequ10A6UxE+jhYbcjTyl6mr312nw9ejGyXfjIhbkPK+4F+t/u5Jhq00KN4w CN227XyuKXVQcHfLJRR+2z6rDOCR8MvliyOkI+r0wR/eF4nNFiqOVQTRKh06ATexYTtQ 3G02Rrh9Cor+4IjdMA3CZfh+ES40+2n05EctFxQbCxsdAOX991ZiSL2A8hg8lQX9o0Hb ot3w== X-Gm-Message-State: AC+VfDwWnJGhj4gtRZhTQGbBZwcKlK0sHicCnmaXQDiMjmB+/RV1cbVY bfiMN4Wjo88RfdlbAnEu+5K8qS15dpY= X-Google-Smtp-Source: ACHHUZ4ADwprll/ch28BKTaycBlN/tYPjGDJJTfGeHEDkvTP1SyJt+W+5MR65XexHzy6h7WTTIwCJA== X-Received: by 2002:a05:6808:3299:b0:398:59a5:ddf with SMTP id cg25-20020a056808329900b0039859a50ddfmr5227021oib.3.1685364502134; Mon, 29 May 2023 05:48:22 -0700 (PDT) Received: from [192.168.0.12] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id k19-20020a05680808d300b00397fb7fcc31sm4320361oij.45.2023.05.29.05.48.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 May 2023 05:48:21 -0700 (PDT) Message-ID: <5a0636a8-493e-0c0a-1ac8-16d4fc027368@gmail.com> Date: Mon, 29 May 2023 09:48:56 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.1 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230526103100.1879-1-d.kozinski@samsung.com> From: James Almer In-Reply-To: <20230526103100.1879-1-d.kozinski@samsung.com> Subject: Re: [FFmpeg-devel] [PATCH v23 02/10] avcodec/evc_parser: Added parser implementation for EVC format 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 5/26/2023 7:31 AM, Dawid Kozinski wrote: > +static int evc_parse(AVCodecParserContext *s, AVCodecContext *avctx, > + const uint8_t **poutbuf, int *poutbuf_size, > + const uint8_t *buf, int buf_size) > +{ > + int next; > + EVCParserContext *ev = s->priv_data; > + ParseContext *pc = &ev->pc; > + > + if (avctx->extradata && !ev->parsed_extradata) { > + decode_extradata(s, avctx, avctx->extradata, avctx->extradata_size); > + ev->parsed_extradata = 1; > + } > + > + if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) > + next = buf_size; > + else { As the parser no longer has the job to assemble an AU, this code below and evc_find_frame_end() can be removed. And like i said in my last review, you can share the NALU parsing code between this parser and the frame_merge bsf, to reduce code duplication, as they both reside in libavcodec. Simply put it in a new file called for example evc_parse.{c,h}. You can follow he example from h26* parsers, which define and reuse ff_h***_decode_nal_*ps(). > + next = evc_find_frame_end(s, buf, buf_size, avctx); > + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { > + *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".