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/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c
index 2258f75..56ee637 100644
--- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c
+++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c
@@ -94,6 +94,8 @@ static struct StorablePicture *get_new_pic(
struct h264_dpb_stru *p_H264_Dpb,
enum PictureStructure structure, unsigned char is_output);
+static void update_ref_list(struct DecodedPictureBuffer *p_Dpb);
+
static void init_dummy_fs(void)
{
dummy_fs.frame = &dummy_pic;
@@ -868,6 +870,7 @@ void fill_frame_num_gap(struct VideoParameters *p_Vid, struct Slice *currSlice)
CurrFrameNum = currSlice->frame_num; /*p_Vid->frame_num;*/
while (CurrFrameNum != UnusedShortTermFrameNum) {
+ /*pr_err("CurrFrameNum = %d, UnusedShortTermFrameNum = %d\n", CurrFrameNum, UnusedShortTermFrameNum);*/
/*picture = alloc_storable_picture
*(p_Vid, FRAME, p_Vid->width,
*p_Vid->height,
@@ -1057,14 +1060,14 @@ static void init_picture(struct h264_dpb_stru *p_H264_Dpb,
currSlice->picture_structure_mmco);
}
- if (currSlice->pic_struct >= 3)
- dec_picture->pic_struct = currSlice->pic_struct + 2;
- else if (currSlice->pic_struct == 1)
- dec_picture->pic_struct = PIC_TOP_BOT;
- else if (currSlice->pic_struct >= 2)
- dec_picture->pic_struct = PIC_BOT_TOP;
- else
+ if (currSlice->pic_struct < PIC_INVALID) {
+ dec_picture->pic_struct = currSlice->pic_struct;
+ } else {
dec_picture->pic_struct = PIC_INVALID;
+ }
+
+ dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL,
+ "%s pic_struct = %d\n", __func__, dec_picture->pic_struct);
}
void dump_pic(struct h264_dpb_stru *p_H264_Dpb)
@@ -1565,7 +1568,7 @@ static void dpb_combine_field(struct h264_dpb_stru *p_H264_Dpb,
fs->frame->view_id = fs->view_id;
#endif
fs->frame->iCodingType = fs->top_field->iCodingType;
- if (fs->top_field->poc < fs->bottom_field->poc) {
+ if (fs->bottom_field && fs->top_field->poc < fs->bottom_field->poc) {
fs->pts = fs->top_field->pts;
fs->pts64 = fs->top_field->pts64;
/*SWPL-7105 fix */
@@ -1575,7 +1578,7 @@ static void dpb_combine_field(struct h264_dpb_stru *p_H264_Dpb,
fs->pts64 = 0;
}
fs->offset_delimiter = fs->top_field->offset_delimiter;
- } else {
+ } else if (fs->bottom_field) {
fs->pts = fs->bottom_field->pts;
fs->pts64 = fs->bottom_field->pts64;
fs->offset_delimiter = fs->bottom_field->offset_delimiter;
@@ -1609,6 +1612,7 @@ static void insert_picture_in_dpb(struct h264_dpb_stru *p_H264_Dpb,
struct StorablePicture *p,
unsigned char data_flag)
{
+ struct vdec_frames_s *mvfrm = p_H264_Dpb->vdec->mvfrm;
struct VideoParameters *p_Vid = &p_H264_Dpb->mVideo;
/* InputParameters *p_Inp = p_Vid->p_Inp;
* dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL,
@@ -1621,6 +1625,8 @@ static void insert_picture_in_dpb(struct h264_dpb_stru *p_H264_Dpb,
*/
dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL,
"%s %p %p\n", __func__, fs, p);
+ p_H264_Dpb->dpb_frame_count++;
+ fs->dpb_frame_count = p_H264_Dpb->dpb_frame_count;
#if 1
/* rain */
/* p->buf_spec_num = fs->index; */
@@ -1756,6 +1762,10 @@ static void insert_picture_in_dpb(struct h264_dpb_stru *p_H264_Dpb,
//fs->pts64 = p->pts64;
}
fs->timestamp = p->timestamp;
+ if (mvfrm) {
+ fs->frame_size2 = mvfrm->frame_size;
+ fs->hw_decode_time = mvfrm->hw_decode_time;
+ }
}
void reset_frame_store(struct h264_dpb_stru *p_H264_Dpb,
@@ -1795,7 +1805,7 @@ void reset_frame_store(struct h264_dpb_stru *p_H264_Dpb,
}
}
-static void unmark_for_reference(struct DecodedPictureBuffer *p_Dpb,
+void unmark_for_reference(struct DecodedPictureBuffer *p_Dpb,
struct FrameStore *fs)
{
struct h264_dpb_stru *p_H264_Dpb = container_of(p_Dpb,
@@ -2117,6 +2127,7 @@ static int unmark_one_error_out_frame(struct h264_dpb_stru *p_H264_Dpb)
unmark_for_reference(p_Dpb, p_Dpb->fs[i]);
ret = 1;
+ break;
}
}
return ret;
@@ -2162,6 +2173,7 @@ void bufmgr_h264_remove_unused_frame(struct h264_dpb_stru *p_H264_Dpb,
dpb_print(p_H264_Dpb->decoder_index,
0, "%s, Warnning, force unmark one frame\r\n",
__func__);
+ update_ref_list(p_Dpb);
remove_unused_frame_from_dpb(p_H264_Dpb);
dump_dpb(p_Dpb, 0);
}
@@ -2170,6 +2182,7 @@ void bufmgr_h264_remove_unused_frame(struct h264_dpb_stru *p_H264_Dpb,
dpb_print(p_H264_Dpb->decoder_index,
0, "%s, unmark error frame\r\n",
__func__);
+ update_ref_list(p_Dpb);
remove_unused_frame_from_dpb(p_H264_Dpb);
dump_dpb(p_Dpb, 0);
}
@@ -2238,16 +2251,19 @@ int output_frames(struct h264_dpb_stru *p_H264_Dpb, unsigned char flush_flag)
(!p_Dpb->fs[i]->pre_output) &&((p_Dpb->fs[i]->is_used == 3
||p_Dpb->fs[i]->data_flag & ERROR_FLAG ))) {
none_displayed_num++;
- if ((p_H264_Dpb->first_insert_frame == FirstInsertFrm_IDLE)
+ if ((p_H264_Dpb->first_insert_frame == FirstInsertFrm_IDLE ||
+ p_H264_Dpb->first_insert_frame == FirstInsertFrm_RESET)
&& (p_Dpb->fs[i]->is_used == 3)
&& (p_Dpb->last_output_poc == INT_MIN)) {
+ if (p_H264_Dpb->first_insert_frame == FirstInsertFrm_IDLE)
+ fast_output_flag = 1;
p_H264_Dpb->first_insert_frame = FirstInsertFrm_OUT;
p_H264_Dpb->first_output_poc = p_Dpb->fs[i]->poc;
- fast_output_flag = 1;
dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL,
"%s first insert frame i %d poc %d frame_num %x\n",
__func__, i, p_Dpb->fs[i]->poc, p_Dpb->fs[i]->frame_num);
}
+
/*check poc even/odd*/
if (p_H264_Dpb->poc_even_odd_flag == 0 &&
p_H264_Dpb->decode_pic_count >= 3)
@@ -2695,6 +2711,11 @@ void dump_dpb(struct DecodedPictureBuffer *p_Dpb, u8 force)
0,
"non_existing ");
}
+ dpb_print_cont(p_H264_Dpb->decoder_index,
+ 0,
+ "dpb_frame_count %d ",
+ p_Dpb->fs[i]->dpb_frame_count);
+
#if (MVC_EXTENSION_ENABLE)
if (p_Dpb->fs[i]->is_reference)
dpb_print_cont(p_H264_Dpb->decoder_index,
@@ -3504,6 +3525,8 @@ int store_picture_in_dpb(struct h264_dpb_stru *p_H264_Dpb,
p_Vid->last_pic_bottom_field = (p->structure == BOTTOM_FIELD);
if (p->idr_flag) {
idr_memory_management(p_H264_Dpb, p);
+ if (p_H264_Dpb->first_insert_frame == FirstInsertFrm_OUT)
+ p_H264_Dpb->first_insert_frame = FirstInsertFrm_SKIPDONE;
#if 0
/* ??? */
/* picture error concealment */
@@ -5682,7 +5705,7 @@ static void check_frame_store_same_pic_num(struct DecodedPictureBuffer *p_Dpb,
}
}
-int h264_slice_header_process(struct h264_dpb_stru *p_H264_Dpb)
+int h264_slice_header_process(struct h264_dpb_stru *p_H264_Dpb, int *frame_num_gap)
{
int new_pic_flag = 0;
@@ -5750,6 +5773,7 @@ int h264_slice_header_process(struct h264_dpb_stru *p_H264_Dpb)
*if (p_Vid->conceal_mode == 0)
*/
fill_frame_num_gap(p_Vid, currSlice);
+ *frame_num_gap = 1;
}
if (currSlice->nal_reference_idc) {