Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3368540imu; Mon, 7 Jan 2019 01:59:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN7E0ZzHJ3oUzKTd/StlGmSsyWMnjLj0UvMLuok0DIPdGfuauamvR0ZnkE6F10x96hlJfXhA X-Received: by 2002:a62:2b8b:: with SMTP id r133mr62436956pfr.246.1546855182534; Mon, 07 Jan 2019 01:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546855182; cv=none; d=google.com; s=arc-20160816; b=LXDqCNJdFyYH0g/H4TYt8hHzKscoSGo25WZHL422BI7mb2BT8orkk5S8nqQ6f19jPW LHlsjT188g/CiSQtpeJ1VWC1IDU73l8B+XtkJUpV/gpRHJvKlMcRf65q4XAo/VlvrIzD c6/NSFK6PKq2/OkjYH2EpL+hY6TGZXGG1tFIHckaBlusnnq+ZvVFsuo44MOmaLF3Fx82 wKrAmzsNjBjSRC5o7FKlrT3afNURRUA7YWE7z2wfD1/3wYz5g/dTrdPjUOp4Y4IeDPRF w1Hc0ZqK/bfM7GFmIrtOwaq61IFOFM7xHLgRJ+ecB8ZFOEsTEhRUS4ucaFRIsiiFCc5q NaNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=I8ekb5Kro+ztQB8OVmxO9lC8R1oQLSOThTNOv0WBX4E=; b=jsl+nA+LO3hk/l3Tli7DMp+EwwcjdHdMfX8HIBOtXiEuduBfEh+TYLYQE9p94VBOwU pg3LN3MU1aqZk8myKYITQuJYKYNA6CCDlYTBZFIoMU6UW5on23twJ8YbQkEfnMi65JJ3 ZydkubLQBXSgop+S5+OK2Neo5aknhe7e0XFNLJ9y7y2z6/jgXe8rN4/nxW/9ix8Y+65U i5zRob3DNCa0Stv30Cw0xQ9/TMTIrUr/D00j1TmiK7gNqeDOQPibGiYLIxYgfQmcVfnI /8IHCHfBWg7RPI0ZzJFJKQ3fit1adU4T/1dxMQ2P/FRgq68BO3O/6a5tKIkPd4PpO0Ra tZIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k14si1757026pll.346.2019.01.07.01.59.27; Mon, 07 Jan 2019 01:59:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726782AbfAGJ5c (ORCPT + 99 others); Mon, 7 Jan 2019 04:57:32 -0500 Received: from mail.bootlin.com ([62.4.15.54]:59447 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbfAGJ5a (ORCPT ); Mon, 7 Jan 2019 04:57:30 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 4711120802; Mon, 7 Jan 2019 10:57:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from aptenodytes (aaubervilliers-681-1-29-148.w90-88.abo.wanadoo.fr [90.88.149.148]) by mail.bootlin.com (Postfix) with ESMTPSA id C958120714; Mon, 7 Jan 2019 10:57:17 +0100 (CET) Message-ID: <64c793e08d61181b78125b3956ec38623fa5d261.camel@bootlin.com> Subject: Re: [linux-sunxi] [PATCH v2 1/2] media: v4l: Add definitions for the HEVC slice format and controls From: Paul Kocialkowski To: Randy Li Cc: Jernej =?UTF-8?Q?=C5=A0krabec?= , linux-sunxi@googlegroups.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab , Maxime Ripard , Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Thomas Petazzoni , linux-rockchip@lists.infradead.org Date: Mon, 07 Jan 2019 10:57:17 +0100 In-Reply-To: <776e63c9-d4a5-342a-e0f7-200ef144ffc4@rock-chips.com> References: <20181123130209.11696-1-paul.kocialkowski@bootlin.com> <20181123130209.11696-2-paul.kocialkowski@bootlin.com> <5515174.7lFZcYkk85@jernej-laptop> <776e63c9-d4a5-342a-e0f7-200ef144ffc4@rock-chips.com> Organization: Bootlin Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, 2019-01-07 at 11:49 +0800, Randy Li wrote: > On 12/12/18 8:51 PM, Paul Kocialkowski wrote: > > Hi, > > > > On Wed, 2018-12-05 at 21:59 +0100, Jernej Škrabec wrote: > > > > > > + > > > > +#define V4L2_HEVC_DPB_ENTRY_RPS_ST_CURR_BEFORE 0x01 > > > > +#define V4L2_HEVC_DPB_ENTRY_RPS_ST_CURR_AFTER 0x02 > > > > +#define V4L2_HEVC_DPB_ENTRY_RPS_LT_CURR 0x03 > > > > + > > > > +#define V4L2_HEVC_DPB_ENTRIES_NUM_MAX 16 > > > > + > > > > +struct v4l2_hevc_dpb_entry { > > > > + __u32 buffer_tag; > > > > + __u8 rps; > > > > + __u8 field_pic; > > > > + __u16 pic_order_cnt[2]; > > > > +}; > > Please add a property for reference index, if that rps is not used for > this, some device would request that(not the rockchip one). And > Rockchip's VDPU1 and VDPU2 for AVC would request a similar property. What exactly is that reference index? Is it a bitstream element or something deduced from the bitstream? > Adding another buffer_tag for referring the memory of the motion vectors > for each frames. Or a better method is add a meta data to echo picture > buffer, since the picture output is just the same as the original, > display won't care whether the motion vectors are written the button of > picture or somewhere else. The motion vectors are passed as part of the raw bitstream data, in the slices. Is there a case where the motion vectors are coded differently? > > > > + > > > > +struct v4l2_hevc_pred_weight_table { > > > > + __u8 luma_log2_weight_denom; > > > > + __s8 delta_chroma_log2_weight_denom; > > > > + > > > > + __s8 delta_luma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; > > > > + __s8 luma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; > > > > + __s8 delta_chroma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]; > > > > + __s8 chroma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]; > > > > + > > > > + __s8 delta_luma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; > > > > + __s8 luma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; > > > > + __s8 delta_chroma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]; > > > > + __s8 chroma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]; > > > > +}; > > > > + > Those properties I think are not necessary are applying for the > Rockchip's device, may not work for the others. Yes, it's possible that some of the elements are not necessary for some decoders. What we want is to cover all the elements that might be required for a decoder. > > > > +struct v4l2_ctrl_hevc_slice_params { > > > > + __u32 bit_size; > > > > + __u32 data_bit_offset; > > > > + > > > > + /* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */ > > > > + __u8 nal_unit_type; > > > > + __u8 nuh_temporal_id_plus1; > > > > + > > > > + /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */ > > > > + __u8 slice_type; > > > > + __u8 colour_plane_id; > ---------------------------------------------------------------------------- > > > > + __u16 slice_pic_order_cnt; > > > > + __u8 slice_sao_luma_flag; > > > > + __u8 slice_sao_chroma_flag; > > > > + __u8 slice_temporal_mvp_enabled_flag; > > > > + __u8 num_ref_idx_l0_active_minus1; > > > > + __u8 num_ref_idx_l1_active_minus1; > Rockchip's decoder doesn't use this part. > > > > + __u8 mvd_l1_zero_flag; > > > > + __u8 cabac_init_flag; > > > > + __u8 collocated_from_l0_flag; > > > > + __u8 collocated_ref_idx; > > > > + __u8 five_minus_max_num_merge_cand; > > > > + __u8 use_integer_mv_flag; > > > > + __s8 slice_qp_delta; > > > > + __s8 slice_cb_qp_offset; > > > > + __s8 slice_cr_qp_offset; > > > > + __s8 slice_act_y_qp_offset; > > > > + __s8 slice_act_cb_qp_offset; > > > > + __s8 slice_act_cr_qp_offset; > > > > + __u8 slice_deblocking_filter_disabled_flag; > > > > + __s8 slice_beta_offset_div2; > > > > + __s8 slice_tc_offset_div2; > > > > + __u8 slice_loop_filter_across_slices_enabled_flag; > > > > + > > > > + /* ISO/IEC 23008-2, ITU-T Rec. H.265: Picture timing SEI message */ > > > > + __u8 pic_struct; > I think the decoder doesn't care about this, it is used for display. The purpose of this field is to indicate whether the current picture is a progressive frame or an interlaced field picture, which is useful for decoding. At least our decoder has a register field to indicate frame/top field/bottom field, so we certainly need to keep the info around. Looking at the spec and the ffmpeg implementation, it looks like this flag of the bitstream is the usual way to report field coding. Cheers, Paul > > > > + > > > > + /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */ > > > > + struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; > > > > + __u8 num_active_dpb_entries; > > > > + __u8 ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; > > > > + __u8 ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; > > > > + > > > > + __u8 num_rps_poc_st_curr_before; > > > > + __u8 num_rps_poc_st_curr_after; > > > > + __u8 num_rps_poc_lt_curr; > > > > + > > > > + /* ISO/IEC 23008-2, ITU-T Rec. H.265: Weighted prediction parameter */ > > > > + struct v4l2_hevc_pred_weight_table pred_weight_table; > > > > +}; > > > > + > > > > #endif -- Paul Kocialkowski, Bootlin (formerly Free Electrons) Embedded Linux and kernel engineering https://bootlin.com