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 0DC4244DB3 for ; Sat, 24 Dec 2022 16:27:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6583F68BBB6; Sat, 24 Dec 2022 18:27:25 +0200 (EET) Received: from out203-205-221-221.mail.qq.com (out203-205-221-221.mail.qq.com [203.205.221.221]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B308B68B75F for ; Sat, 24 Dec 2022 18:27:18 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1671899234; bh=ucgcUYh0nYqWp1lQT5IUY1ppcmlqn/tO0Fa3FeL5/+o=; h=From:To:Subject:Date; b=in5fN0rbIb+gX+Qt22yRvSVdKHpPerXm/aZn4lM6X1gZBorItFwDtJqhM1hxnk2Ml 2dkgtQQFE5zOkLpQhko5URjwTvmdEl6l6uhruKCmFyfIGOcA6Osld/cJpstGeICWBO Tj3H7DboFZhl7w6KcD91TsPZM84pTIBUC7L+Adj8= X-QQ-FEAT: oHWrrGTW1dBwvVdUlwvZlS1TuiZ8KxiI X-QQ-SSF: 00000000000000F0000000000000 X-QQ-XMAILINFO: M+FIA52Od6KgAR/69h8xa+fSLnvHo2nB6WY1XL1nmJ3fjLb6IthQ4u281mzj25 rL3ClNpw+/lQShQjrenAEhIJX9rLstlpGqqjoZMPFBcwKPAPOMOyW1tla3Z0dvG64VYkO1wE27+B2 Boazmzp5JizB2v4lEY0KLZn2dv1Tl044Hk/mds2VJ1Vok/QpXilsu4iRnS1FO6+n7DnjhbG2N4us2 kkP6VACRSjnCmtvflxKobsoKvRhI41mJ7FGljrqXcrFeQngpuCGKvAKJ33eDfcAxRx2M8DAsZyrEV cerkxW1XHsd4czqgiUj6insgRGEPsLyJ9Vr63oMY4ylDsYX1LQMLzkAs9+KN6CAAFIeZFpwdQHuAU WYtR6njCgHCRxl7YOTmISMSHnerzxvdR8zDrqSbOb9otu0Rcvm1yX1a2JzzHoqG2Dt9pRt5EGJt+r v2OVlosxcQh2bGsMub7qKfya913RJvcQI1PtY7nutCNNiACWbNQbQ0FzmQktmFrOxlijQ5oWC2BtC hXOp0ItDVbIPg3PM7INyxmkWXcYwxGHAhOW03pK8ndGZISmtTl/6d6R/Gtw1gaQSjklpCh4G2gsTR pVDSIgNM2l78SbmtSo8ID3iaeFsfU6YTkPEOd0Qr1/3x9TJ0JbVlN9Tb+W2cE/e3oo2SZqRnkJ/oS oF2Z7UVXDk5a1wKeeD+vNY5xL8zFFq3/VvjF1+bPbOE3onh3XRBAJFhUDPw6Wt1Qp7ubbI/k3SXSN ickvE7+P1bl9SVx7p8/qGJn1WHlhkmfOaXRvrwKfQ4srO4A9q1cDibczLN3mHmwos8N7YG+0uFd7Z 4WJJqM6khpAu14i+L03RIUZKrlMOwG3zRJuwr55GSLS+MKebksFCglTPXKB1tyE/x4TWTfqCTfk6T pbotvsZLsLr9j9v4XKM1hOg7Sz0aqXQIR+YRiXUn4j4HLwL0p+k4W8WHWu4TRObyzKmIeoYZ04= X-HAS-ATTACH: no X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 194.233.53.38 X-QQ-STYLE: X-QQ-mid: webmail739t1671899233t1785933 From: "=?ISO-8859-1?B?U2Nod2FyemVy?=" To: "=?ISO-8859-1?B?ZmZtcGVnLWRldmVs?=" Mime-Version: 1.0 Date: Sun, 25 Dec 2022 00:27:13 +0800 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [AMD-AMF] What does these code in amfenc.c actually mean? 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: I'm using h264_amf in my project, and want to use D3D11 pixel format to encode video in D3D11Texture2D to elinimate copy between GPU and CPU. I found the performance is very poor, comparing to obs-project which also use AMF as an encoder. After comparing and debugging through codes, I found these code strange and seems does nothing useful to encoding job: In branch 5.1.2 amfenc.c Line 659 if (hw_surface) { AMFBuffer *frame_ref_storage_buffer; // input HW surfaces can be vertically aligned by 16; tell AMF the real size surface->pVtbl->SetCrop(surface, 0, 0, frame->width, frame->height); frame_ref_storage_buffer = amf_create_buffer_with_frame_ref(frame, ctx->context); AMF_RETURN_IF_FALSE(ctx, frame_ref_storage_buffer != NULL, AVERROR(ENOMEM), "create_buffer_with_frame_ref() returned NULL\n"); res = amf_set_property_buffer(surface, L"av_frame_ref", frame_ref_storage_buffer); AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "SetProperty failed for \"av_frame_ref\" with error %d\n", res); ctx->hwsurfaces_in_queue++; frame_ref_storage_buffer->pVtbl->Release(frame_ref_storage_buffer); } Line 707 buffer->pVtbl->Release(buffer); if (data->pVtbl->HasProperty(data, L"av_frame_ref")) { AMFBuffer *frame_ref_storage_buffer; res = amf_get_property_buffer(data, L"av_frame_ref", &frame_ref_storage_buffer); AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "GetProperty failed for \"av_frame_ref\" with error %d\n", res); amf_release_buffer_with_frame_ref(frame_ref_storage_buffer); ctx->hwsurfaces_in_queue--; } data->pVtbl->Release(data); Schwarzer cnschwarzer@qq.com   _______________________________________________ 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".