From ec67375d53ee93940120cfe5aba265d818c4e162 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Wed, 1 Aug 2018 09:29:24 +0800 Subject: [PATCH] media_module: add vmh264 ip only mode PD#170460: vmh264: decoder get ip only flag from application and enable ip only fast output in dpb. Change-Id: I15a160c65bd0e23324a356c5f78957884395e8d2 Signed-off-by: Hui Zhang --- .../frame_provider/decoder/h264_multi/h264_dpb.c | 8 +++++++- .../frame_provider/decoder/h264_multi/h264_dpb.h | 3 +++ .../frame_provider/decoder/h264_multi/vmh264.c | 15 ++++++++------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.c index 88ae74954920..6af6ab0b93ca 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.c @@ -3447,7 +3447,8 @@ int store_picture_in_dpb(struct h264_dpb_stru *p_H264_Dpb, while (remove_unused_frame_from_dpb(p_H264_Dpb)) ; - while (output_frames(p_H264_Dpb, 0)) + while (output_frames(p_H264_Dpb, + (p_H264_Dpb->fast_output_enable == H264_OUTPUT_MODE_FAST))) ; /* check for duplicate frame number in short term reference buffer */ @@ -3502,6 +3503,11 @@ int store_picture_in_dpb(struct h264_dpb_stru *p_H264_Dpb, check_num_ref(p_Dpb); + if (p_H264_Dpb->fast_output_enable == H264_OUTPUT_MODE_FAST) { + while (output_frames(p_H264_Dpb, 1)) + ; + } + dump_dpb(p_Dpb, 0); p_Dpb->first_pic_done = 1; /*by rain*/ diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.h b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.h index 87641cbb9b1b..b7b37fd6bdfc 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.h +++ b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/h264_dpb.h @@ -29,6 +29,9 @@ #define MAX_LIST_SIZE 33 +#define H264_OUTPUT_MODE_NORMAL 0x4 +#define H264_OUTPUT_MODE_FAST 0x8 + #define FALSE 0 #define H264_SLICE_HEAD_DONE 0x01 diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c index 1811eb3096d3..7e028f6d6292 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c @@ -259,8 +259,9 @@ static unsigned int first_i_policy = (15 << 8) | 2; bit [1], output frame if the current poc is 1 big than the previous poc bit [2], if even poc only, output frame ifthe cuurent poc is 2 big than the previous poc + bit [3], ip only */ -static unsigned int fast_output_enable = 4; +static unsigned int fast_output_enable = H264_OUTPUT_MODE_NORMAL; static unsigned int enable_itu_t35 = 1; @@ -4231,12 +4232,12 @@ static irqreturn_t vh264_isr_thread_fn(struct vdec_s *vdec, int irq) schedule_work(&hw->user_data_work); } if (slice_header_process_status == 1) { - /* for baseline , set fast_output mode */ - if ((p_H264_Dpb->mSPS.profile_idc == BASELINE) - || ((((unsigned long) - hw->vh264_amstream_dec_info.param) & 0x8) - && (!hw->i_only))) - p_H264_Dpb->fast_output_enable = 4; + if ((p_H264_Dpb->mSPS.profile_idc == BASELINE) || + (((unsigned long)(hw->vh264_amstream_dec_info + .param)) & 0x8)) { + p_H264_Dpb->fast_output_enable = + H264_OUTPUT_MODE_FAST; + } else p_H264_Dpb->fast_output_enable = fast_output_enable;