Re: [PATCH 2/2] media: hantro: Add support for VP8 decoding on rk3288

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 13 Jun 2019 12:10:40 -0300
Ezequiel Garcia <ezequiel@xxxxxxxxxxxxx> wrote:


> +static void cfg_parts(struct hantro_ctx *ctx,
> +		      const struct v4l2_ctrl_vp8_frame_header *hdr)
> +{
> +	struct hantro_dev *vpu = ctx->dev;
> +	struct vb2_v4l2_buffer *vb2_src;
> +	u32 first_part_offset = VP8_FRAME_IS_KEY_FRAME(hdr) ? 10 : 3;
> +	u32 dct_part_total_len = 0;
> +	u32 dct_size_part_size = 0;
> +	u32 dct_part_offset = 0;
> +	u32 mb_offset_bytes = 0;
> +	u32 mb_offset_bits = 0;
> +	u32 mb_start_bits = 0;
> +	struct vp8_dec_reg reg;
> +	dma_addr_t src_dma;
> +	u32 mb_size = 0;
> +	u32 count = 0;
> +	u32 i;
> +
> +	vb2_src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
> +	src_dma = vb2_dma_contig_plane_dma_addr(&vb2_src->vb2_buf, 0);
> +
> +	/*
> +	 * Calculate control partition mb data info
> +	 * @macroblock_bit_offset:	bits offset of mb data from first
> +	 *				part start pos
> +	 * @mb_offset_bits:		bits offset of mb data from src_dma
> +	 *				base addr
> +	 * @mb_offset_byte:		bytes offset of mb data from src_dma
> +	 *				base addr
> +	 * @mb_start_bits:		bits offset of mb data from mb data
> +	 *				64bits alignment addr
> +	 */
> +	mb_offset_bits = first_part_offset * 8
> +		+ hdr->macroblock_bit_offset + 8;
> +	mb_offset_bytes = mb_offset_bits / 8;
> +	mb_start_bits = mb_offset_bits
> +		- (mb_offset_bytes & (~DEC_8190_ALIGN_MASK)) * 8;
> +	mb_size = hdr->first_part_size
> +		- (mb_offset_bytes - first_part_offset)
> +		+ (mb_offset_bytes & DEC_8190_ALIGN_MASK);

Nit: can we have operators placed at the end of a line instead of
the beginning of the following line?



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux