summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--drivers/amvdec_ports/Makefile13
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.c22
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.h3
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.c534
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.h39
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_drv.c57
-rw-r--r--drivers/amvdec_ports/aml_vcodec_drv.h11
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.c18
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.h8
-rw-r--r--drivers/amvdec_ports/aml_vcodec_vfm.c9
-rw-r--r--drivers/amvdec_ports/aml_vcodec_vfm.h6
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.c662
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/aml_h264_parser.h226
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.c1274
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/aml_hevc_parser.h137
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.c397
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.h163
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg12_parser.c198
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg12_parser.h74
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.c1233
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.h250
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.c299
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/aml_vp9_parser.h279
-rw-r--r--drivers/amvdec_ports/decoder/h264_parse.c389
-rw-r--r--drivers/amvdec_ports/decoder/h264_parse.h141
-rw-r--r--drivers/amvdec_ports/decoder/h264_stream.c111
-rw-r--r--drivers/amvdec_ports/decoder/h264_stream.h39
-rw-r--r--drivers/amvdec_ports/decoder/vdec_h264_if.c357
-rw-r--r--drivers/amvdec_ports/decoder/vdec_hevc_if.c477
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mjpeg_if.c498
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg12_if.c490
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg4_if.c499
-rw-r--r--drivers/amvdec_ports/decoder/vdec_vp9_if.c461
-rw-r--r--[-rwxr-xr-x]drivers/amvdec_ports/decoder/vdec_vp9_trigger.h0
-rw-r--r--drivers/amvdec_ports/test/vcodec_m2m_test.c18
-rw-r--r--drivers/amvdec_ports/utils/common.c221
-rw-r--r--drivers/amvdec_ports/utils/common.h72
-rw-r--r--drivers/amvdec_ports/utils/get_bits.h590
-rw-r--r--drivers/amvdec_ports/utils/golomb.c147
-rw-r--r--drivers/amvdec_ports/utils/golomb.h500
-rw-r--r--drivers/amvdec_ports/utils/pixfmt.h470
-rw-r--r--drivers/amvdec_ports/utils/put_bits.h323
-rw-r--r--drivers/amvdec_ports/vdec_drv_base.h11
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.c45
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.h10
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c219
-rw-r--r--drivers/frame_provider/decoder/h265/vh265.c308
-rw-r--r--drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c334
-rw-r--r--drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c233
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c317
-rw-r--r--drivers/frame_provider/decoder/utils/Makefile1
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.c19
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.c131
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.h22
-rw-r--r--drivers/frame_provider/decoder/vp9/vvp9.c388
55 files changed, 11471 insertions, 2282 deletions
diff --git a/drivers/amvdec_ports/vdec_drv_if.c b/drivers/amvdec_ports/vdec_drv_if.c
index d69ef9f..4b70ed0 100644
--- a/drivers/amvdec_ports/vdec_drv_if.c
+++ b/drivers/amvdec_ports/vdec_drv_if.c
@@ -29,6 +29,9 @@
const struct vdec_common_if *get_h264_dec_comm_if(void);
const struct vdec_common_if *get_hevc_dec_comm_if(void);
const struct vdec_common_if *get_vp9_dec_comm_if(void);
+const struct vdec_common_if *get_mpeg12_dec_comm_if(void);
+const struct vdec_common_if *get_mpeg4_dec_comm_if(void);
+const struct vdec_common_if *get_mjpeg_dec_comm_if(void);
int vdec_if_init(struct aml_vcodec_ctx *ctx, unsigned int fourcc)
{
@@ -44,15 +47,22 @@ int vdec_if_init(struct aml_vcodec_ctx *ctx, unsigned int fourcc)
case V4L2_PIX_FMT_VP9:
ctx->dec_if = get_vp9_dec_comm_if();
break;
+ case V4L2_PIX_FMT_MPEG:
+ case V4L2_PIX_FMT_MPEG1:
+ case V4L2_PIX_FMT_MPEG2:
+ ctx->dec_if = get_mpeg12_dec_comm_if();
+ break;
+ case V4L2_PIX_FMT_MPEG4:
+ ctx->dec_if = get_mpeg4_dec_comm_if();
+ break;
+ case V4L2_PIX_FMT_MJPEG:
+ ctx->dec_if = get_mjpeg_dec_comm_if();
+ break;
default:
return -EINVAL;
}
- aml_vdec_lock(ctx);
- //aml_vcodec_dec_clock_on(&ctx->dev->pm);//debug_tmp
ret = ctx->dec_if->init(ctx, &ctx->drv_handle);
- //aml_vcodec_dec_clock_off(&ctx->dev->pm);
- aml_vdec_unlock(ctx);
return ret;
}
@@ -62,15 +72,13 @@ int vdec_if_probe(struct aml_vcodec_ctx *ctx,
{
int ret = 0;
- aml_vdec_lock(ctx);
ret = ctx->dec_if->probe(ctx->drv_handle, bs, out);
- aml_vdec_unlock(ctx);
return ret;
}
int vdec_if_decode(struct aml_vcodec_ctx *ctx, struct aml_vcodec_mem *bs,
- unsigned long int timestamp, bool *res_chg)
+ u64 timestamp, bool *res_chg)
{
int ret = 0;
@@ -81,29 +89,13 @@ int vdec_if_decode(struct aml_vcodec_ctx *ctx, struct aml_vcodec_mem *bs,
}
}
- /*if (fb) {
- if (((fb->base_y.dma_addr & 511) != 0) ||
- ((fb->base_c.dma_addr & 511) != 0)) {
- aml_v4l2_err("frame buffer dma_addr should 512 byte align");
- return -EINVAL;
- }
- }*/
-
if (ctx->drv_handle == 0)
return -EIO;
- //aml_vdec_lock(ctx);
-
aml_vcodec_set_curr_ctx(ctx->dev, ctx);
- //aml_vcodec_dec_clock_on(&ctx->dev->pm);//debug_tmp
- //enable_irq(ctx->dev->dec_irq);
ret = ctx->dec_if->decode(ctx->drv_handle, bs, timestamp, res_chg);
- //disable_irq(ctx->dev->dec_irq);
- //aml_vcodec_dec_clock_off(&ctx->dev->pm);
aml_vcodec_set_curr_ctx(ctx->dev, NULL);
- //aml_vdec_unlock(ctx);
-
return ret;
}
@@ -115,9 +107,7 @@ int vdec_if_get_param(struct aml_vcodec_ctx *ctx,
if (ctx->drv_handle == 0)
return -EIO;
- //aml_vdec_lock(ctx);
ret = ctx->dec_if->get_param(ctx->drv_handle, type, out);
- //aml_vdec_unlock(ctx);
return ret;
}
@@ -127,11 +117,6 @@ void vdec_if_deinit(struct aml_vcodec_ctx *ctx)
if (ctx->drv_handle == 0)
return;
- //aml_vdec_lock(ctx);
- //aml_vcodec_dec_clock_on(&ctx->dev->pm);
ctx->dec_if->deinit(ctx->drv_handle);
- //aml_vcodec_dec_clock_off(&ctx->dev->pm);
- //aml_vdec_unlock(ctx);
-
ctx->drv_handle = 0;
}