summaryrefslogtreecommitdiff
authorGan Zhang <gan.zhang@amlogic.com>2020-08-04 02:16:23 (GMT)
committer Liang Ji <liang.ji@amlogic.com>2020-08-20 12:25:18 (GMT)
commitfce994e5f327dfa9b7dc0a4e5c404fa4ee7d3401 (patch)
treef57bf036553fbdf1e31487d657c26a4df32b8c48
parentb83df39a037c8be880a294567fcdbe126630d240 (diff)
downloadmedia_modules-fce994e5f327dfa9b7dc0a4e5c404fa4ee7d3401.zip
media_modules-fce994e5f327dfa9b7dc0a4e5c404fa4ee7d3401.tar.gz
media_modules-fce994e5f327dfa9b7dc0a4e5c404fa4ee7d3401.tar.bz2
mpeg12: fix output times error. [2/2]
PD#NULL Problem: The decode driver calculates field_num error. Solution: Modify the output logic according to the grammar rules. ucode gerrit id: ucode commit id: ucode change id: Verify: AC214 Change-Id: Ib3a030b373e98c64ac238211b33529816f7eedcd Signed-off-by: Gan Zhang <gan.zhang@amlogic.com>
Diffstat
-rw-r--r--drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
index ef45eb8..764a97d 100644
--- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
+++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
@@ -353,7 +353,7 @@ unsigned int mpeg12_debug_mask = 0xff;
/*static int counter_max = 5;*/
static u32 run_ready_min_buf_num = 2;
-
+static u32 forceProgressive = 1;
#define PRINT_FLAG_ERROR 0x0
#define PRINT_FLAG_RUN_FLOW 0X0001
@@ -1543,6 +1543,9 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw,
struct aml_vcodec_ctx * v4l2_ctx = hw->v4l2_ctx;
ulong nv_order = VIDTYPE_VIU_NV21;
bool pb_skip = false;
+ bool top_field_first = 0;
+ bool repeat_first_field = 0;
+ u32 tmp_field_num = 1;
#ifdef NV21
type = nv_order;
@@ -1575,6 +1578,29 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw,
field_num = (info & PICINFO_RPT_FIRST) ? 3 : 2;
}
+ top_field_first = (info & PICINFO_TOP_FIRST) ? 1:0;
+ repeat_first_field = (info & PICINFO_RPT_FIRST) ? 1:0;
+
+ if (hw->seqinfo & SEQINFO_PROG) {
+ if (repeat_first_field) {
+ tmp_field_num++;
+ if (top_field_first)
+ tmp_field_num++;
+ }
+ } else {
+ if ((info & PICINFO_FRAME) == PICINFO_FRAME) {
+ tmp_field_num++;
+ if (repeat_first_field)
+ tmp_field_num++;
+ }
+ }
+
+ if ((tmp_field_num == 1) && (field_num == 2)) {
+ if (forceProgressive) {
+ field_num = 1;
+ type |= VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD | nv_order;
+ }
+ }
for (i = 0; i < field_num; i++) {
if (kfifo_get(&hw->newframe_q, &vf) == 0) {
debug_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
@@ -3575,6 +3601,8 @@ module_param_array(max_process_time, uint, &max_decode_instance_num, 0664);
module_param(udebug_flag, uint, 0664);
MODULE_PARM_DESC(udebug_flag, "\n ammvdec_mpeg12 udebug_flag\n");
+module_param(forceProgressive, uint, 0664);
+MODULE_PARM_DESC(forceProgressive, "\n forceProgressive\n");
#ifdef AGAIN_HAS_THRESHOLD
module_param(again_threshold, uint, 0664);