From patchwork Mon Nov 13 05:13:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natsuki Kai X-Patchwork-Id: 6024 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp1701697jah; Sun, 12 Nov 2017 21:13:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMbAkfaJuGxlrtlPmfTlblujhjEQ3TYogrEPMKmUTH7wGkxfKOeSgZ/ufcFKTqliUenq1IGF X-Received: by 10.223.178.26 with SMTP id u26mr3779351wra.239.1510550006568; Sun, 12 Nov 2017 21:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510550006; cv=none; d=google.com; s=arc-20160816; b=YHLYYAI3cN8+dlBnzKmXNzygftQoCMKOwEyZS0OV2s3C8eICPcyQrDuss+DvY4CLfV 1gHn3g7pt68BxTjncF538o0UrSwHVKW2T9Id0Y7+dF1sdDSvkBLbbcP3qp34tjfyt1H7 zjdkSdKZQJUc/oh8RVbTErI3yDGem3tiHMtakn/d/2LlDfyHZjzui+wwFo8CQ+dUS7vz tPsn+XTWQuLLQYtWugyqqlgGIutyIo0XqMjXjcFEXpOvGYvnclSGcVbkYmzeoeMYFveG uPl2N3PxArG0dFDauiaUztoyl3ipHVlDrjG4/O+rPOsOp1R7TXBE1IQZ5P98X0OTezDc pZmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:to:message-id:date:from:references:in-reply-to :mime-version:dkim-signature:delivered-to:arc-authentication-results; bh=iY8VoS1jWQmju0dEMnWsk3fY7pDqAqYxWRkP9VqzpGI=; b=dG7jsafgVYOnKujM4/oF9ZLWKZxc/dxqova1gNWgtF5y8Oz088VgralI87C+nb/z+8 28/uVy8ctbRf87kgD/AsY0974ur5xWd/SmcPLc/UFFw/JzQONwNe6n2VcZnFFz1lb9jg iHhEXmXRPLqjbN+rE3Aw5QN4wbPA+Jl7VbCd1R3cXvz30pnUcjs3U6/mvM73NTpns2Ir N8lJ+3F6COQEmlxWVh/tgkUyB06OqmBjRLfj2TX9OM7m8q4Fu3LWJ6H9+73mPAo9O7j3 hC1Xa3SciEA7C30p+mm8uwITN9uCmLfj/3BNhKE41Syq87rZffnJjjC6NSw9eGFKkny1 05cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=m34AeDU3; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f50si12591746wrf.249.2017.11.12.21.13.25; Sun, 12 Nov 2017 21:13:26 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=m34AeDU3; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E5C8D68A517; Mon, 13 Nov 2017 07:13:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2118368A512 for ; Mon, 13 Nov 2017 07:13:03 +0200 (EET) Received: by mail-qk0-f173.google.com with SMTP id v137so18338797qkb.1 for ; Sun, 12 Nov 2017 21:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=xnnVnnIEbSgm2jIcGoXSNQxevz8RbcNVuZpcCzwoNSk=; b=m34AeDU3okJS60H+GvDO0C8FWns9UuIxxVsKPIG3IeY7qX3OdjVGe+zQGHKTtocb+O crhvuQ2xadhPokYUHkb67DtjooaRHoj9hgDpvRIj2ylh35J+FWarqIlXTb9IP3pv3Xil RXMgIFspHH8O7D2KqHbeq2D56jZ+xMbs3OBtONrSQ4BH3kYOGuJm/q+ORMnxrb9FmfAP yKlfmZf/vKmcSFPZpBeR9Cf0tpH3S8ZQ0RUOScEcUuScg7hRUB5VObHN1O2KpM55rRsj 4yHyUgxeGcUhBAXR3NCozjT/fuxf+bPS/9KeZ+3ER10Fs/urfocdPdX/RHUoE1X3xYMQ 3RVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=xnnVnnIEbSgm2jIcGoXSNQxevz8RbcNVuZpcCzwoNSk=; b=Xwhd8Vt242Zxn5t5TnpYz47/eIU+7Tj6CwRlnY5ZfbzU395r/dDWET76dSVoOGEZPn Bsun6NbOYnTriwjlrj6OuxeUzoC+rn9c7FV+5yLp7B9QWzzXL8aAqa/96NOEtDnQWxRD B16b16wXzQTH1bp3rwxdOZtPjv6nu8pqZhXqtrKw8AovcwRbAxnq/CegSQj/JtZrz0Uv 7zxfT5zOfChY4HGv79LLjWX1RXT6o03ueAUBBClZiYQioTup1VFGCzSbzmpC6nurGw9L iZ6ioTVKlOMxe9238Q26guHlOZgzyw5gNse2DFd2jcWcF6e020k3+2gRQGzed44yZX3L w9aA== X-Gm-Message-State: AJaThX6M9e0EBPOvtRHs5vFAbZndtUM4tHO2k0ZnSeYx4opILTlGxUG4 PBfomS3Oc3MVqlIl9EEKTnJUibOFbAIkPb7ml2ultmAxheM= X-Received: by 10.55.20.199 with SMTP id 68mr10025842qku.4.1510549996343; Sun, 12 Nov 2017 21:13:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.144.139 with HTTP; Sun, 12 Nov 2017 21:13:15 -0800 (PST) In-Reply-To: <20171112161302.GS6009@nb4> References: <20171112161302.GS6009@nb4> From: Natsuki Kai Date: Mon, 13 Nov 2017 14:13:15 +0900 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] avcodec/qsvenc Question for Intel QSV low latency X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Oh sorry, I don't understand how to do well yet... I'll try again. Thank you guys. if (!q->async_fifo) return AVERROR(ENOMEM); On Mon, Nov 13, 2017 at 1:13 AM, Michael Niedermayer wrote: > On Sun, Nov 12, 2017 at 11:40:57AM +0900, Natsuki Kai wrote: > > Hello guys, > > > > this is my first posting to ffmpeg-devel, and I believe my mail format is > > correct. > > > > I'm using ffmpeg for encoding video in real-time, so low encode delay is > > needed. > > Once I call "avcodec_send_frame(avctx, frame)", I'd like to get the > encoded > > data from "avcodec_receive_packet(avctx, avpkt)". > > > > However I cannot do that in ffmpeg and Intel QSV (qsv), > > "avcodec_receive_packet()" returns nothing when I input the first frame > to > > qsv encoder by calling "avcodec_send_frame()". > > Of cource, after second frame inputs, qsv encoder returns valid data. > > I'd like to get a valid data from first calling. > > > > I've tried some cases and as a result, my requirement is satisfied when > > avcodec/qsvenc.c will be fixed like below diff info. > > Then I have a question. > > Why q->async_fifo is set to be q->async_depth "+ 1"? > > Anybody knows? > > > > --- a/avcodec/qsvenc.c > > +++ b/avcodec/qsvenc.c > > @@ -803,7 +803,7 @@ > > > > q->param.AsyncDepth = q->async_depth; > > > > - q->async_fifo = av_fifo_alloc((1 + q->async_depth) * > > + q->async_fifo = av_fifo_alloc((q->async_depth) * > > (sizeof(AVPacket) + > > sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*))); > > if (!q->async_fifo) > > return AVERROR(ENOMEM); > > This looks corrupted by a newline > > Applying: avcodec/qsvenc Question for Intel QSV low latency > error: corrupt patch at line 10 > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Those who are best at talking, realize last or never when they are wrong. > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 2bc19f5241..7d73c64dca 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -803,7 +803,7 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q) q->param.AsyncDepth = q->async_depth; - q->async_fifo = av_fifo_alloc((1 + q->async_depth) * + q->async_fifo = av_fifo_alloc((q->async_depth) * (sizeof(AVPacket) + sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*)));