#include <linux/module.h>
#include <linux/slab.h>
#include <media/videobuf2-dma-contig.h>
#include <media/v4l2-vp9.h>
#include "../mtk_vcodec_dec.h"
#include "../../common/mtk_vcodec_intr.h"
#include "../vdec_drv_base.h"
#include "../vdec_drv_if.h"
#include "../vdec_vpu_if.h"
#define VP9_RESET_FRAME_CONTEXT_NONE0 …
#define VP9_RESET_FRAME_CONTEXT_NONE1 …
#define VP9_RESET_FRAME_CONTEXT_SPEC …
#define VP9_RESET_FRAME_CONTEXT_ALL …
#define VP9_TILE_BUF_SIZE …
#define VP9_PROB_BUF_SIZE …
#define VP9_COUNTS_BUF_SIZE …
#define HDR_FLAG(x) …
#define LF_FLAG(x) …
#define SEG_FLAG(x) …
#define VP9_BAND_6(band) …
struct vdec_vp9_slice_frame_ctx { … };
struct vdec_vp9_slice_frame_counts { … };
struct vdec_vp9_slice_counts_map { … };
struct vdec_vp9_slice_uncompressed_header { … };
struct vdec_vp9_slice_compressed_header { … };
struct vdec_vp9_slice_tiles { … };
struct vdec_vp9_slice_reference { … };
struct vdec_vp9_slice_frame { … };
struct vdec_vp9_slice_init_vsi { … };
struct vdec_vp9_slice_mem { … };
struct vdec_vp9_slice_bs { … };
struct vdec_vp9_slice_fb { … };
struct vdec_vp9_slice_state { … };
struct vdec_vp9_slice_vsi { … };
struct vdec_vp9_slice_pfc { … };
enum vdec_vp9_slice_resolution_level { … };
struct vdec_vp9_slice_ref { … };
struct vdec_vp9_slice_instance { … };
static struct vdec_vp9_slice_frame_ctx *vdec_vp9_slice_default_frame_ctx;
static DEFINE_MUTEX(vdec_vp9_slice_frame_ctx_lock);
static int vdec_vp9_slice_core_decode(struct vdec_lat_buf *lat_buf);
static int vdec_vp9_slice_init_default_frame_ctx(struct vdec_vp9_slice_instance *instance)
{ … }
static int vdec_vp9_slice_alloc_working_buffer(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_vsi *vsi)
{ … }
static void vdec_vp9_slice_free_working_buffer(struct vdec_vp9_slice_instance *instance)
{ … }
static void vdec_vp9_slice_vsi_from_remote(struct vdec_vp9_slice_vsi *vsi,
struct vdec_vp9_slice_vsi *remote_vsi,
int skip)
{ … }
static void vdec_vp9_slice_vsi_to_remote(struct vdec_vp9_slice_vsi *vsi,
struct vdec_vp9_slice_vsi *remote_vsi)
{ … }
static int vdec_vp9_slice_tile_offset(int idx, int mi_num, int tile_log2)
{ … }
static
int vdec_vp9_slice_setup_single_from_src_to_dst(struct vdec_vp9_slice_instance *instance)
{ … }
static int vdec_vp9_slice_setup_lat_from_src_buf(struct vdec_vp9_slice_instance *instance,
struct vdec_lat_buf *lat_buf)
{ … }
static void vdec_vp9_slice_setup_hdr(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_uncompressed_header *uh,
struct v4l2_ctrl_vp9_frame *hdr)
{ … }
static void vdec_vp9_slice_setup_frame_ctx(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_uncompressed_header *uh,
struct v4l2_ctrl_vp9_frame *hdr)
{ … }
static void vdec_vp9_slice_setup_loop_filter(struct vdec_vp9_slice_uncompressed_header *uh,
struct v4l2_vp9_loop_filter *lf)
{ … }
static void vdec_vp9_slice_setup_quantization(struct vdec_vp9_slice_uncompressed_header *uh,
struct v4l2_vp9_quantization *quant)
{ … }
static void vdec_vp9_slice_setup_segmentation(struct vdec_vp9_slice_uncompressed_header *uh,
struct v4l2_vp9_segmentation *seg)
{ … }
static int vdec_vp9_slice_setup_tile(struct vdec_vp9_slice_vsi *vsi,
struct v4l2_ctrl_vp9_frame *hdr)
{ … }
static void vdec_vp9_slice_setup_state(struct vdec_vp9_slice_vsi *vsi)
{ … }
static void vdec_vp9_slice_setup_ref_idx(struct vdec_vp9_slice_pfc *pfc,
struct v4l2_ctrl_vp9_frame *hdr)
{ … }
static int vdec_vp9_slice_setup_pfc(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_pfc *pfc)
{ … }
static int vdec_vp9_slice_setup_lat_buffer(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_vsi *vsi,
struct mtk_vcodec_mem *bs,
struct vdec_lat_buf *lat_buf)
{ … }
static int vdec_vp9_slice_setup_prob_buffer(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_vsi *vsi)
{ … }
static void vdec_vp9_slice_setup_seg_buffer(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_vsi *vsi,
struct mtk_vcodec_mem *buf)
{ … }
static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_vsi *vsi,
struct mtk_vcodec_mem *bs)
{ … }
static int vdec_vp9_slice_setup_lat(struct vdec_vp9_slice_instance *instance,
struct mtk_vcodec_mem *bs,
struct vdec_lat_buf *lat_buf,
struct vdec_vp9_slice_pfc *pfc)
{ … }
static
void vdec_vp9_slice_map_counts_eob_coef(unsigned int i, unsigned int j, unsigned int k,
struct vdec_vp9_slice_frame_counts *counts,
struct v4l2_vp9_frame_symbol_counts *counts_helper)
{ … }
static void vdec_vp9_slice_counts_map_helper(struct vdec_vp9_slice_counts_map *counts_map,
struct vdec_vp9_slice_frame_counts *counts,
struct v4l2_vp9_frame_symbol_counts *counts_helper)
{ … }
static void vdec_vp9_slice_map_to_coef(unsigned int i, unsigned int j, unsigned int k,
struct vdec_vp9_slice_frame_ctx *frame_ctx,
struct v4l2_vp9_frame_context *frame_ctx_helper)
{ … }
static void vdec_vp9_slice_map_from_coef(unsigned int i, unsigned int j, unsigned int k,
struct vdec_vp9_slice_frame_ctx *frame_ctx,
struct v4l2_vp9_frame_context *frame_ctx_helper)
{ … }
static
void vdec_vp9_slice_framectx_map_helper(bool frame_is_intra,
struct vdec_vp9_slice_frame_ctx *pre_frame_ctx,
struct vdec_vp9_slice_frame_ctx *frame_ctx,
struct v4l2_vp9_frame_context *frame_ctx_helper)
{ … }
static void vdec_vp9_slice_helper_map_framectx(struct v4l2_vp9_frame_context *frame_ctx_helper,
struct vdec_vp9_slice_frame_ctx *frame_ctx)
{ … }
static int vdec_vp9_slice_update_prob(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_vsi *vsi)
{ … }
static int vdec_vp9_slice_update_single(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_pfc *pfc)
{ … }
static int vdec_vp9_slice_update_lat(struct vdec_vp9_slice_instance *instance,
struct vdec_lat_buf *lat_buf,
struct vdec_vp9_slice_pfc *pfc)
{ … }
static int vdec_vp9_slice_setup_core_to_dst_buf(struct vdec_vp9_slice_instance *instance,
struct vdec_lat_buf *lat_buf)
{ … }
static int vdec_vp9_slice_setup_core_buffer(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_pfc *pfc,
struct vdec_vp9_slice_vsi *vsi,
struct vdec_fb *fb,
struct vdec_lat_buf *lat_buf)
{ … }
static void vdec_vp9_slice_setup_single_buffer(struct vdec_vp9_slice_instance *instance,
struct vdec_vp9_slice_pfc *pfc,
struct vdec_vp9_slice_vsi *vsi,
struct mtk_vcodec_mem *bs,
struct vdec_fb *fb)
{ … }
static int vdec_vp9_slice_setup_core(struct vdec_vp9_slice_instance *instance,
struct vdec_fb *fb,
struct vdec_lat_buf *lat_buf,
struct vdec_vp9_slice_pfc *pfc)
{ … }
static int vdec_vp9_slice_setup_single(struct vdec_vp9_slice_instance *instance,
struct mtk_vcodec_mem *bs,
struct vdec_fb *fb,
struct vdec_vp9_slice_pfc *pfc)
{ … }
static int vdec_vp9_slice_update_core(struct vdec_vp9_slice_instance *instance,
struct vdec_lat_buf *lat_buf,
struct vdec_vp9_slice_pfc *pfc)
{ … }
static int vdec_vp9_slice_init(struct mtk_vcodec_dec_ctx *ctx)
{ … }
static void vdec_vp9_slice_deinit(void *h_vdec)
{ … }
static int vdec_vp9_slice_flush(void *h_vdec, struct mtk_vcodec_mem *bs,
struct vdec_fb *fb, bool *res_chg)
{ … }
static void vdec_vp9_slice_get_pic_info(struct vdec_vp9_slice_instance *instance)
{ … }
static void vdec_vp9_slice_get_dpb_size(struct vdec_vp9_slice_instance *instance,
unsigned int *dpb_sz)
{ … }
static int vdec_vp9_slice_get_param(void *h_vdec, enum vdec_get_param_type type, void *out)
{ … }
static int vdec_vp9_slice_single_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
struct vdec_fb *fb, bool *res_chg)
{ … }
static int vdec_vp9_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
struct vdec_fb *fb, bool *res_chg)
{ … }
static int vdec_vp9_slice_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
struct vdec_fb *fb, bool *res_chg)
{ … }
static int vdec_vp9_slice_core_decode(struct vdec_lat_buf *lat_buf)
{ … }
const struct vdec_common_if vdec_vp9_slice_lat_if = …;