decoder: revert SWPL-31491 tr135. [1/3]
authorwenlong.yuan <wenlong.yuan@amlogic.com>
Thu, 20 Aug 2020 12:24:37 +0000 (20:24 +0800)
committerwenlong.yuan <wenlong.yuan@amlogic.com>
Thu, 20 Aug 2020 12:24:43 +0000 (20:24 +0800)
PD#SWPL-31491

Problem:
need add detail video parameter counter for iptv and ott.

Solution:
add the video parameters for multi decoder,use vdec.c func
vdec_fill_vdec_frame to add video info and use amstream.c
ioctl index AMSTREAM_IOC_GET_MVDECINFO to get the video info.

Verify:
905X2-U212

Change-Id: I9a9dc413ce7553510af6c9573fb600eb4da02c8f
Signed-off-by: wenlong.yuan <wenlong.yuan@amlogic.com>
drivers/frame_provider/decoder/avs2/vavs2.c
drivers/frame_provider/decoder/avs_multi/avs_multi.c
drivers/frame_provider/decoder/h264_multi/vmh264.c
drivers/frame_provider/decoder/h265/vh265.c
drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c
drivers/frame_provider/decoder/utils/vdec.c
drivers/frame_provider/decoder/utils/vdec.h
drivers/frame_provider/decoder/vp9/vvp9.c
drivers/stream_input/amports/amstream.c

index 001c86f079f8f5a8432fdf820e990cafa3a82b84..8b03a3c6dbd2e4124268afe1af82acb25c8a0245 100644 (file)
@@ -4553,8 +4553,7 @@ static inline void dec_update_gvs(struct AVS2Decoder_s *dec)
        if (dec->gvs->frame_dur != dec->frame_dur) {
                dec->gvs->frame_dur = dec->frame_dur;
                if (dec->frame_dur != 0)
-                       dec->gvs->frame_rate = ((96000 * 10 / dec->frame_dur) % 10) < 5 ?
-                                       96000 / dec->frame_dur : (96000 / dec->frame_dur +1);
+                       dec->gvs->frame_rate = 96000 / dec->frame_dur;
                else
                        dec->gvs->frame_rate = -1;
        }
@@ -4613,15 +4612,6 @@ static int avs2_prepare_display_buf(struct AVS2Decoder_s *dec)
                        dec_update_gvs(dec);
                        /*count info*/
                        vdec_count_info(dec->gvs, 0, stream_offset);
-               if (stream_offset) {
-                       if (pic->slice_type == I_IMG) {
-                               dec->gvs->i_decoded_frames++;
-                       } else if (pic->slice_type == P_IMG) {
-                               dec->gvs->p_decoded_frames++;
-                       } else if (pic->slice_type == B_IMG) {
-                               dec->gvs->b_decoded_frames++;
-                       }
-               }
                        memcpy(&tmp4x, dec->gvs, sizeof(struct vdec_info));
                        tmp4x.bit_depth_luma = bit_depth_luma;
                        tmp4x.bit_depth_chroma = bit_depth_chroma;
@@ -6155,8 +6145,7 @@ int vavs2_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_height = dec->frame_height;
 
        if (dec->frame_dur != 0)
-               vstatus->frame_rate = ((96000 * 10 / dec->frame_dur) % 10) < 5 ?
-                                   96000 / dec->frame_dur : (96000 / dec->frame_dur +1);
+               vstatus->frame_rate = 96000 / dec->frame_dur;
        else
                vstatus->frame_rate = -1;
        vstatus->error_count = 0;
@@ -6168,15 +6157,6 @@ int vavs2_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_count = dec->gvs->frame_count;
        vstatus->error_frame_count = dec->gvs->error_frame_count;
        vstatus->drop_frame_count = dec->gvs->drop_frame_count;
-       vstatus->i_decoded_frames = dec->gvs->i_decoded_frames;
-       vstatus->i_lost_frames =  dec->gvs->i_lost_frames;
-       vstatus->i_concealed_frames =  dec->gvs->i_concealed_frames;
-       vstatus->p_decoded_frames =  dec->gvs->p_decoded_frames;
-       vstatus->p_lost_frames =  dec->gvs->p_lost_frames;
-       vstatus->p_concealed_frames =  dec->gvs->p_concealed_frames;
-       vstatus->b_decoded_frames =  dec->gvs->b_decoded_frames;
-       vstatus->b_lost_frames =  dec->gvs->b_lost_frames;
-       vstatus->b_concealed_frames =  dec->gvs->b_concealed_frames;
        vstatus->total_data = dec->gvs->total_data;
        vstatus->samp_cnt = dec->gvs->samp_cnt;
        vstatus->offset = dec->gvs->offset;
index 5ecbfd09e3925f8215366942aed8c88e4114670c..f8a4b1b3fda5f6f11cfa8fe6efad3813230bc04c 100644 (file)
@@ -920,8 +920,7 @@ static inline void avs_update_gvs(struct vdec_avs_hw_s *hw)
        if (hw->gvs->frame_dur != hw->frame_dur) {
                hw->gvs->frame_dur = hw->frame_dur;
                if (hw->frame_dur != 0)
-                       hw->gvs->frame_rate = ((96000 * 10 / hw->frame_dur) % 10) < 5 ?
-                                       96000 / hw->frame_dur : (96000 / hw->frame_dur +1);
+                       hw->gvs->frame_rate = 96000 / hw->frame_dur;
                else
                        hw->gvs->frame_rate = -1;
        }
@@ -1396,15 +1395,6 @@ static void vavs_isr(void)
 
                /*count info*/
                vdec_count_info(hw->gvs, 0, offset);
-               if (offset) {
-                       if (picture_type == I_PICTURE) {
-                               hw->gvs->i_decoded_frames++;
-                       } else if (picture_type == P_PICTURE) {
-                               hw->gvs->p_decoded_frames++;
-                       } else if (picture_type == B_PICTURE) {
-                               hw->gvs->b_decoded_frames++;
-                       }
-               }
                avs_update_gvs(hw);
                vdec_fill_vdec_frame(hw_to_vdec(hw), NULL, hw->gvs, vf, 0);
 
@@ -1626,8 +1616,7 @@ static int vavs_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_width = hw->frame_width;
        vstatus->frame_height = hw->frame_height;
        if (hw->frame_dur != 0)
-               vstatus->frame_rate = ((96000 * 10 / hw->frame_dur) % 10) < 5 ?
-                               96000 / hw->frame_dur : (96000 / hw->frame_dur +1);
+               vstatus->frame_rate = 96000 / hw->frame_dur;
        else
                vstatus->frame_rate = -1;
        vstatus->error_count = READ_VREG(AV_SCRATCH_C);
@@ -1639,15 +1628,6 @@ static int vavs_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_count = hw->gvs->frame_count;
        vstatus->error_frame_count = hw->gvs->error_frame_count;
        vstatus->drop_frame_count = hw->gvs->drop_frame_count;
-       vstatus->i_decoded_frames = hw->gvs->i_decoded_frames;
-       vstatus->i_lost_frames = hw->gvs->i_lost_frames;
-       vstatus->i_concealed_frames = hw->gvs->i_concealed_frames;
-       vstatus->p_decoded_frames = hw->gvs->p_decoded_frames;
-       vstatus->p_lost_frames = hw->gvs->p_lost_frames;
-       vstatus->p_concealed_frames = hw->gvs->p_concealed_frames;
-       vstatus->b_decoded_frames = hw->gvs->b_decoded_frames;
-       vstatus->b_lost_frames = hw->gvs->b_lost_frames;
-       vstatus->b_concealed_frames = hw->gvs->b_concealed_frames;
        vstatus->total_data = hw->gvs->total_data;
        vstatus->samp_cnt = hw->gvs->samp_cnt;
        vstatus->offset = hw->gvs->offset;
index 209208e82c1176ba6c584b26b953dfc57f10d901..2353767dd322005350fc1f5ff6fd1ee7b9e8b726 100644 (file)
@@ -2795,24 +2795,8 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame)
 
        if (frame->data_flag & ERROR_FLAG) {
                vdec_count_info(&hw->gvs, 1, 0);
-               if (frame->slice_type == I_SLICE) {
-                       hw->gvs.i_concealed_frames++;
-               } else if (frame->slice_type == P_SLICE) {
-                       hw->gvs.p_concealed_frames++;
-               } else if (frame->slice_type == B_SLICE) {
-                       hw->gvs.b_concealed_frames++;
-               }
-               if (!hw->send_error_frame_flag) {
+               if (!hw->send_error_frame_flag)
                        hw->gvs.drop_frame_count++;
-                       if (frame->slice_type == I_SLICE) {
-                               hw->gvs.i_lost_frames++;
-                       } else if (frame->slice_type == P_SLICE) {
-                               hw->gvs.p_lost_frames++;
-                       } else if (frame->slice_type == B_SLICE) {
-                               hw->gvs.b_lost_frames++;
-                       }
-               }
-
        }
 
        if ((frame->data_flag & NODISP_FLAG) ||
@@ -3023,10 +3007,6 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame)
                        pvdec->dec_status(pvdec, &vs);
                        decoder_do_frame_check(pvdec, vf);
                        vdec_fill_vdec_frame(pvdec, &hw->vframe_qos, &vs, vf, frame->hw_decode_time);
-
-                       dpb_print(DECODE_ID(hw), PRINT_FLAG_DPB_DETAIL,
-                       "[%s:%d] i_decoded_frame = %d p_decoded_frame = %d b_decoded_frame = %d\n",
-                       __func__, __LINE__,vs.i_decoded_frames,vs.p_decoded_frames,vs.b_decoded_frames);
                }
 
                /*vf->ratio_control |= (0x3FF << DISP_RATIO_ASPECT_RATIO_BIT);*/
@@ -6504,13 +6484,6 @@ pic_done_proc:
                        hw->get_data_count = 0x7fffffff;
                        WRITE_VREG(DPB_STATUS_REG, H264_ACTION_SEARCH_HEAD);
                        decode_frame_count[DECODE_ID(hw)]++;
-                       if (p_H264_Dpb->mSlice.slice_type == I_SLICE) {
-                               hw->gvs.i_decoded_frames++;
-                       } else if (p_H264_Dpb->mSlice.slice_type == P_SLICE) {
-                               hw->gvs.p_decoded_frames++;
-                       } else if (p_H264_Dpb->mSlice.slice_type == B_SLICE) {
-                               hw->gvs.b_decoded_frames++;
-                       }
                        start_process_time(hw);
                        return IRQ_HANDLED;
                }
@@ -7185,8 +7158,7 @@ static int dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_height = hw->frame_height;
        if (hw->frame_dur != 0) {
                vstatus->frame_dur = hw->frame_dur;
-               vstatus->frame_rate = ((96000 * 10 / hw->frame_dur) % 10) < 5 ?
-                                   96000 / hw->frame_dur : (96000 / hw->frame_dur +1);
+               vstatus->frame_rate = 96000 / hw->frame_dur;
        }
        else
                vstatus->frame_rate = -1;
@@ -7207,15 +7179,6 @@ static int dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->error_frame_count = hw->gvs.error_frame_count;
        vstatus->drop_frame_count = hw->gvs.drop_frame_count;
        vstatus->frame_count = decode_frame_count[DECODE_ID(hw)];
-       vstatus->i_decoded_frames = hw->gvs.i_decoded_frames;
-       vstatus->i_lost_frames = hw->gvs.i_lost_frames;
-       vstatus->i_concealed_frames = hw->gvs.i_concealed_frames;
-       vstatus->p_decoded_frames = hw->gvs.p_decoded_frames;
-       vstatus->p_lost_frames = hw->gvs.p_lost_frames;
-       vstatus->p_concealed_frames = hw->gvs.p_concealed_frames;
-       vstatus->b_decoded_frames = hw->gvs.b_decoded_frames;
-       vstatus->b_lost_frames = hw->gvs.b_lost_frames;
-       vstatus->b_concealed_frames = hw->gvs.b_concealed_frames;
        snprintf(vstatus->vdec_name, sizeof(vstatus->vdec_name),
                "%s-%02d", DRIVER_NAME, hw->id);
 
@@ -8831,13 +8794,6 @@ result_done:
                                }
                        }
                decode_frame_count[DECODE_ID(hw)]++;
-               if (hw->dpb.mSlice.slice_type == I_SLICE) {
-                       hw->gvs.i_decoded_frames++;
-               } else if (hw->dpb.mSlice.slice_type == P_SLICE) {
-                       hw->gvs.p_decoded_frames++;
-               } else if (hw->dpb.mSlice.slice_type == B_SLICE) {
-                       hw->gvs.b_decoded_frames++;
-               }
                amvdec_stop();
                if (!vdec_is_support_4k()) {
                        if (clk_adj_frame_count < VDEC_CLOCK_ADJUST_FRAME) {
index 00172789e00e2d8866893cb05083217e50f58aa7..33164ec89ea1aa3776f9680669d9a0ed39f6a761 100644 (file)
@@ -6008,22 +6008,8 @@ static void flush_output(struct hevc_state_s *hevc, struct PIC_s *pic)
                                 * the drop count
                                 */
                                hevc->gvs->drop_frame_count++;
-                               if (pic_display->slice_type == I_SLICE) {
-                                       hevc->gvs->i_lost_frames++;
-                               } else if (pic_display->slice_type == P_SLICE) {
-                                       hevc->gvs->p_lost_frames++;
-                               } else if (pic_display->slice_type == B_SLICE) {
-                                       hevc->gvs->b_lost_frames++;
-                               }
                                /* error frame count also need increase */
                                hevc->gvs->error_frame_count++;
-                               if (pic_display->slice_type == I_SLICE) {
-                                       hevc->gvs->i_concealed_frames++;
-                               } else if (pic_display->slice_type == P_SLICE) {
-                                       hevc->gvs->p_concealed_frames++;
-                               } else if (pic_display->slice_type == B_SLICE) {
-                                       hevc->gvs->b_concealed_frames++;
-                               }
                        } else {
                                if (hevc->i_only & 0x1
                                        && pic_display->slice_type != 2) {
@@ -6330,22 +6316,8 @@ static inline void hevc_pre_pic(struct hevc_state_s *hevc,
                                         * the drop count
                                         */
                                        hevc->gvs->drop_frame_count++;
-                                       if (pic_display->slice_type == I_SLICE) {
-                                               hevc->gvs->i_lost_frames++;
-                                       }else if (pic_display->slice_type == P_SLICE) {
-                                               hevc->gvs->p_lost_frames++;
-                                       } else if (pic_display->slice_type == B_SLICE) {
-                                               hevc->gvs->b_lost_frames++;
-                                       }
                                        /* error frame count also need increase */
                                        hevc->gvs->error_frame_count++;
-                                       if (pic_display->slice_type == I_SLICE) {
-                                               hevc->gvs->i_concealed_frames++;
-                                       } else if (pic_display->slice_type == P_SLICE) {
-                                               hevc->gvs->p_concealed_frames++;
-                                       } else if (pic_display->slice_type == B_SLICE) {
-                                               hevc->gvs->b_concealed_frames++;
-                                       }
                                } else {
                                        if (hevc->i_only & 0x1
                                                && pic_display->
@@ -7527,33 +7499,9 @@ static int hevc_slice_segment_header_process(struct hevc_state_s *hevc,
                                /*count info*/
                                vdec_count_info(hevc->gvs, hevc->cur_pic->error_mark,
                                        hevc->cur_pic->stream_offset);
-                               if (hevc->cur_pic->slice_type == I_SLICE) {
-                                       hevc->gvs->i_decoded_frames++;
-                               } else if (hevc->cur_pic->slice_type == P_SLICE) {
-                                       hevc->gvs->p_decoded_frames++;
-                               } else if (hevc->cur_pic->slice_type == B_SLICE) {
-                                       hevc->gvs->b_decoded_frames++;
-                               }
-                       if (hevc->cur_pic->error_mark) {
-                               if (hevc->cur_pic->slice_type == I_SLICE) {
-                                       hevc->gvs->i_concealed_frames++;
-                               } else if (hevc->cur_pic->slice_type == P_SLICE) {
-                                       hevc->gvs->p_concealed_frames++;
-                               } else if (hevc->cur_pic->slice_type == B_SLICE) {
-                                       hevc->gvs->b_concealed_frames++;
-                               }
-                       }
-                       if (hevc->PB_skip_mode == 2) {
-                               hevc->gvs->drop_frame_count++;
-                               if (rpm_param->p.slice_type == I_SLICE) {
-                                       hevc->gvs->i_lost_frames++;
-                               } else if (rpm_param->p.slice_type == P_SLICE) {
-                                       hevc->gvs->p_lost_frames++;
-                               } else if (rpm_param->p.slice_type == B_SLICE) {
-                                       hevc->gvs->b_lost_frames++;
-                               }
+                               if (hevc->PB_skip_mode == 2)
+                                       hevc->gvs->drop_frame_count++;
                        }
-               }
 
                        if (is_skip_decoding(hevc,
                                hevc->cur_pic)) {
@@ -7583,32 +7531,8 @@ static int hevc_slice_segment_header_process(struct hevc_state_s *hevc,
                /*count info*/
                vdec_count_info(hevc->gvs, hevc->cur_pic->error_mark,
                        hevc->cur_pic->stream_offset);
-               if (hevc->cur_pic->slice_type == I_SLICE) {
-                       hevc->gvs->i_decoded_frames++;
-               } else if (hevc->cur_pic->slice_type == P_SLICE) {
-                       hevc->gvs->p_decoded_frames++;
-               } else if (hevc->cur_pic->slice_type == B_SLICE) {
-                       hevc->gvs->b_decoded_frames++;
-               }
-               if (hevc->cur_pic->error_mark) {
-                       if (hevc->cur_pic->slice_type == I_SLICE) {
-                               hevc->gvs->i_concealed_frames++;
-                       } else if (hevc->cur_pic->slice_type == P_SLICE) {
-                               hevc->gvs->p_concealed_frames++;
-                       } else if (hevc->cur_pic->slice_type == B_SLICE) {
-                               hevc->gvs->b_concealed_frames++;
-                       }
-               }
-               if (hevc->PB_skip_mode == 2) {
+               if (hevc->PB_skip_mode == 2)
                        hevc->gvs->drop_frame_count++;
-                       if (rpm_param->p.slice_type == I_SLICE) {
-                               hevc->gvs->i_lost_frames++;
-                       } else if (rpm_param->p.slice_type == P_SLICE) {
-                               hevc->gvs->p_lost_frames++;
-                       } else if (rpm_param->p.slice_type == B_SLICE) {
-                               hevc->gvs->b_lost_frames++;
-                       }
-               }
                return 2;
        }
 #ifdef MCRCC_ENABLE
@@ -8846,8 +8770,7 @@ static inline void hevc_update_gvs(struct hevc_state_s *hevc)
        if (hevc->gvs->frame_dur != hevc->frame_dur) {
                hevc->gvs->frame_dur = hevc->frame_dur;
                if (hevc->frame_dur != 0)
-                       hevc->gvs->frame_rate = ((96000 * 10 / hevc->frame_dur) % 10) < 5 ?
-                                       96000 / hevc->frame_dur : (96000 / hevc->frame_dur +1);
+                       hevc->gvs->frame_rate = 96000 / hevc->frame_dur;
                else
                        hevc->gvs->frame_rate = -1;
        }
@@ -9419,13 +9342,6 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic)
 #endif
                /*count info*/
                vdec_count_info(hevc->gvs, 0, stream_offset);
-               if (hevc->cur_pic->slice_type == I_SLICE) {
-                       hevc->gvs->i_decoded_frames++;
-               } else if (hevc->cur_pic->slice_type == P_SLICE) {
-                       hevc->gvs->p_decoded_frames++;
-               } else if (hevc->cur_pic->slice_type == B_SLICE) {
-                       hevc->gvs->b_decoded_frames++;
-               }
                hevc_update_gvs(hevc);
                memcpy(&tmp4x, hevc->gvs, sizeof(struct vdec_info));
                tmp4x.bit_depth_luma = hevc->bit_depth_luma;
@@ -10883,13 +10799,6 @@ force_output:
        } else {
                /* skip, search next start code */
                hevc->gvs->drop_frame_count++;
-               if (hevc->cur_pic->slice_type == I_SLICE) {
-                       hevc->gvs->i_lost_frames++;
-               } else if (hevc->cur_pic->slice_type == P_SLICE) {
-                       hevc->gvs->i_lost_frames++;
-               } else if (hevc->cur_pic->slice_type == B_SLICE) {
-                       hevc->gvs->i_lost_frames++;
-               }
                WRITE_VREG(HEVC_WAIT_FLAG, READ_VREG(HEVC_WAIT_FLAG) & (~0x2));
                        hevc->skip_flag = 1;
                WRITE_VREG(HEVC_DEC_STATUS_REG, HEVC_ACTION_DONE);
@@ -11336,8 +11245,7 @@ int vh265_dec_status(struct vdec_info *vstatus)
        vstatus->frame_height =
                (hevc->frame_height << hevc->interlace_flag);
        if (hevc->frame_dur != 0)
-               vstatus->frame_rate = ((96000 * 10 / hevc->frame_dur) % 10) < 5 ?
-                               96000 / hevc->frame_dur : (96000 / hevc->frame_dur +1);
+               vstatus->frame_rate = 96000 / hevc->frame_dur;
        else
                vstatus->frame_rate = -1;
        vstatus->error_count = hevc->gvs->error_frame_count;
@@ -11351,15 +11259,6 @@ int vh265_dec_status(struct vdec_info *vstatus)
                vstatus->frame_count = hevc->gvs->frame_count;
                vstatus->error_frame_count = hevc->gvs->error_frame_count;
                vstatus->drop_frame_count = hevc->gvs->drop_frame_count;
-               vstatus->i_decoded_frames = hevc->gvs->i_decoded_frames;
-               vstatus->i_lost_frames = hevc->gvs->i_lost_frames;
-               vstatus->i_concealed_frames = hevc->gvs->i_concealed_frames;
-               vstatus->p_decoded_frames = hevc->gvs->p_decoded_frames;
-               vstatus->p_lost_frames = hevc->gvs->p_lost_frames;
-               vstatus->p_concealed_frames = hevc->gvs->p_concealed_frames;
-               vstatus->b_decoded_frames = hevc->gvs->b_decoded_frames;
-               vstatus->b_lost_frames = hevc->gvs->b_lost_frames;
-               vstatus->b_concealed_frames = hevc->gvs->b_concealed_frames;
                vstatus->samp_cnt = hevc->gvs->samp_cnt;
                vstatus->offset = hevc->gvs->offset;
        }
index d0f2996fa955bc2e59627517380027bf8209e8df..ef45eb8d3ec545aef8d414f2256a1c8e53539d13 100644 (file)
@@ -1518,8 +1518,7 @@ static inline void hw_update_gvs(struct vdec_mpeg12_hw_s *hw)
        if (hw->gvs.frame_dur != hw->frame_dur) {
                hw->gvs.frame_dur = hw->frame_dur;
                if (hw->frame_dur != 0)
-                       hw->gvs.frame_rate = ((96000 * 10 / hw->frame_dur) % 10) < 5 ?
-                                       96000 / hw->frame_dur : (96000 / hw->frame_dur +1);
+                       hw->gvs.frame_rate = 96000 / hw->frame_dur;
                else
                        hw->gvs.frame_rate = -1;
        }
@@ -1643,27 +1642,12 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw,
                        ((PICINFO_TYPE_MASK & pic->buffer_info) !=
                         PICINFO_TYPE_I))) {
                        hw->drop_frame_count++;
-                       if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_I) {
-                               hw->gvs.i_lost_frames++;
-                       } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_P) {
-                               hw->gvs.p_lost_frames++;
-                       } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_B) {
-                               hw->gvs.b_lost_frames++;
-                       }
                        /* Though we drop it, it is still an error frame, count it.
                         * Becase we've counted the error frame in vdec_count_info
                         * function, avoid count it twice.
                         */
-               if (!(info & PICINFO_ERROR)) {
-                       hw->gvs.error_frame_count++;
-                       if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_I) {
-                               hw->gvs.i_concealed_frames++;
-                       } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_P) {
-                               hw->gvs.p_concealed_frames++;
-                       } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_B) {
-                               hw->gvs.b_concealed_frames++;
-                       }
-               }
+                       if (!(info & PICINFO_ERROR))
+                               hw->gvs.error_frame_count++;
                        hw->vfbuf_use[index]--;
                        kfifo_put(&hw->newframe_q,
                                (const struct vframe_s *)vf);
@@ -2076,24 +2060,6 @@ static irqreturn_t vmpeg12_isr(struct vdec_s *vdec, int irq)
        offset = READ_VREG(MREG_FRAME_OFFSET);
 
        vdec_count_info(&hw->gvs, info & PICINFO_ERROR, offset);
-       if (info &PICINFO_ERROR) {
-               if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_I) {
-                       hw->gvs.i_concealed_frames++;
-               } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_P) {
-                       hw->gvs.p_concealed_frames++;
-               } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_B) {
-                       hw->gvs.b_concealed_frames++;
-               }
-       }
-       if (offset) {
-               if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_I) {
-                       hw->gvs.i_decoded_frames++;
-               } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_P) {
-                       hw->gvs.p_decoded_frames++;
-               } else if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_B) {
-                       hw->gvs.b_decoded_frames++;
-               }
-       }
 
        WRITE_VREG(ASSIST_MBOX1_CLR_REG, 1);
 
@@ -2452,8 +2418,7 @@ static int vmmpeg12_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_width = hw->frame_width;
        vstatus->frame_height = hw->frame_height;
        if (hw->frame_dur != 0)
-               vstatus->frame_rate = ((96000 * 10 / hw->frame_dur) % 10) < 5 ?
-                                   96000 / hw->frame_dur : (96000 / hw->frame_dur +1);
+               vstatus->frame_rate = 96000 / hw->frame_dur;
        else
                vstatus->frame_rate = -1;
        vstatus->error_count = READ_VREG(AV_SCRATCH_C);
@@ -2465,15 +2430,6 @@ static int vmmpeg12_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_count = hw->gvs.frame_count;
        vstatus->error_frame_count = hw->gvs.error_frame_count;
        vstatus->drop_frame_count = hw->drop_frame_count;
-       vstatus->i_decoded_frames = hw->gvs.i_decoded_frames;
-       vstatus->i_lost_frames = hw->gvs.i_lost_frames;
-       vstatus->i_concealed_frames = hw->gvs.i_concealed_frames;
-       vstatus->p_decoded_frames = hw->gvs.p_decoded_frames;
-       vstatus->p_lost_frames = hw->gvs.p_lost_frames;
-       vstatus->p_concealed_frames = hw->gvs.p_concealed_frames;
-       vstatus->b_decoded_frames = hw->gvs.b_decoded_frames;
-       vstatus->b_lost_frames = hw->gvs.b_lost_frames;
-       vstatus->b_concealed_frames = hw->gvs.b_concealed_frames;
        vstatus->total_data = hw->gvs.total_data;
        vstatus->samp_cnt = hw->gvs.samp_cnt;
        vstatus->offset = hw->gvs.offset;
index 8dbc255458bf77aca338e15f5a44acfa49eb0d1f..0bb416c7c63b75ccfe6df8ac2cdcdb67b110aa02 100644 (file)
@@ -318,15 +318,6 @@ struct vdec_mpeg4_hw_s {
        int sidebind_type;
        int sidebind_channel_id;
        unsigned int res_ch_flag;
-       unsigned int i_decoded_frames;
-       unsigned int i_lost_frames;
-       unsigned int i_concealed_frames;
-       unsigned int p_decoded_frames;
-       unsigned int p_lost_frames;
-       unsigned int p_concealed_frames;
-       unsigned int b_decoded_frames;
-       unsigned int b_lost_frames;
-       unsigned int b_concealed_frames;
 };
 static void vmpeg4_local_init(struct vdec_mpeg4_hw_s *hw);
 static int vmpeg4_hw_ctx_restore(struct vdec_mpeg4_hw_s *hw);
@@ -718,13 +709,6 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                if (((hw->first_i_frame_ready == 0) || pb_skip)
                         && (pic->pic_type != I_PICTURE)) {
                        hw->drop_frame_count++;
-                       if (pic->pic_type == I_PICTURE) {
-                               hw->i_lost_frames++;
-                       } else if (pic->pic_type == P_PICTURE) {
-                               hw->p_lost_frames++;
-                       } else if (pic->pic_type == B_PICTURE) {
-                               hw->b_lost_frames++;
-                       }
                        hw->vfbuf_use[index]--;
                        kfifo_put(&hw->newframe_q,
                                (const struct vframe_s *)vf);
@@ -738,13 +722,6 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                        ATRACE_COUNTER(MODULE_NAME, vf->pts);
                        vdec->vdec_fps_detec(vdec->id);
                        hw->frame_num++;
-                       if (pic->pic_type == I_PICTURE) {
-                               hw->i_decoded_frames++;
-                       } else if (pic->pic_type == P_PICTURE) {
-                               hw->p_decoded_frames++;
-                       } else if (pic->pic_type == B_PICTURE) {
-                               hw->b_decoded_frames++;
-                       }
                        if (without_display_mode == 0) {
                                vf_notify_receiver(vdec->vf_provider_name,
                                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
@@ -783,13 +760,6 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                if (((hw->first_i_frame_ready == 0) || pb_skip)
                        && (pic->pic_type != I_PICTURE)) {
                        hw->drop_frame_count++;
-                       if (pic->pic_type == I_PICTURE) {
-                               hw->i_lost_frames++;
-                       } else if (pic->pic_type == P_PICTURE) {
-                               hw->p_lost_frames++;
-                       } else if (pic->pic_type == B_PICTURE) {
-                               hw->b_lost_frames++;
-                       }
                        hw->vfbuf_use[index]--;
                        kfifo_put(&hw->newframe_q,
                                (const struct vframe_s *)vf);
@@ -803,13 +773,6 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                        vdec->vdec_fps_detec(vdec->id);
                        decoder_do_frame_check(vdec, vf);
                        hw->frame_num++;
-                       if (pic->pic_type == I_PICTURE) {
-                               hw->i_decoded_frames++;
-                       } else if (pic->pic_type == P_PICTURE) {
-                               hw->p_decoded_frames++;
-                       } else if (pic->pic_type == B_PICTURE) {
-                               hw->b_decoded_frames++;
-                       }
                        if (without_display_mode == 0) {
                                vf_notify_receiver(vdec->vf_provider_name,
                                        VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
@@ -862,13 +825,6 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                if (((hw->first_i_frame_ready == 0) || pb_skip)
                        && (pic->pic_type != I_PICTURE)) {
                        hw->drop_frame_count++;
-                       if (pic->pic_type == I_PICTURE) {
-                               hw->i_lost_frames++;
-                       } else if (pic->pic_type == P_PICTURE) {
-                               hw->p_lost_frames++;
-                       } else if (pic->pic_type == B_PICTURE) {
-                               hw->b_lost_frames++;
-                       }
                        hw->vfbuf_use[index]--;
                        kfifo_put(&hw->newframe_q,
                                (const struct vframe_s *)vf);
@@ -884,13 +840,7 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw,
                        vdec->vdec_fps_detec(vdec->id);
                        decoder_do_frame_check(vdec, vf);
                        hw->frame_num++;
-                       if (pic->pic_type == I_PICTURE) {
-                               hw->i_decoded_frames++;
-                       } else if (pic->pic_type == P_PICTURE) {
-                               hw->p_decoded_frames++;
-                       } else if (pic->pic_type == B_PICTURE) {
-                               hw->b_decoded_frames++;
-                       }
+
                        vdec->dec_status(vdec, &vinfo);
                        vdec_fill_vdec_frame(vdec, NULL,
                                &vinfo, vf, pic->hw_decode_time);
@@ -1650,25 +1600,13 @@ static int dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_width = hw->frame_width;
        vstatus->frame_height = hw->frame_height;
        if (0 != hw->vmpeg4_amstream_dec_info.rate)
-               vstatus->frame_rate = ((DURATION_UNIT * 10 / hw->vmpeg4_amstream_dec_info.rate) % 10) < 5 ?
-               DURATION_UNIT / hw->vmpeg4_amstream_dec_info.rate : (DURATION_UNIT / hw->vmpeg4_amstream_dec_info.rate +1);
+               vstatus->frame_rate = DURATION_UNIT /
+                               hw->vmpeg4_amstream_dec_info.rate;
        else
-               vstatus->frame_rate = -1;
+               vstatus->frame_rate = DURATION_UNIT;
        vstatus->error_count = READ_VREG(MP4_ERR_COUNT);
        vstatus->status = hw->stat;
        vstatus->frame_dur = hw->frame_dur;
-       vstatus->error_frame_count = READ_VREG(MP4_ERR_COUNT);
-       vstatus->drop_frame_count = hw->drop_frame_count;
-       vstatus->frame_count =hw->frame_num;
-       vstatus->i_decoded_frames = hw->i_decoded_frames;
-       vstatus->i_lost_frames = hw->i_lost_frames;
-       vstatus->i_concealed_frames = hw->i_concealed_frames;
-       vstatus->p_decoded_frames = hw->p_decoded_frames;
-       vstatus->p_lost_frames = hw->p_lost_frames;
-       vstatus->p_concealed_frames = hw->p_concealed_frames;
-       vstatus->b_decoded_frames = hw->b_decoded_frames;
-       vstatus->b_lost_frames = hw->b_lost_frames;
-       vstatus->b_concealed_frames = hw->b_concealed_frames;
        snprintf(vstatus->vdec_name, sizeof(vstatus->vdec_name),
                        "%s", DRIVER_NAME);
 
index ba8b33eb53ff5973bca690fa55aa96baa53bf827..6a60ab1002799244e549868f0a0819d7dafbcb3a 100644 (file)
@@ -5134,10 +5134,6 @@ void vdec_fill_vdec_frame(struct vdec_s *vdec, struct vframe_qos_s *vframe_qos,
        if (vinfo) {
                memcpy(&fifo_buf[i].frame_width, &vinfo->frame_width,
                        ((char*)&vinfo->reserved[0] - (char*)&vinfo->frame_width));
-               /*copy for ipb report*/
-               memcpy(&fifo_buf[i].i_decoded_frames, &vinfo->i_decoded_frames,
-                       ((char*)&vinfo->endipb_line[0] - (char*)&vinfo->i_decoded_frames));
-               fifo_buf[i].av_resynch_counter = timestamp_avsync_counter_get();
        }
        if (vf) {
                fifo_buf[i].vf_type = vf->type;
index a7bf13e197264b3ee044d71c85ab8587939f43fb..54c5903e29fb8c6c43e1988b8d8594191cf71e26 100644 (file)
@@ -470,5 +470,4 @@ int show_stream_buffer_status(char *buf,
 
 bool is_support_no_parser(void);
 
-extern u32 timestamp_avsync_counter_get(void);
 #endif                         /* VDEC_H */
index b86f49703e9e3fa92a93d759b6b9f9c083b66574..282bba7bd0f07f305a40c756c26b6f532cd7d1b0 100644 (file)
@@ -7137,8 +7137,7 @@ static inline void pbi_update_gvs(struct VP9Decoder_s *pbi)
        if (pbi->gvs->frame_dur != pbi->frame_dur) {
                pbi->gvs->frame_dur = pbi->frame_dur;
                if (pbi->frame_dur != 0)
-                       pbi->gvs->frame_rate = ((96000 * 10 / pbi->frame_dur) % 10) < 5 ?
-                                       96000 / pbi->frame_dur : (96000 / pbi->frame_dur +1);
+                       pbi->gvs->frame_rate = 96000 / pbi->frame_dur;
                else
                        pbi->gvs->frame_rate = -1;
        }
@@ -7446,15 +7445,6 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi,
                        pbi_update_gvs(pbi);
                        /*count info*/
                        vdec_count_info(pbi->gvs, 0, stream_offset);
-                       if (stream_offset) {
-                               if (slice_type == KEY_FRAME) {
-                                       pbi->gvs->i_decoded_frames++;
-                               } else if (slice_type == INTER_FRAME) {
-                                       pbi->gvs->p_decoded_frames++;
-                               } else if (slice_type == FRAME_TYPES) {
-                                       pbi->gvs->b_decoded_frames++;
-                               }
-                       }
                        memcpy(&tmp4x, pbi->gvs, sizeof(struct vdec_info));
                        tmp4x.bit_depth_luma = pbi->vp9_param.p.bit_depth;
                        tmp4x.bit_depth_chroma = pbi->vp9_param.p.bit_depth;
@@ -9014,8 +9004,7 @@ int vvp9_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_width = frame_width;
        vstatus->frame_height = frame_height;
        if (vp9->frame_dur != 0)
-               vstatus->frame_rate = ((96000 * 10 / vp9->frame_dur) % 10) < 5 ?
-                               96000 / vp9->frame_dur : (96000 / vp9->frame_dur +1);
+               vstatus->frame_rate = 96000 / vp9->frame_dur;
        else
                vstatus->frame_rate = -1;
        vstatus->error_count = 0;
@@ -9027,15 +9016,6 @@ int vvp9_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        vstatus->frame_count = vp9->gvs->frame_count;
        vstatus->error_frame_count = vp9->gvs->error_frame_count;
        vstatus->drop_frame_count = vp9->gvs->drop_frame_count;
-       vstatus->i_decoded_frames = vp9->gvs->i_decoded_frames;
-       vstatus->i_lost_frames = vp9->gvs->i_lost_frames;
-       vstatus->i_concealed_frames = vp9->gvs->i_concealed_frames;
-       vstatus->p_decoded_frames = vp9->gvs->p_decoded_frames;
-       vstatus->p_lost_frames = vp9->gvs->p_lost_frames;
-       vstatus->p_concealed_frames = vp9->gvs->p_concealed_frames;
-       vstatus->b_decoded_frames = vp9->gvs->b_decoded_frames;
-       vstatus->b_lost_frames = vp9->gvs->b_lost_frames;
-       vstatus->b_concealed_frames = vp9->gvs->b_concealed_frames;
        vstatus->total_data = vp9->gvs->total_data;
        vstatus->samp_cnt = vp9->gvs->samp_cnt;
        vstatus->offset = vp9->gvs->offset;
index c6385465ccbe1de56bfc06c7580f7994b860974b..b204dc6968aabdeb8ee773aefec9f19fb71d2f5c 100644 (file)
@@ -2618,6 +2618,22 @@ static long amstream_do_ioctl_new(struct port_priv_s *priv,
                        struct vframe_counter_s tmpbuf[QOS_FRAME_NUM] = {0};
                        struct av_param_mvdec_t  __user *uarg = (void *)arg;
 
+                       if (AMSTREAM_IOC_GET_MVDECINFO == cmd) {
+                               if (get_user(vdec_id, &uarg->vdec_id) < 0
+                                  || get_user(struct_size, &uarg->struct_size) < 0) {
+                                               r = -EFAULT;
+                                               break;
+                                       }
+                               if (struct_size != sizeof(struct av_param_mvdec_t)) {
+                                       pr_err("pass in size %u != expected size %u\n",
+                                               struct_size, (u32)sizeof(struct av_param_mvdec_t));
+                                       pr_err("App using old structue,we will support it.\n");
+                                       //Here will add the compatibility for old structure when
+                                       //current struecture be substituded by newer structure.
+                                       //msleep(1000); let app handle it.
+                                       break;
+                               }
+                       }
                        vdec = vdec_get_vdec_by_id(vdec_id);
                        if (!vdec) {
                                r = 0;
@@ -2629,38 +2645,18 @@ static long amstream_do_ioctl_new(struct port_priv_s *priv,
                                put_user(slots, &uarg->slots);
                        if (slots) {
                                if (AMSTREAM_IOC_GET_MVDECINFO == cmd) {
-                                       if (get_user(vdec_id, &uarg->vdec_id) < 0 ||
-                                       get_user(struct_size, &uarg->struct_size) < 0) {
-                                               r = -EFAULT;
-                                               break;
-                                       }
                                        if (copy_to_user((void *)&uarg->comm,
                                                                &vdec->mvfrm->comm,
                                                                sizeof(struct vframe_comm_s))) {
                                                r = -EFAULT;
                                                break;
                                        }
-                                       if (struct_size == sizeof(struct av_param_mvdec_t_old)) {//old struct
-                                               struct av_param_mvdec_t_old  __user *uarg_old = (void *)arg;
-                                               int m;
-                                               for (m=0; m<slots; m++)
-                                                       if (copy_to_user((void *)&uarg_old->minfo[m],
-                                                                               &tmpbuf[m],
-                                                                               sizeof(struct vframe_counter_s_old))) {
-                                                               r = -EFAULT;
-                                                               break;
-                                                       }
-                                       } else if (struct_size == sizeof(struct av_param_mvdec_t)) {//new struct
-                                               if (copy_to_user((void *)&uarg->minfo[0],
-                                                                       tmpbuf,
-                                                                       slots*sizeof(struct vframe_counter_s))) {
-                                                       r = -EFAULT;
-                                                       break;
-                                               }
-                                       } else {
-                                               pr_err("pass in size %u,old struct size %u,current struct size %u\n",
-                                               struct_size, (u32)sizeof(struct av_param_mvdec_t_old),(u32)sizeof(struct av_param_mvdec_t));
-                                               pr_err("App use another picture size,we haven't support it.\n");
+                                       if (copy_to_user((void *)&uarg->minfo[0],
+                                                               tmpbuf,
+                                                               slots*sizeof(struct vframe_counter_s))) {
+                                               r = -EFAULT;
+                                               kfree(tmpbuf);
+                                               break;
                                        }
                                }else { //For compatibility, only copy the qos
                                        struct av_param_qosinfo_t  __user *uarg = (void *)arg;