From patchwork Tue May 3 14:49:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Liu X-Patchwork-Id: 9004491 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 115A79F1D3 for ; Tue, 3 May 2016 14:49:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 154D9202C8 for ; Tue, 3 May 2016 14:49:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 67CA62028D for ; Tue, 3 May 2016 14:49:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 045036E8BA; Tue, 3 May 2016 14:49:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0056.outbound.protection.outlook.com [65.55.169.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26FA96E8B1; Tue, 3 May 2016 14:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QQGrDUqoLf/+ScAEzttNdyeTgjtqd2qkv0sJEvMdQf8=; b=jVJLyD9UhX3EBxCrsw9Gc4x4Jl0eY4PFWv5hDrOOO+cXj/MaUAS2WSHpfFGrDqky9jn/Y6QGPuvndN/zRaIGmJenrBZrMbOuMx9FZlKsmi7l/FkfbRLrV+4kGyQ0atXNrwLo+dDtCUzFEyA+c9hjG0TN9XAXyd+AXnXuVu2kKhc= Received: from SN1PR12CA0007.namprd12.prod.outlook.com (10.162.96.145) by BN4PR12MB0850.namprd12.prod.outlook.com (10.164.59.12) with Microsoft SMTP Server (TLS) id 15.1.485.9; Tue, 3 May 2016 14:49:47 +0000 Received: from CO1NAM03FT013.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::206) by SN1PR12CA0007.outlook.office365.com (2a01:111:e400:5174::17) with Microsoft SMTP Server (TLS) id 15.1.485.9 via Frontend Transport; Tue, 3 May 2016 14:49:47 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.22) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.22) by CO1NAM03FT013.mail.protection.outlook.com (10.152.80.120) with Microsoft SMTP Server (TLS) id 15.1.485.4 via Frontend Transport; Tue, 3 May 2016 14:49:46 +0000 Received: from SATLEXDAG05.amd.com (10.181.40.11) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 3 May 2016 09:49:35 -0500 Received: from STOREXDAG02.amd.com (10.1.13.11) by satlexdag05.amd.com (10.181.40.11) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 3 May 2016 10:49:35 -0400 Received: from ubuntu-desktop.amd.com (172.27.226.25) by storexdag02.amd.com (10.1.13.11) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 3 May 2016 10:49:33 -0400 From: Leo Liu To: Subject: [PATCH] st/omx/enc: fix incorrect reference picture order for B frames Date: Tue, 3 May 2016 10:49:20 -0400 Message-ID: <1462286960-3541-1-git-send-email-leo.liu@amd.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [172.27.226.25] X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.22; IPV:CAL; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(189002)(199003)(53416004)(92566002)(77096005)(50466002)(48376002)(450100001)(87936001)(586003)(105586002)(47776003)(19580405001)(6806005)(19580395003)(2351001)(229853001)(5008740100001)(189998001)(33646002)(106466001)(11100500001)(110136002)(5003600100002)(6116002)(3846002)(50986999)(101416001)(1220700001)(50226002)(4326007)(36756003)(5003940100001)(8936002)(86362001)(5004730100002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0850; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-MS-Office365-Filtering-Correlation-Id: 6b3d7813-3d25-4e22-124c-08d373622bc7 X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0850; 2:fCgYqMeFTMPBHYwuoQQWsh6rYt03Jp6yTF1S/g4hU+y1U4ETy1AoIfH6Zy97oWFzpHggTkP48S/neQWGoggI6pgotlzm6ME2YdK0rTSRMIV9OAgEO3AilcgY71dXYwdjxTL2YCLaP6fhI7N+AJONxQVmES+f4K0lCbt8qbYKum3GdYJY6+YXnOh/8ixCGS68; 3:USkwxaVoMjKO8ucI2NQ8Gt9ij2ZoFn6L2dc5WRuLTAc4mVsvoHhHeIArFdlv8CfC6gXxHuY4hGi+x0n2yC6Rf+vVnwMxoUkLqF5RbLdLrrQRwR/woDzLj6cxffC917sNm9pqyq68VjoWhPHMt9ADgZHJyOHVZfu98t/hZiCfisqVolGv5y0inTnqUSE1MO+6a0aQXsKpFb7bvdRSp59rtM73cwd2ErVf3q+GU3CACKs=; 25:dHtKeBShU4ij6S4bqES1UgwnQ4kT+qTqDQBjzOQM8fZPguxhhldmFtls5B9tCuCBGrz9wt49XWU8URYMCqvqvcFnkVvR8Gtq2d6VENNkTQSr3vPwvbU1TwYoCKKVenC262bymaK1Ldf5j/a5nQciOAQtUJYRhk1XemKLeY62pILGDCh7nSqg809fpwQjLvZbUbz1jszv8KY+SNO0km779mTehWuEnBJ769ZyeIDNlXt4jK9PGu49XDCTienkjflf6DwF5Uhh83C6HKRlzOJEyu6gjg+aMcfYOJ9V4iAh2g0CZzhaCAxNN24NeXQemnOoOEdg8ZK6DtKrl1WcEUhsuOeU5henzoWnwwBqjJQkwRSgOB/ar+a4ECq5dn+WaWWf6sIWy388GFRqWsLV178JRVbnIiwNEOD5AonEKROSFuqZw2oXG0MZw2fxkEYrv53p X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN4PR12MB0850; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0850; 20:P5envREOlu2/HnGDIabl7xqByNX2MesgNL+Hlf6iAAfytSctLnz83xLjNQnzcxc0zKCSeVvSwxls7MhLNG0MMSe+s52zstOIYvwTijZ0iWIJxyoOUVy8kg+deNU7O8Uikhhd6CoidkJRsAaQpU0oVQvi6YoljSVLRTaOz2PSDcw1T0vCiPuxcAp+To4GceOd+DJhJuWUvXDLIGm6xAiwS8s0UVcn7x55RhzfmNbfFcDf+3FFVjry94obsLp5zjvYHkdYcRbDXnYOrQf3eX4N31lBOQVp4CtYl7qxNLCZf9omFeEmiHFV9tGlRclqa63rCvU/SOyL4u/tAM/jDwm99u6EvOsFJ4o+a6bVuLzJb0Vuuj17zDC4ZSAaOE53x/yWtdFPHdOVPVjnZmrdlMI4pE9F7slwVwUPdPJJsuSCknT8SKX2JIdJsQO09u3MtNHnLhBV4XnWbbWGnMH7K/WLAkj6WB8tiMI7GgJBP+ZJPikk14Zictdhtz/gZ4s30JW4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(9101521096)(601004)(2401047)(13021025)(13013025)(13023025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BN4PR12MB0850; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0850; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0850; 4:OvIqhqK0beXuoR8XnA2v0HN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ose7FaaRFFjj+PSBllqYY8FhmfQBbCT+uububho0aSnAkdhP0WrdNM5RojQ3NuGW9m3HcPh1FX/N7h+GxzzrQ3WdleaGTa6LHq+JveIgXjfVC9h/pUIT2/0GVH25lhpDxOpPCDn8eTOGUqLNdnpdUvKfANboLM+0; 20:bWcwwjICko0aHHqCuBLfsWc7KJ3QS80j+RRcnJ1TFGjX8tMaHCAEgzqbyhJ2zDR7y63u5iXoCuN0DngAXLShfX+8zrQW6m6EBKYOoYn8oAzv7VGrcGDLVtsuHc7GpsEV4J7mwifGc0GvL/KfQlCHF7CxTuUrfBZ7xrqz31E6nswMWVRev7mHbh0RB7ewSY1VJheSs9Uek3n1il54nNQzhesW1lH2Ch1ERdWCPEEcYAtcqyUTQ2s8Aq0LFll8OHIA SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2016 14:49:46.5796 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.22]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0850 Cc: "11.1 11.2" , Leo Liu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Stacking frames is for driver that's capable to do dual instances encoding. Such feature is not enabled for B frames currently. Signed-off-by: Leo Liu Cc: "11.1 11.2" --- src/gallium/state_trackers/omx/vid_enc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c index 5565241..d70439a 100644 --- a/src/gallium/state_trackers/omx/vid_enc.c +++ b/src/gallium/state_trackers/omx/vid_enc.c @@ -180,11 +180,6 @@ static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam PIPE_VIDEO_ENTRYPOINT_ENCODE, PIPE_VIDEO_CAP_SUPPORTED)) return OMX_ErrorBadParameter; - priv->stacked_frames_num = screen->get_video_param(screen, - PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH, - PIPE_VIDEO_ENTRYPOINT_ENCODE, - PIPE_VIDEO_CAP_STACKED_FRAMES); - priv->s_pipe = screen->context_create(screen, priv->screen, 0); if (!priv->s_pipe) return OMX_ErrorInsufficientResources; @@ -699,9 +694,19 @@ static OMX_ERRORTYPE vid_enc_MessageHandler(OMX_COMPONENTTYPE* comp, internalReq priv->scale.xWidth : port->sPortParam.format.video.nFrameWidth; templat.height = priv->scale_buffer[priv->current_scale_buffer] ? priv->scale.xHeight : port->sPortParam.format.video.nFrameHeight; - templat.max_references = (templat.profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE) ? - 1 : OMX_VID_ENC_P_PERIOD_DEFAULT; + if (templat.profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE) { + struct pipe_screen *screen = priv->screen->pscreen; + templat.max_references = 1; + priv->stacked_frames_num = + screen->get_video_param(screen, + PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH, + PIPE_VIDEO_ENTRYPOINT_ENCODE, + PIPE_VIDEO_CAP_STACKED_FRAMES); + } else { + templat.max_references = OMX_VID_ENC_P_PERIOD_DEFAULT; + priv->stacked_frames_num = 1; + } priv->codec = priv->s_pipe->create_video_codec(priv->s_pipe, &templat); } else if ((msg->messageParam == OMX_StateLoaded) && (priv->state == OMX_StateIdle)) {