const struct rk3288_vp8e_reg_params *reg_params;
};
+/**
+ * struct rk3288_vpu_vp8d_run - per-run data specific to VP8 decoding.
+ * @frame_hdr: Pointer to a buffer containing per-run frame data which
+ * is needed by setting vpu register.
+ */
+struct rk3288_vpu_vp8d_run {
+ const struct v4l2_ctrl_vp8_frame_hdr *frame_hdr;
+};
+
/**
* struct rk3288_vpu_h264d_run - per-run data specific to H264 decoding.
* @sps: Pointer to a buffer containing H264 SPS.
/* Specific for particular operating modes. */
union {
struct rk3288_vpu_vp8e_run vp8e;
+ struct rk3288_vpu_vp8d_run vp8d;
struct rk3288_vpu_h264d_run h264d;
/* Other modes will need different data. */
};
.codec_mode = RK_VPU_CODEC_H264D,
.num_planes = 1,
},
+ {
+ .name = "Frames of VP8 Encoded Stream",
+ .fourcc = V4L2_PIX_FMT_VP8_FRAME,
+ .codec_mode = RK_VPU_CODEC_VP8D,
+ .num_planes = 1,
+ },
};
static struct rk3288_vpu_fmt *find_format(struct v4l2_format *f, bool bitstream)
RK3288_VPU_DEC_CTRL_H264_SCALING_MATRIX,
RK3288_VPU_DEC_CTRL_H264_SLICE_PARAM,
RK3288_VPU_DEC_CTRL_H264_DECODE_PARAM,
+ RK3288_VPU_DEC_CTRL_VP8_FRAME_HDR,
};
static struct rk3288_vpu_control controls[] = {
.elem_size = sizeof(struct v4l2_ctrl_h264_decode_param),
.can_store = true,
},
+ [RK3288_VPU_DEC_CTRL_VP8_FRAME_HDR] = {
+ .id = V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR,
+ .type = V4L2_CTRL_TYPE_PRIVATE,
+ .name = "VP8 Frame Header Parameters",
+ .max_stores = VIDEO_MAX_FRAME,
+ .elem_size = sizeof(struct v4l2_ctrl_vp8_frame_hdr),
+ .can_store = true,
+ },
};
static inline const void *get_ctrl_ptr(struct rk3288_vpu_ctx *ctx, unsigned id)
case V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX:
case V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAM:
case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAM:
+ case V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR:
/* These controls are used directly. */
break;
v4l2_ctrl_apply_store(&ctx->ctrl_handler, src->config_store);
- ctx->run.h264d.sps = get_ctrl_ptr(ctx, RK3288_VPU_DEC_CTRL_H264_SPS);
- ctx->run.h264d.pps = get_ctrl_ptr(ctx, RK3288_VPU_DEC_CTRL_H264_PPS);
- ctx->run.h264d.scaling_matrix = get_ctrl_ptr(ctx,
+ if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_H264_SLICE) {
+ ctx->run.h264d.sps = get_ctrl_ptr(ctx,
+ RK3288_VPU_DEC_CTRL_H264_SPS);
+ ctx->run.h264d.pps = get_ctrl_ptr(ctx,
+ RK3288_VPU_DEC_CTRL_H264_PPS);
+ ctx->run.h264d.scaling_matrix = get_ctrl_ptr(ctx,
RK3288_VPU_DEC_CTRL_H264_SCALING_MATRIX);
- ctx->run.h264d.slice_param = get_ctrl_ptr(ctx,
+ ctx->run.h264d.slice_param = get_ctrl_ptr(ctx,
RK3288_VPU_DEC_CTRL_H264_SLICE_PARAM);
- ctx->run.h264d.decode_param = get_ctrl_ptr(ctx,
+ ctx->run.h264d.decode_param = get_ctrl_ptr(ctx,
RK3288_VPU_DEC_CTRL_H264_DECODE_PARAM);
+ } else if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_VP8_FRAME) {
+ ctx->run.vp8d.frame_hdr = get_ctrl_ptr(ctx,
+ RK3288_VPU_DEC_CTRL_VP8_FRAME_HDR);
+ }
}
static void rk3288_vpu_dec_run_done(struct rk3288_vpu_ctx *ctx,