rkmpp: update to 7a21a6a

This commit is contained in:
Jonas Karlman 2018-10-03 18:39:27 +02:00
parent fc443793bf
commit 44075086e6
7 changed files with 160 additions and 10 deletions

View File

@ -2,8 +2,8 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="rkmpp"
PKG_VERSION="93824dc71392b9ac94ee8ca157d9f2d4739e8f8f"
PKG_SHA256="14c49ceebd6c45dbb4c601bb4815de9a27d71d47f551c998ba9d3ff255572ad8"
PKG_VERSION="7a21a6a0454f604fdf752a1d45be6e2c954cc6de"
PKG_SHA256="ea981633839673dcfdc0fa0e4666b61ed0626def4273cdf5336b6a6bf322fdb3"
PKG_ARCH="arm aarch64"
PKG_LICENSE="APL"
PKG_SITE="https://github.com/rockchip-linux/mpp"
@ -20,6 +20,5 @@ else
PKG_ENABLE_VP9D="OFF"
fi
PKG_CMAKE_OPTS_TARGET="-DRKPLATFORM=ON \
-DENABLE_VP9D=$PKG_ENABLE_VP9D \
PKG_CMAKE_OPTS_TARGET="-DENABLE_VP9D=$PKG_ENABLE_VP9D \
-DHAVE_DRM=ON"

View File

@ -1,4 +1,4 @@
From d207d3da1107f642be937ad14d5b3cfff7780155 Mon Sep 17 00:00:00 2001
From dded8152c718456fc35e4ba8ae42aca9b92509f0 Mon Sep 17 00:00:00 2001
From: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
Date: Mon, 29 May 2017 14:08:43 +0200
Subject: [PATCH] fix 32-bit mmap issue on 64-bit kernels
@ -16,7 +16,7 @@ For details see https://github.com/rockchip-linux/kernel/issues/17
1 file changed, 2 insertions(+)
diff --git a/osal/allocator/allocator_drm.c b/osal/allocator/allocator_drm.c
index a29bf3f5..58891b28 100644
index b1dc277f..c2572716 100644
--- a/osal/allocator/allocator_drm.c
+++ b/osal/allocator/allocator_drm.c
@@ -15,6 +15,8 @@

View File

@ -1,4 +1,4 @@
From e2a70002f9a0a37f5c6297f1cc5e6604e9f9d964 Mon Sep 17 00:00:00 2001
From 0bcf210be37b631039ceef89155538770ccefed7 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sun, 24 Jun 2018 11:07:44 +0200
Subject: [PATCH] disable unit tests by default

View File

@ -1,4 +1,4 @@
From ccd837fab6ab41ee3cb63b0e9ae1db824f96d4dc Mon Sep 17 00:00:00 2001
From 51c122a2ee9a1f06c6a33bddc0be2db1065bb385 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Tue, 7 Aug 2018 18:14:57 +0200
Subject: [PATCH] [h264d]: revert vdpu fast mode code
@ -9,7 +9,7 @@ Subject: [PATCH] [h264d]: revert vdpu fast mode code
2 files changed, 10 insertions(+), 26 deletions(-)
diff --git a/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c b/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c
index 1cddfc45..660e41f3 100644
index 59d1d7dd..35356c2f 100644
--- a/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c
+++ b/mpp/hal/rkdec/h264d/hal_h264d_vdpu1.c
@@ -416,7 +416,8 @@ static MPP_RET vdpu1_set_vlc_regs(H264dHalCtx_t *p_hal,
@ -74,7 +74,7 @@ index 1cddfc45..660e41f3 100644
reg_ctx->reg_buf[i].valid = 1;
break;
diff --git a/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c b/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c
index fa55e635..9b22c1d9 100644
index 7ad44840..71dd9e44 100644
--- a/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c
+++ b/mpp/hal/rkdec/h264d/hal_h264d_vdpu2.c
@@ -451,7 +451,8 @@ static MPP_RET set_vlc_regs(H264dHalCtx_t *p_hal, H264dVdpuRegs_t *p_regs)

View File

@ -0,0 +1,26 @@
From 773108dc3584ce325ff4127dbd54a0a935a89bfc Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Fri, 7 Sep 2018 19:53:10 +0200
Subject: [PATCH] [h264d]: fix mpp_buf_slot_get_prop crash
---
mpp/codec/dec/h264/h264d_init.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mpp/codec/dec/h264/h264d_init.c b/mpp/codec/dec/h264/h264d_init.c
index f32c2a77..46f02466 100644
--- a/mpp/codec/dec/h264/h264d_init.c
+++ b/mpp/codec/dec/h264/h264d_init.c
@@ -1387,7 +1387,11 @@ static RK_U32 check_ref_dbp_err(H264_DecCtx_t *p_Dec, H264_RefPicInfo_t *pref, R
for (i = 0; i < MAX_REF_SIZE; i++) {
if (pref[i].valid) {
MppFrame mframe = NULL;
- RK_U32 slot_idx = p_Dec->dpb_info[pref[i].dpb_idx].slot_index;
+ RK_S32 slot_idx = p_Dec->dpb_info[pref[i].dpb_idx].slot_index;
+ if (slot_idx < 0) {
+ dpb_error_flag |= 1;
+ break;
+ }
mpp_buf_slot_get_prop(p_Dec->frame_slots, slot_idx, SLOT_FRAME_PTR, &mframe);
if (mframe) {
if (i < active_refs) {

View File

@ -0,0 +1,22 @@
From 6be271fa4bbebae10ec5e680a2d90266eb3d9ea8 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Thu, 1 Mar 2018 22:31:47 +0100
Subject: [PATCH] [m2vd]: use ctx pts
---
mpp/codec/dec/m2v/m2vd_parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c
index 6a720d56..24372f85 100755
--- a/mpp/codec/dec/m2v/m2vd_parser.c
+++ b/mpp/codec/dec/m2v/m2vd_parser.c
@@ -1151,7 +1151,7 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx)
mpp_frame_set_hor_stride(ctx->frame_cur->f, ctx->display_width);
mpp_frame_set_ver_stride(ctx->frame_cur->f, ctx->display_height);
mpp_frame_set_errinfo(ctx->frame_cur->f, 0);
- mpp_frame_set_pts(ctx->frame_cur->f, Time * 1000);
+ mpp_frame_set_pts(ctx->frame_cur->f, ctx->pts);
ctx->frame_cur->flags = M2V_OUT_FLAG;
if (ctx->seq_ext_head.progressive_sequence) {
frametype = MPP_FRAME_FLAG_FRAME;

View File

@ -0,0 +1,103 @@
From 50c49fe8cdb9b236d27ec2b1d3195ca5121d9677 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sat, 15 Sep 2018 11:24:28 +0200
Subject: [PATCH] [m2vd]: export aspect ratio information
---
inc/mpp_frame.h | 10 ++++++++++
mpp/base/inc/mpp_frame_impl.h | 1 +
mpp/base/mpp_frame.cpp | 1 +
mpp/codec/dec/m2v/m2vd_parser.c | 22 ++++++++++++++++++++++
4 files changed, 34 insertions(+)
diff --git a/inc/mpp_frame.h b/inc/mpp_frame.h
index 6c1b7f1d..87513a09 100644
--- a/inc/mpp_frame.h
+++ b/inc/mpp_frame.h
@@ -190,6 +190,14 @@ typedef enum {
MPP_FMT_BUTT = MPP_FMT_COMPLEX_BUTT,
} MppFrameFormat;
+/**
+ * Rational number (pair of numerator and denominator).
+ */
+typedef struct MppFrameRational {
+ RK_S32 num; ///< Numerator
+ RK_S32 den; ///< Denominator
+} MppFrameRational;
+
typedef enum {
MPP_FRAME_ERR_UNKNOW = 0x0001,
MPP_FRAME_ERR_UNSUPPORT = 0x0002,
@@ -263,6 +271,8 @@ void mpp_frame_set_chroma_location(MppFrame frame, MppFrameChromaLocation chr
MppFrameFormat mpp_frame_get_fmt(MppFrame frame);
void mpp_frame_set_fmt(MppFrame frame, MppFrameFormat fmt);
+MppFrameRational mpp_frame_get_sar(const MppFrame frame);
+void mpp_frame_set_sar(MppFrame frame, MppFrameRational sar);
/*
* HDR parameter
diff --git a/mpp/base/inc/mpp_frame_impl.h b/mpp/base/inc/mpp_frame_impl.h
index 44edc184..1f13d553 100644
--- a/mpp/base/inc/mpp_frame_impl.h
+++ b/mpp/base/inc/mpp_frame_impl.h
@@ -87,6 +87,7 @@ struct MppFrameImpl_t {
MppFrameChromaLocation chroma_location;
MppFrameFormat fmt;
+ MppFrameRational sar;
/*
* buffer information
* NOTE: buf_size only access internally
diff --git a/mpp/base/mpp_frame.cpp b/mpp/base/mpp_frame.cpp
index cc83b6b3..984efa62 100644
--- a/mpp/base/mpp_frame.cpp
+++ b/mpp/base/mpp_frame.cpp
@@ -184,5 +184,6 @@ MPP_FRAME_ACCESSORS(MppFrameColorTransferCharacteristic, color_trc)
MPP_FRAME_ACCESSORS(MppFrameColorSpace, colorspace)
MPP_FRAME_ACCESSORS(MppFrameChromaLocation, chroma_location)
MPP_FRAME_ACCESSORS(MppFrameFormat, fmt)
+MPP_FRAME_ACCESSORS(MppFrameRational, sar)
MPP_FRAME_ACCESSORS(size_t, buf_size)
MPP_FRAME_ACCESSORS(RK_U32, errinfo)
diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c
index 24372f85..e44e35fb 100755
--- a/mpp/codec/dec/m2v/m2vd_parser.c
+++ b/mpp/codec/dec/m2v/m2vd_parser.c
@@ -82,6 +82,25 @@ static int frame_period_Table[16] = {
1
};
+static const MppFrameRational mpeg2_aspect[16] = {
+ {0,1},
+ {1,1},
+ {4,3},
+ {16,9},
+ {221,100},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+ {0,1},
+};
+
static inline RK_S32 m2vd_get_readbits(BitReadCtx_t *bx)
{
return bx->used_bits;
@@ -1164,6 +1183,9 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx)
}
mpp_frame_set_mode(ctx->frame_cur->f, frametype);
+ if (ctx->seq_head.aspect_ratio_information >= 0 && ctx->seq_head.aspect_ratio_information < 16)
+ mpp_frame_set_sar(ctx->frame_cur->f, mpeg2_aspect[ctx->seq_head.aspect_ratio_information]);
+
mpp_buf_slot_get_unused(ctx->frame_slots, &ctx->frame_cur->slot_index);
mpp_buf_slot_set_prop(ctx->frame_slots, ctx->frame_cur->slot_index, SLOT_FRAME, ctx->frame_cur->f);
mpp_buf_slot_set_flag(ctx->frame_slots, ctx->frame_cur->slot_index, SLOT_CODEC_USE);