summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--[-rwxr-xr-x]Media.mk1
-rw-r--r--drivers/amvdec_ports/Makefile1
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.c112
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.h5
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.c992
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.h2
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_drv.c122
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_pm.c206
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_pm.h34
-rw-r--r--drivers/amvdec_ports/aml_vcodec_drv.h188
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.c34
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.h90
-rw-r--r--drivers/amvdec_ports/aml_vcodec_vfm.c28
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.c81
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.c133
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.c34
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg12_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.c178
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.c26
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/vdec_h264_if.c223
-rw-r--r--drivers/amvdec_ports/decoder/vdec_hevc_if.c194
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mjpeg_if.c210
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg12_if.c304
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg4_if.c209
-rw-r--r--drivers/amvdec_ports/decoder/vdec_vp9_if.c195
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.c6
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.h21
-rw-r--r--drivers/common/chips/chips.c1
-rw-r--r--drivers/common/chips/decoder_cpu_ver_info.c8
-rw-r--r--drivers/common/chips/decoder_cpu_ver_info.h1
-rw-r--r--drivers/common/firmware/firmware_drv.c9
-rw-r--r--drivers/common/firmware/firmware_type.c1
-rw-r--r--drivers/common/firmware/firmware_type.h1
-rw-r--r--drivers/common/media_clock/clk/clk.c3
-rw-r--r--drivers/common/media_clock/clk/clkg12.c5
-rw-r--r--drivers/frame_provider/decoder/Makefile1
-rw-r--r--drivers/frame_provider/decoder/avs/avs.c60
-rw-r--r--drivers/frame_provider/decoder/avs2/avs2_bufmgr.c12
-rw-r--r--drivers/frame_provider/decoder/avs2/avs2_global.h3
-rw-r--r--drivers/frame_provider/decoder/avs2/vavs2.c115
-rw-r--r--drivers/frame_provider/decoder/avs_multi/Makefile2
-rw-r--r--drivers/frame_provider/decoder/avs_multi/avs_multi.c1633
-rw-r--r--drivers/frame_provider/decoder/avs_multi/avsp_trans_multi.c5065
-rw-r--r--drivers/frame_provider/decoder/h264/vh264.c58
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.c50
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.h34
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c1043
-rw-r--r--drivers/frame_provider/decoder/h265/vh265.c707
-rw-r--r--drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c60
-rw-r--r--drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c595
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4.c5
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c80
-rw-r--r--drivers/frame_provider/decoder/utils/amvdec.c5
-rw-r--r--drivers/frame_provider/decoder/utils/frame_check.c178
-rw-r--r--drivers/frame_provider/decoder/utils/frame_check.h4
-rw-r--r--drivers/frame_provider/decoder/utils/vdec.c530
-rw-r--r--drivers/frame_provider/decoder/utils/vdec.h18
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.c12
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.h3
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.c92
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.h7
-rw-r--r--drivers/frame_provider/decoder/vav1/Makefile2
-rw-r--r--drivers/frame_provider/decoder/vav1/aom_av1_define.h171
-rw-r--r--drivers/frame_provider/decoder/vav1/av1_bufmgr.c3392
-rw-r--r--drivers/frame_provider/decoder/vav1/av1_global.h2310
-rw-r--r--drivers/frame_provider/decoder/vav1/vav1.c9946
-rw-r--r--drivers/frame_provider/decoder/vav1/vav1.h22
-rw-r--r--drivers/frame_provider/decoder/vc1/vvc1.c46
-rw-r--r--drivers/frame_provider/decoder/vp9/vvp9.c449
-rw-r--r--drivers/frame_sink/encoder/h264/encoder.c2
-rw-r--r--drivers/stream_input/Makefile5
-rw-r--r--drivers/stream_input/amports/amstream.c263
-rw-r--r--drivers/stream_input/parser/demux/aml_dvb.h5
-rw-r--r--drivers/stream_input/parser/demux/hw_demux/demod_gt.h62
-rw-r--r--drivers/stream_input/parser/demux/hw_demux/frontend.c293
-rw-r--r--drivers/stream_input/parser/dvb_common.c17
-rw-r--r--drivers/stream_input/parser/dvb_common.h26
-rw-r--r--drivers/stream_input/parser/esparser.c15
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_demod_gt.h87
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dmx.c270
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dvb.c445
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dvb.h32
-rw-r--r--drivers/stream_input/parser/streambuf.c9
-rw-r--r--drivers/stream_input/parser/tsdemux.c14
-rw-r--r--drivers/stream_input/parser/tsdemux.h1
-rw-r--r--drivers/stream_input/tv_frontend/Makefile16
-rw-r--r--drivers/stream_input/tv_frontend/aml_fe.c1372
-rw-r--r--drivers/stream_input/tv_frontend/aml_fe.h213
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_frontend.c791
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_func.c2163
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_func.h323
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/aml_demod.c725
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/amlfrontend.c1402
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/demod_func.c2996
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/dvbc_func.c1331
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/dvbt_func.c2188
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/i2c_func.c42
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/acf_filter_coefficient.h414
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_che.h77
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_che_bit.h266
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_front.h70
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_front_bit.h331
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_sync.h53
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_sync_bit.h110
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_top.h90
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_top_bit.h178
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/aml_dtv_demod_reg.h28
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/amlfrontend.h86
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/demod_func.h626
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/tuner_func.c189
-rw-r--r--firmware/video_ucode.bin14148
116 files changed, 25845 insertions, 36303 deletions
diff --git a/drivers/amvdec_ports/decoder/aml_h264_parser.c b/drivers/amvdec_ports/decoder/aml_h264_parser.c
index 602633b..d0d0198 100644
--- a/drivers/amvdec_ports/decoder/aml_h264_parser.c
+++ b/drivers/amvdec_ports/decoder/aml_h264_parser.c
@@ -162,7 +162,8 @@ static int decode_hrd_parameters(struct get_bits_context *gb,
cpb_count = get_ue_golomb_31(gb) + 1;
if (cpb_count > 32U) {
- pr_err("cpb_count %d invalid\n", cpb_count);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "cpb_count %d invalid\n", cpb_count);
return -1;
}
@@ -237,7 +238,7 @@ static int decode_vui_parameters(struct get_bits_context *gb, struct h264_SPS_t
}
if (show_bits1(gb) && get_bits_left(gb) < 10) {
- pr_info("Truncated VUI\n");
+ v4l_dbg(0, V4L_DEBUG_CODEC_PARSER, "Truncated VUI\n");
return 0;
}
@@ -246,7 +247,8 @@ static int decode_vui_parameters(struct get_bits_context *gb, struct h264_SPS_t
unsigned num_units_in_tick = get_bits_long(gb, 32);
unsigned time_scale = get_bits_long(gb, 32);
if (!num_units_in_tick || !time_scale) {
- pr_info("time_scale/num_units_in_tick invalid or unsupported (%u/%u)\n",
+ v4l_dbg(0, V4L_DEBUG_CODEC_PARSER,
+ "time_scale/num_units_in_tick invalid or unsupported (%u/%u)\n",
time_scale, num_units_in_tick);
sps->timing_info_present_flag = 0;
} else {
@@ -287,7 +289,8 @@ static int decode_vui_parameters(struct get_bits_context *gb, struct h264_SPS_t
if (sps->num_reorder_frames > 16U
/* max_dec_frame_buffering || max_dec_frame_buffering > 16 */) {
- pr_info("Clipping illegal num_reorder_frames %d\n",
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "Clipping illegal num_reorder_frames %d\n",
sps->num_reorder_frames);
sps->num_reorder_frames = 16;
return -1;
@@ -316,7 +319,8 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
sps_id = get_ue_golomb_31(gb);
if (sps_id >= MAX_SPS_COUNT) {
- pr_info( "sps_id %u out of range\n", sps_id);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "sps_id %u out of range\n", sps_id);
goto fail;
}
@@ -346,12 +350,14 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
sps->chroma_format_idc = get_ue_golomb_31(gb);
if (sps->chroma_format_idc > 3U) {
- pr_err("chroma_format_idc %u\n", sps->chroma_format_idc);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "chroma_format_idc %u\n", sps->chroma_format_idc);
goto fail;
} else if (sps->chroma_format_idc == 3) {
sps->residual_color_transform_flag = get_bits1(gb);
if (sps->residual_color_transform_flag) {
- pr_info( "separate color planes are not supported\n");
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "separate color planes are not supported\n");
goto fail;
}
}
@@ -359,14 +365,16 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
sps->bit_depth_luma = get_ue_golomb(gb) + 8;
sps->bit_depth_chroma = get_ue_golomb(gb) + 8;
if (sps->bit_depth_chroma != sps->bit_depth_luma) {
- pr_err("Different chroma and luma bit depth\n");
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "Different chroma and luma bit depth\n");
goto fail;
}
if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 14 ||
sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 14) {
- pr_info("illegal bit depth value (%d, %d)\n",
- sps->bit_depth_luma, sps->bit_depth_chroma);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "illegal bit depth value (%d, %d)\n",
+ sps->bit_depth_luma, sps->bit_depth_chroma);
goto fail;
}
@@ -385,9 +393,9 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
log2_max_frame_num_minus4 = get_ue_golomb(gb);
if (log2_max_frame_num_minus4 < MIN_LOG2_MAX_FRAME_NUM - 4 ||
log2_max_frame_num_minus4 > MAX_LOG2_MAX_FRAME_NUM - 4) {
- pr_info(
- "log2_max_frame_num_minus4 out of range (0-12): %d\n",
- log2_max_frame_num_minus4);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "log2_max_frame_num_minus4 out of range (0-12): %d\n",
+ log2_max_frame_num_minus4);
goto fail;
}
sps->log2_max_frame_num = log2_max_frame_num_minus4 + 4;
@@ -396,7 +404,8 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
if (sps->poc_type == 0) { // FIXME #define
u32 t = get_ue_golomb(gb);
if (t > 12) {
- pr_info( "log2_max_poc_lsb (%d) is out of range\n", t);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "log2_max_poc_lsb (%d) is out of range\n", t);
goto fail;
}
sps->log2_max_poc_lsb = t + 4;
@@ -407,20 +416,23 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
sps->poc_cycle_length = get_ue_golomb(gb);
if ((u32)sps->poc_cycle_length >= ARRAY_SIZE(sps->offset_for_ref_frame)) {
- pr_info("poc_cycle_length overflow %d\n", sps->poc_cycle_length);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "poc_cycle_length overflow %d\n", sps->poc_cycle_length);
goto fail;
}
for (i = 0; i < sps->poc_cycle_length; i++)
sps->offset_for_ref_frame[i] = get_se_golomb_long(gb);
} else if (sps->poc_type != 2) {
- pr_info( "illegal POC type %d\n", sps->poc_type);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "illegal POC type %d\n", sps->poc_type);
goto fail;
}
sps->ref_frame_count = get_ue_golomb_31(gb);
if (sps->ref_frame_count > MAX_DELAYED_PIC_COUNT) {
- pr_info("too many reference frames %d\n", sps->ref_frame_count);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "too many reference frames %d\n", sps->ref_frame_count);
goto fail;
}
sps->gaps_in_frame_num_allowed_flag = get_bits1(gb);
@@ -430,7 +442,7 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
sps->frame_mbs_only_flag = get_bits1(gb);
if (sps->mb_height >= INT_MAX / 2U) {
- pr_info("height overflow\n");
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR, "height overflow\n");
goto fail;
}
sps->mb_height *= 2 - sps->frame_mbs_only_flag;
@@ -442,7 +454,8 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
if ((u32)sps->mb_width >= INT_MAX / 16 ||
(u32)sps->mb_height >= INT_MAX / 16) {
- pr_info( "mb_width/height overflow\n");
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "mb_width/height overflow\n");
goto fail;
}
@@ -467,7 +480,9 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
crop_bottom > (u32)INT_MAX / 4 / step_y ||
(crop_left + crop_right ) * step_x >= width ||
(crop_top + crop_bottom) * step_y >= height) {
- pr_info( "crop values invalid %u %u %u %u / %d %d\n", crop_left, crop_right, crop_top, crop_bottom, width, height);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "crop values invalid %u %u %u %u / %d %d\n",
+ crop_left, crop_right, crop_top, crop_bottom, width, height);
goto fail;
}
@@ -491,8 +506,10 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
}
if (get_bits_left(gb) < 0) {
- pr_info("Overread %s by %d bits\n", sps->vui_parameters_present_flag ? "VUI" : "SPS", -get_bits_left(gb));
- goto out;
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "Overread %s by %d bits\n",
+ sps->vui_parameters_present_flag ? "VUI" : "SPS", -get_bits_left(gb));
+ /*goto out;*/
}
#if 0
@@ -527,16 +544,18 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s
(sps->max_dec_frame_buffering <
sps->num_reorder_frames)) {
sps->num_reorder_frames = sps->max_dec_frame_buffering;
- pr_info("set reorder_pic_num to %d\n",
+ v4l_dbg(0, V4L_DEBUG_CODEC_PARSER,
+ "set reorder_pic_num to %d\n",
sps->num_reorder_frames);
}
if (!sps->sar.den)
sps->sar.den = 1;
-out:
+/*out:*/
if (1) {
static const char csp[4][5] = { "Gray", "420", "422", "444" };
- pr_info("sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%u/%u/%u/%u %s %s %d/%d b%d reo:%d\n",
+ v4l_dbg(0, V4L_DEBUG_CODEC_PARSER,
+ "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%u/%u/%u/%u %s %s %d/%d b%d reo:%d\n",
sps_id, sps->profile_idc, sps->level_idc,
sps->poc_type,
sps->ref_frame_count,
@@ -625,14 +644,16 @@ static int decode_extradata_ps(u8 *data, int size, struct h264_param_sets *ps)
if (get_bits1(&gb) != 0) {
ret = -1;
- pr_err("invalid h264 data,return!\n");
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "invalid h264 data,return!\n");
goto out;
}
ref_idc = get_bits(&gb, 2);
nal_type = get_bits(&gb, 5);
- pr_info("nal_unit_type: %d(%s), nal_ref_idc: %d\n",
+ v4l_dbg(0, V4L_DEBUG_CODEC_PARSER,
+ "nal_unit_type: %d(%s), nal_ref_idc: %d\n",
nal_type, h264_nal_unit_name(nal_type), ref_idc);
switch (nal_type) {
@@ -649,7 +670,8 @@ static int decode_extradata_ps(u8 *data, int size, struct h264_param_sets *ps)
ps->pps_parsed = true;
break;*/
default:
- pr_err("Unsupport parser nal type (%s).\n",
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "Unsupport parser nal type (%s).\n",
h264_nal_unit_name(nal_type));
break;
}
@@ -672,7 +694,8 @@ int h264_decode_extradata_ps(u8 *buf, int size, struct h264_param_sets *ps)
len = size - (p - buf);
ret = decode_extradata_ps(p, len, ps);
if (ret) {
- pr_err("parse extra data failed. err: %d\n", ret);
+ v4l_dbg(0, V4L_DEBUG_CODEC_ERROR,
+ "parse extra data failed. err: %d\n", ret);
return ret;
}