linux/drivers/staging/media/sunxi/cedrus/cedrus_vp8.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Cedrus VPU driver
 *
 * Copyright (c) 2019 Jernej Skrabec <[email protected]>
 */

/*
 * VP8 in Cedrus shares same engine as H264.
 *
 * Note that it seems necessary to call bitstream parsing functions,
 * to parse frame header, otherwise decoded image is garbage. This is
 * contrary to what is driver supposed to do. However, values are not
 * really used, so this might be acceptable. It's possible that bitstream
 * parsing functions set some internal VPU state, which is later necessary
 * for proper decoding. Biggest suspect is "VP8 probs update" trigger.
 */

#include <linux/delay.h>
#include <linux/types.h>

#include <media/videobuf2-dma-contig.h>

#include "cedrus.h"
#include "cedrus_hw.h"
#include "cedrus_regs.h"

#define CEDRUS_ENTROPY_PROBS_SIZE
#define VP8_PROB_HALF
#define QUANT_DELTA_COUNT

/*
 * This table comes from the concatenation of k_coeff_entropy_update_probs,
 * kf_ymode_prob, default_mv_context, etc. It is provided in this form in
 * order to avoid computing it every time the driver is initialised, and is
 * suitable for direct consumption by the hardware.
 */
static const u8 prob_table_init[] =;

/*
 * This table is a copy of k_mv_entropy_update_probs from the VP8
 * specification.
 *
 * FIXME: If any other driver uses it, we can consider moving
 * this table so it can be shared.
 */
static const u8 k_mv_entropy_update_probs[2][V4L2_VP8_MV_PROB_CNT] =;

static uint8_t read_bits(struct cedrus_dev *dev, unsigned int bits_count,
			 unsigned int probability)
{}

static void get_delta_q(struct cedrus_dev *dev)
{}

static void process_segmentation_info(struct cedrus_dev *dev)
{}

static void process_ref_lf_delta_info(struct cedrus_dev *dev)
{}

static void process_ref_frame_info(struct cedrus_dev *dev)
{}

static void cedrus_irq_clear(struct cedrus_dev *dev)
{}

static void cedrus_read_header(struct cedrus_dev *dev,
			       const struct v4l2_ctrl_vp8_frame *slice)
{}

static void cedrus_vp8_update_probs(const struct v4l2_ctrl_vp8_frame *slice,
				    u8 *prob_table)
{}

static enum cedrus_irq_status
cedrus_vp8_irq_status(struct cedrus_ctx *ctx)
{}

static void cedrus_vp8_irq_clear(struct cedrus_ctx *ctx)
{}

static void cedrus_vp8_irq_disable(struct cedrus_ctx *ctx)
{}

static int cedrus_vp8_setup(struct cedrus_ctx *ctx, struct cedrus_run *run)
{}

static int cedrus_vp8_start(struct cedrus_ctx *ctx)
{}

static void cedrus_vp8_stop(struct cedrus_ctx *ctx)
{}

static void cedrus_vp8_trigger(struct cedrus_ctx *ctx)
{}

struct cedrus_dec_ops cedrus_dec_ops_vp8 =;