Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1265014pxb; Fri, 1 Apr 2022 08:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqWbckDPYhtgy3f/I9oHR+e1anPDL5OZrchq3Oz7KZlW2SQ81XM4pJi37jwRRYUEwH3Htj X-Received: by 2002:a17:902:d346:b0:156:13b1:3bc3 with SMTP id l6-20020a170902d34600b0015613b13bc3mr11305779plk.25.1648827920515; Fri, 01 Apr 2022 08:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648827920; cv=none; d=google.com; s=arc-20160816; b=zODBEMdr6JtTbB4gLgQjWMxHre6JQtcy2SEcwftTlo7+0Kzlxpqg9dlTmApHFHFJR6 8+FEQTbCcv/oBPsiRXlYotLO09xekeps1Lx9cCzRcPf8fABPoapD4FzxXLku49Zb9ncG FlbPly71UUH3ZYTei7pXQqGQs3ccERveijeqYXQ7gCO7P2cfxtrQXmZgoY8oB7AAo4vO UakqN0uJD9APE/EToLmZA7NK5THPPNKAE3zsCcuHbNcZtf/PadFDN/vlPkg02BCk0lsR v+WbE0kcNEi17swv14XVWoIvgRlH1rEc22y23ufW3J9xTPhHxwP9SgW9ODU+oXt7+QhI lOaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z+9BvggZESyqPk3VCR9JjAd4xv+A08TuiKogcKcr6ug=; b=cyGUBBdKo0sw0x+MttK1bMNoiIm3XBCd7/2vMwPHYcLsmYZoh8UIuQohggr86MMCGi gGO1B8jmkwfQfJ6VYRnFxbEiRFaXkG8Yq0UOxFV5rJZX0run/ahMFqtx0nP6c069WIks 67bTcWB2KMCaYyRwUO9SuE3odXUkknuAqEn8qbM4jhi3SobWNpNtdShrT2zLxjTpxcpy TpJe9N0OrwUpAQ7OArzMaevNAWWgtLggIFJaqPkw/CC6G2ceZigph3yZihtWBjGhY7fn WdjYTF2vBSzIPt3AFESAkDqB8LJv2cWUmurrbMxrxPvUFIMv9hFQdF1Kxn7nkctfNUi3 q1RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="JGVnr/Ft"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020a17090341d200b00153b2d164ffsi2825379ple.263.2022.04.01.08.45.04; Fri, 01 Apr 2022 08:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="JGVnr/Ft"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240847AbiCaTjx (ORCPT + 99 others); Thu, 31 Mar 2022 15:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240835AbiCaTjk (ORCPT ); Thu, 31 Mar 2022 15:39:40 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D5E923C0E7; Thu, 31 Mar 2022 12:37:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id 2FB0A1F4724F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648755465; bh=TG6URAwoxuOMsxmElkXZN+3kr6++zE3/TmJ6jTIeCc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JGVnr/FtZT3zuIJdqcifkyNee2EAFLxBcAh+IS7LZnNsmfdiXWV3PlyKjTB83WI5+ 1UH7iWvOuh0Qpnv7Tqj05AehCHHAEDRGyX2VgERLv5QdIt3pGYli65+SqHXLPzl6R8 wxWCwO5QGvy9ZWt+uCn/nrhUwd8XYh6dBy7jFjh3AHMB5GVhKpsQx2TDmWrOVCjd+t +wZfeujPGizeL248Q6yn/vi6HFViB56RF59I4A1vEVtZD2BihPdO+TLhLzrlHZhnPZ NP99ppZHKcdsTPxyPywN1cB8FLhzi9ILL5ru2xWgTy9IHb8F56fNP8t1iV8DrENQ5v 4rgHUVr4YZMzw== From: Nicolas Dufresne To: Mauro Carvalho Chehab Cc: kernel@collabora.com, Sebastian Fricke , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/23] media: h264: Store current picture fields Date: Thu, 31 Mar 2022 15:37:09 -0400 Message-Id: <20220331193726.289559-8-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220331193726.289559-1-nicolas.dufresne@collabora.com> References: <20220331193726.289559-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This information, also called picture structure, is required in field decoding mode to construct reference lists. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke --- drivers/media/v4l2-core/v4l2-h264.c | 10 +++++++--- include/media/v4l2-h264.h | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-h264.c b/drivers/media/v4l2-core/v4l2-h264.c index 4b46b36526c0..58f18bb0afb6 100644 --- a/drivers/media/v4l2-core/v4l2-h264.c +++ b/drivers/media/v4l2-core/v4l2-h264.c @@ -34,13 +34,17 @@ v4l2_h264_init_reflist_builder(struct v4l2_h264_reflist_builder *b, cur_frame_num = dec_params->frame_num; memset(b, 0, sizeof(*b)); - if (!(dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC)) + if (!(dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC)) { b->cur_pic_order_count = min(dec_params->bottom_field_order_cnt, dec_params->top_field_order_cnt); - else if (dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD) + b->cur_pic_fields = V4L2_H264_FRAME_REF; + } else if (dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD) { b->cur_pic_order_count = dec_params->bottom_field_order_cnt; - else + b->cur_pic_fields = V4L2_H264_BOTTOM_FIELD_REF; + } else { b->cur_pic_order_count = dec_params->top_field_order_cnt; + b->cur_pic_fields = V4L2_H264_TOP_FIELD_REF; + } for (i = 0; i < V4L2_H264_NUM_DPB_ENTRIES; i++) { u32 pic_order_count; diff --git a/include/media/v4l2-h264.h b/include/media/v4l2-h264.h index e282fb16ac58..e165a54c68fa 100644 --- a/include/media/v4l2-h264.h +++ b/include/media/v4l2-h264.h @@ -21,6 +21,7 @@ * @refs.longterm: set to true for a long term reference * @refs: array of references * @cur_pic_order_count: picture order count of the frame being decoded + * @cur_pic_fields: fields present in the frame being decoded * @unordered_reflist: unordered list of references. Will be used to generate * ordered P/B0/B1 lists * @num_valid: number of valid references in the refs array @@ -36,7 +37,10 @@ struct v4l2_h264_reflist_builder { u32 pic_num; u16 longterm : 1; } refs[V4L2_H264_NUM_DPB_ENTRIES]; + s32 cur_pic_order_count; + u8 cur_pic_fields; + struct v4l2_h264_reference unordered_reflist[V4L2_H264_REF_LIST_LEN]; u8 num_valid; }; -- 2.34.1