From cd9a1cca3f4683c219a855c85484e00bc435f59e Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Thu, 13 Jun 2019 18:04:13 +0800 Subject: [PATCH] [misc]: Change interface header file dependency Move MppCtx, MppParam, MppFrame, MppPacket, MppBuffer, MppBufferGroup, MppTask and MppMeta to rk_type.h. Later development need to bring in cross reference between these objects. So we choose to move these declaration together. Change-Id: I7ea39138ca87d6ca4cb86556464a5de89d172846 Signed-off-by: Herman Chen --- inc/mpp_buffer.h | 26 --------------------- inc/mpp_frame.h | 3 --- inc/mpp_meta.h | 8 +++---- inc/mpp_packet.h | 4 +--- inc/mpp_task.h | 1 - inc/rk_mpi.h | 7 ++---- inc/rk_type.h | 31 ++++++++++++++++++++++++++ mpp/base/inc/mpp_bitread.h | 2 +- mpp/base/inc/mpp_buf_slot.h | 1 - mpp/base/inc/mpp_packet_impl.h | 2 +- mpp/base/mpp_meta.cpp | 2 -- mpp/base/mpp_packet.cpp | 1 - mpp/base/test/mpp_buffer_test.c | 1 + mpp/codec/dec/avs/avsd_api.c | 1 - mpp/codec/dec/avs/avsd_parse.c | 1 - mpp/codec/dec/avs/avsd_parse.h | 8 ------- mpp/codec/dec/dummy/dummy_dec_api.c | 1 - mpp/codec/dec/h263/h263d_api.c | 2 -- mpp/codec/dec/h263/h263d_parser.c | 1 - mpp/codec/dec/h264/h264d_api.c | 3 +-- mpp/codec/dec/h264/h264d_global.h | 1 - mpp/codec/dec/h264/h264d_parse.c | 1 - mpp/codec/dec/h265/h265d_codec.h | 4 ---- mpp/codec/dec/h265/h265d_parser.h | 13 ++++++----- mpp/codec/dec/jpeg/jpegd_parser.h | 13 +++++------ mpp/codec/dec/m2v/m2vd_api.c | 8 ++----- mpp/codec/dec/m2v/m2vd_codec.h | 4 ---- mpp/codec/dec/m2v/m2vd_parser.c | 8 +++---- mpp/codec/dec/m2v/m2vd_parser.h | 5 +---- mpp/codec/dec/mpg4/mpg4d_api.c | 2 -- mpp/codec/dec/mpg4/mpg4d_parser.c | 4 +--- mpp/codec/dec/vp8/vp8d_parser.h | 4 +--- mpp/codec/dec/vp9/vp9d_api.c | 5 ++--- mpp/codec/dec/vp9/vp9d_codec.h | 9 ++++---- mpp/codec/dec/vp9/vp9d_parser.c | 15 ++++++++----- mpp/codec/dec/vp9/vp9d_parser.h | 12 +++++----- mpp/codec/dec/vp9/vpx_rac.h | 4 +++- mpp/codec/enc/vp8/vp8e_rc.h | 2 -- mpp/codec/inc/encoder_codec_api.h | 1 - mpp/codec/inc/h264d_api.h | 2 -- mpp/codec/inc/mpp_enc.h | 2 -- mpp/codec/inc/mpp_rc.h | 2 +- mpp/codec/inc/parser_api.h | 1 - mpp/codec/mpp_dec.cpp | 2 -- mpp/codec/mpp_enc.cpp | 6 ++--- mpp/common/h265e_syntax.h | 2 -- mpp/hal/common/h264/hal_h264e_com.h | 3 +-- mpp/hal/vpu/h264e/hal_h264e_header.c | 1 - mpp/hal/vpu/h264e/hal_h264e_header.h | 1 - mpp/hal/vpu/h264e/hal_h264e_rc.c | 1 - mpp/hal/vpu/h264e/hal_h264e_rc.h | 1 - mpp/hal/vpu/h264e/hal_h264e_vepu1.c | 1 - mpp/hal/vpu/h264e/hal_h264e_vepu2.c | 1 - mpp/hal/worker/mpp_device/mpp_device.c | 3 ++- mpp/inc/mpp.h | 3 +-- mpp/legacy/vpu_api_legacy.h | 3 ++- mpp/mpi.cpp | 4 +--- osal/inc/mpp_common.h | 19 ++++++++++++++++ osal/inc/mpp_log.h | 3 ++- osal/inc/mpp_platform.h | 1 - osal/inc/mpp_runtime.h | 2 +- osal/mpp_allocator.cpp | 1 + test/mpi_test.c | 2 +- utils/utils.h | 1 - 64 files changed, 120 insertions(+), 169 deletions(-) diff --git a/inc/mpp_buffer.h b/inc/mpp_buffer.h index ee544a12..f1d6335c 100644 --- a/inc/mpp_buffer.h +++ b/inc/mpp_buffer.h @@ -20,30 +20,6 @@ #include "rk_type.h" #include "mpp_err.h" -/* - * because buffer usage maybe unknown when decoder is not started - * buffer group may need to set a default group size limit - */ -#define SZ_1K (1024) -#define SZ_2K (SZ_1K*2) -#define SZ_4K (SZ_1K*4) -#define SZ_8K (SZ_1K*8) -#define SZ_16K (SZ_1K*16) -#define SZ_32K (SZ_1K*32) -#define SZ_64K (SZ_1K*64) -#define SZ_128K (SZ_1K*128) -#define SZ_256K (SZ_1K*256) -#define SZ_512K (SZ_1K*512) -#define SZ_1M (SZ_1K*SZ_1K) -#define SZ_2M (SZ_1M*2) -#define SZ_4M (SZ_1M*4) -#define SZ_8M (SZ_1M*8) -#define SZ_16M (SZ_1M*16) -#define SZ_32M (SZ_1M*32) -#define SZ_64M (SZ_1M*64) -#define SZ_80M (SZ_1M*80) -#define SZ_128M (SZ_1M*128) - /* * MppBuffer module has several functions: * @@ -76,8 +52,6 @@ * user can only use MppBufferType to choose. * */ -typedef void* MppBuffer; -typedef void* MppBufferGroup; /* * mpp buffer group support two work flow mode: diff --git a/inc/mpp_frame.h b/inc/mpp_frame.h index b3bfff1e..05cfcef5 100644 --- a/inc/mpp_frame.h +++ b/inc/mpp_frame.h @@ -19,8 +19,6 @@ #include "mpp_buffer.h" -typedef void* MppFrame; - /* * bit definition for mode flag in MppFrame */ @@ -263,7 +261,6 @@ 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); - /* * HDR parameter */ diff --git a/inc/mpp_meta.h b/inc/mpp_meta.h index 7d85c178..49a0b464 100644 --- a/inc/mpp_meta.h +++ b/inc/mpp_meta.h @@ -20,9 +20,6 @@ #include #include "rk_type.h" -#include "mpp_frame.h" -#include "mpp_packet.h" - #define FOURCC_META(a, b, c, d) ((RK_U32)(a) << 24 | \ ((RK_U32)(b) << 16) | \ ((RK_U32)(c) << 8) | \ @@ -92,10 +89,11 @@ typedef enum MppMetaKey_e { KEY_RC_MODE = FOURCC_META('r', 'c', 'm', 'o'), } MppMetaKey; -typedef void* MppMeta; - #define mpp_meta_get(meta) mpp_meta_get_with_tag(meta, MODULE_TAG, __FUNCTION__) +#include "mpp_frame.h" +#include "mpp_packet.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/inc/mpp_packet.h b/inc/mpp_packet.h index 8ddacaa5..f6ec934d 100644 --- a/inc/mpp_packet.h +++ b/inc/mpp_packet.h @@ -17,9 +17,7 @@ #ifndef __MPP_PACKET_H__ #define __MPP_PACKET_H__ -#include "mpp_buffer.h" - -typedef void* MppPacket; +#include "mpp_meta.h" #ifdef __cplusplus extern "C" { diff --git a/inc/mpp_task.h b/inc/mpp_task.h index 808b807d..7d1a2fea 100644 --- a/inc/mpp_task.h +++ b/inc/mpp_task.h @@ -208,7 +208,6 @@ typedef enum { * task_enqueue(ctx, PORT_OUTPUT, task); */ /* NOTE: use index rather then handle to descripbe task */ -typedef void* MppTask; typedef void* MppPort; typedef void* MppTaskQueue; diff --git a/inc/rk_mpi.h b/inc/rk_mpi.h index 00c87c9d..e1e138fd 100644 --- a/inc/rk_mpi.h +++ b/inc/rk_mpi.h @@ -17,8 +17,8 @@ #ifndef __RK_MPI_H__ #define __RK_MPI_H__ -#include "mpp_task.h" #include "rk_mpi_cmd.h" +#include "mpp_task.h" /** * @addtogroup rk_mpi @@ -74,13 +74,10 @@ typedef enum { MPP_VIDEO_CodingMax = 0x7FFFFFFF } MppCodingType; -typedef void* MppCtx; -typedef void* MppParam; - /* * in decoder mode application need to specify the coding type first * send a stream header to mpi ctx using parameter data / size - * and decoder will try to decode the + * and decoder will try to decode the input stream. */ typedef struct MppEncCodecCfg_t { MppCodingType coding; diff --git a/inc/rk_type.h b/inc/rk_type.h index a985e7d7..bfaf9cd5 100755 --- a/inc/rk_type.h +++ b/inc/rk_type.h @@ -54,6 +54,37 @@ typedef signed long long int RK_S64; #define MODULE_TAG NULL #endif +/* + * All external interface object list here. + * The interface object is defined as void * for expandability + * The cross include between these objects will introduce extra + * compiling difficulty. So we move them together in this header. + * + * Object interface header list: + * + * MppCtx - rk_mpi.h + * MppParam - rk_mpi.h + * + * MppFrame - mpp_frame.h + * MppPacket - mpp_packet.h + * + * MppBuffer - mpp_buffer.h + * MppBufferGroup - mpp_buffer.h + * + * MppTask - mpp_task.h + * MppMeta - mpp_meta.h + */ +typedef void* MppCtx; +typedef void* MppParam; + +typedef void* MppFrame; +typedef void* MppPacket; + +typedef void* MppBuffer; +typedef void* MppBufferGroup; + +typedef void* MppTask; +typedef void* MppMeta; #endif /*__RK_TYPE_H__*/ diff --git a/mpp/base/inc/mpp_bitread.h b/mpp/base/inc/mpp_bitread.h index 7d8616e1..7ecef905 100644 --- a/mpp/base/inc/mpp_bitread.h +++ b/mpp/base/inc/mpp_bitread.h @@ -19,7 +19,7 @@ #include #include -#include "rk_type.h" + #include "mpp_log.h" #include "mpp_common.h" #include "mpp_err.h" diff --git a/mpp/base/inc/mpp_buf_slot.h b/mpp/base/inc/mpp_buf_slot.h index 08f075fd..e773dfa6 100644 --- a/mpp/base/inc/mpp_buf_slot.h +++ b/mpp/base/inc/mpp_buf_slot.h @@ -17,7 +17,6 @@ #ifndef __MPP_BUF_SLOT_H__ #define __MPP_BUF_SLOT_H__ -#include "rk_type.h" #include "mpp_frame.h" /* diff --git a/mpp/base/inc/mpp_packet_impl.h b/mpp/base/inc/mpp_packet_impl.h index 840c16cc..68532cad 100644 --- a/mpp/base/inc/mpp_packet_impl.h +++ b/mpp/base/inc/mpp_packet_impl.h @@ -17,7 +17,7 @@ #ifndef __MPP_PACKET_IMPL_H__ #define __MPP_PACKET_IMPL_H__ -#include "mpp_buffer.h" +#include "mpp_meta.h" #define MPP_PACKET_FLAG_EOS (0x00000001) #define MPP_PACKET_FLAG_EXTRA_DATA (0x00000002) diff --git a/mpp/base/mpp_meta.cpp b/mpp/base/mpp_meta.cpp index 45525144..5f215ea7 100644 --- a/mpp/base/mpp_meta.cpp +++ b/mpp/base/mpp_meta.cpp @@ -20,8 +20,6 @@ #include "mpp_mem.h" #include "mpp_list.h" -#include "mpp_frame.h" -#include "mpp_packet.h" #include "mpp_common.h" #include "mpp_meta.h" diff --git a/mpp/base/mpp_packet.cpp b/mpp/base/mpp_packet.cpp index 69d7c119..9f7158cc 100644 --- a/mpp/base/mpp_packet.cpp +++ b/mpp/base/mpp_packet.cpp @@ -20,7 +20,6 @@ #include "mpp_log.h" #include "mpp_mem.h" -#include "mpp_packet.h" #include "mpp_packet_impl.h" static const char *module_name = MODULE_TAG; diff --git a/mpp/base/test/mpp_buffer_test.c b/mpp/base/test/mpp_buffer_test.c index 2398865e..4fdf45e2 100644 --- a/mpp/base/test/mpp_buffer_test.c +++ b/mpp/base/test/mpp_buffer_test.c @@ -23,6 +23,7 @@ #endif #include "mpp_log.h" #include "mpp_env.h" +#include "mpp_common.h" #include "mpp_buffer.h" #include "mpp_allocator.h" diff --git a/mpp/codec/dec/avs/avsd_api.c b/mpp/codec/dec/avs/avsd_api.c index 65a1c222..e17c2970 100644 --- a/mpp/codec/dec/avs/avsd_api.c +++ b/mpp/codec/dec/avs/avsd_api.c @@ -24,7 +24,6 @@ #include "mpp_mem.h" #include "mpp_log.h" #include "mpp_env.h" -#include "mpp_packet.h" #include "mpp_packet_impl.h" #include "mpp_buffer_impl.h" diff --git a/mpp/codec/dec/avs/avsd_parse.c b/mpp/codec/dec/avs/avsd_parse.c index 27791cdf..cbb3ab41 100644 --- a/mpp/codec/dec/avs/avsd_parse.c +++ b/mpp/codec/dec/avs/avsd_parse.c @@ -22,7 +22,6 @@ #include "mpp_mem.h" #include "mpp_log.h" -#include "mpp_packet.h" #include "mpp_packet_impl.h" #include "hal_task.h" diff --git a/mpp/codec/dec/avs/avsd_parse.h b/mpp/codec/dec/avs/avsd_parse.h index 74fab16d..a7988b44 100644 --- a/mpp/codec/dec/avs/avsd_parse.h +++ b/mpp/codec/dec/avs/avsd_parse.h @@ -17,20 +17,12 @@ #ifndef __AVSD_PARSE_H__ #define __AVSD_PARSE_H__ - -#include "rk_type.h" #include "parser_api.h" - -#include "mpp_err.h" -#include "mpp_packet.h" -#include "mpp_buf_slot.h" #include "mpp_bitread.h" #include "avsd_syntax.h" -#include "hal_task.h" #include "avsd_api.h" - #define AVSD_DBG_ERROR (0x00000001) #define AVSD_DBG_ASSERT (0x00000002) #define AVSD_DBG_WARNNING (0x00000004) diff --git a/mpp/codec/dec/dummy/dummy_dec_api.c b/mpp/codec/dec/dummy/dummy_dec_api.c index 69deb499..66030a1d 100644 --- a/mpp/codec/dec/dummy/dummy_dec_api.c +++ b/mpp/codec/dec/dummy/dummy_dec_api.c @@ -21,7 +21,6 @@ #include "mpp_log.h" #include "mpp_mem.h" #include "mpp_common.h" -#include "mpp_packet.h" #include "dummy_dec_api.h" diff --git a/mpp/codec/dec/h263/h263d_api.c b/mpp/codec/dec/h263/h263d_api.c index b7646e07..9331c8d5 100644 --- a/mpp/codec/dec/h263/h263d_api.c +++ b/mpp/codec/dec/h263/h263d_api.c @@ -19,8 +19,6 @@ #include -#include "rk_mpi.h" - #include "mpp_log.h" #include "mpp_mem.h" #include "mpp_common.h" diff --git a/mpp/codec/dec/h263/h263d_parser.c b/mpp/codec/dec/h263/h263d_parser.c index 790101f3..1edcb589 100644 --- a/mpp/codec/dec/h263/h263d_parser.c +++ b/mpp/codec/dec/h263/h263d_parser.c @@ -20,7 +20,6 @@ #include "mpp_env.h" #include "mpp_log.h" #include "mpp_mem.h" -#include "mpp_packet.h" #include "mpp_bitread.h" #include "h263d_parser.h" diff --git a/mpp/codec/dec/h264/h264d_api.c b/mpp/codec/dec/h264/h264d_api.c index 132e6ac3..ad672576 100644 --- a/mpp/codec/dec/h264/h264d_api.c +++ b/mpp/codec/dec/h264/h264d_api.c @@ -20,9 +20,8 @@ #include #include "mpp_env.h" -#include "mpp_packet.h" -#include "mpp_packet_impl.h" #include "mpp_mem.h" +#include "mpp_packet_impl.h" #include "h264d_api.h" #include "h264d_global.h" diff --git a/mpp/codec/dec/h264/h264d_global.h b/mpp/codec/dec/h264/h264d_global.h index b02baa20..f66b828d 100644 --- a/mpp/codec/dec/h264/h264d_global.h +++ b/mpp/codec/dec/h264/h264d_global.h @@ -29,7 +29,6 @@ #include "h264d_syntax.h" - #define H264D_DBG_ERROR (0x00000001) #define H264D_DBG_ASSERT (0x00000002) #define H264D_DBG_WARNNING (0x00000004) diff --git a/mpp/codec/dec/h264/h264d_parse.c b/mpp/codec/dec/h264/h264d_parse.c index 919a2059..823069eb 100644 --- a/mpp/codec/dec/h264/h264d_parse.c +++ b/mpp/codec/dec/h264/h264d_parse.c @@ -21,7 +21,6 @@ #include #include "mpp_mem.h" -#include "mpp_packet.h" #include "mpp_packet_impl.h" #include "hal_task.h" diff --git a/mpp/codec/dec/h265/h265d_codec.h b/mpp/codec/dec/h265/h265d_codec.h index 107dd196..49804f7c 100644 --- a/mpp/codec/dec/h265/h265d_codec.h +++ b/mpp/codec/dec/h265/h265d_codec.h @@ -28,8 +28,6 @@ #ifndef __MPP_CODEC_H__ #define __MPP_CODEC_H__ -#include "mpp_common.h" -#include "mpp_frame.h" #include "mpp_dec.h" enum MppColorSpace { @@ -166,10 +164,8 @@ extern "C" { #endif RK_S32 h265d_parser2_syntax(void *ctx); - RK_S32 h265d_syntax_fill_slice(void *ctx, RK_S32 input_index); - #ifdef __cplusplus } #endif diff --git a/mpp/codec/dec/h265/h265d_parser.h b/mpp/codec/dec/h265/h265d_parser.h index 950dc35e..bf42eb97 100644 --- a/mpp/codec/dec/h265/h265d_parser.h +++ b/mpp/codec/dec/h265/h265d_parser.h @@ -29,16 +29,17 @@ #ifndef __H265D_PARSER_H__ #define __H265D_PARSER_H__ -#include "mpp_bitread.h" -#include "mpp_common.h" -#include "h265d_codec.h" -#include "mpp_frame.h" -#include "limits.h" +#include #include -#include + +#include "mpp_mem.h" #include "mpp_dec.h" +#include "mpp_bitread.h" + +#include "h265d_codec.h" extern RK_U32 h265d_debug; + #define H265D_DBG_FUNCTION (0x00000001) #define H265D_DBG_VPS (0x00000002) #define H265D_DBG_SPS (0x00000004) diff --git a/mpp/codec/dec/jpeg/jpegd_parser.h b/mpp/codec/dec/jpeg/jpegd_parser.h index a2cc634e..6389d0fb 100644 --- a/mpp/codec/dec/jpeg/jpegd_parser.h +++ b/mpp/codec/dec/jpeg/jpegd_parser.h @@ -18,17 +18,14 @@ #ifndef __JPEGD_PARSER_H__ #define __JPEGD_PARSER_H__ -#include "mpp_bitread.h" -#include "mpp_common.h" -#include "mpp_frame.h" -#include "limits.h" +#include #include -#include -#include "mpp_dec.h" -#include "mpp_buf_slot.h" -#include "mpp_packet.h" + +#include "mpp_mem.h" #include "mpp_bitread.h" +#include "mpp_dec.h" + #include "jpegd_syntax.h" #define JPEG_IDENTIFIER(a, b, c, d) \ diff --git a/mpp/codec/dec/m2v/m2vd_api.c b/mpp/codec/dec/m2v/m2vd_api.c index 1d0f921c..010edd04 100644 --- a/mpp/codec/dec/m2v/m2vd_api.c +++ b/mpp/codec/dec/m2v/m2vd_api.c @@ -17,11 +17,11 @@ #define MODULE_TAG "m2vd_api" #include + #include "mpp_env.h" -#include "mpp_packet.h" -#include "mpp_packet_impl.h" #include "mpp_mem.h" #include "mpp_log.h" +#include "mpp_packet_impl.h" #include "m2vd_api.h" #include "m2vd_parser.h" @@ -41,7 +41,3 @@ const ParserApi api_m2vd_parser = { .control = m2vd_parser_control, .callback = m2vd_parser_callback, }; - - - - diff --git a/mpp/codec/dec/m2v/m2vd_codec.h b/mpp/codec/dec/m2v/m2vd_codec.h index b1955de2..7de1240a 100644 --- a/mpp/codec/dec/m2v/m2vd_codec.h +++ b/mpp/codec/dec/m2v/m2vd_codec.h @@ -17,12 +17,8 @@ #ifndef __M2VD_CODEC_H__ #define __M2VD_CODEC_H__ -#include "rk_type.h" #include "mpp_common.h" -#include "mpp_frame.h" #include "mpp_dec.h" -#include "mpp_packet.h" - typedef struct M2VDContext_t { void *parse_ctx; diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c index 6a720d56..2ee04f8e 100755 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c @@ -15,15 +15,15 @@ */ #define MODULE_TAG "m2vd_parser" + #include +#include "mpp_env.h" +#include "mpp_packet_impl.h" + #include "m2vd_parser.h" #include "m2vd_codec.h" -#include "mpp_packet_impl.h" -#include "mpp_frame.h" -#include "mpp_env.h" - #define VPU_BITSTREAM_START_CODE (0x42564b52) /* RKVB, rockchip video bitstream */ RK_U32 m2vd_debug = 0x0; diff --git a/mpp/codec/dec/m2v/m2vd_parser.h b/mpp/codec/dec/m2v/m2vd_parser.h index 58e0f4c6..c1b323f6 100644 --- a/mpp/codec/dec/m2v/m2vd_parser.h +++ b/mpp/codec/dec/m2v/m2vd_parser.h @@ -27,14 +27,11 @@ #ifndef __M2VD_PARSER_H__ #define __M2VD_PARSER_H__ -#include "mpp_common.h" #include "mpp_mem.h" #include "mpp_bitread.h" -#include "mpp_frame.h" -#include "mpp_packet.h" - #include "mpp_dec.h" + #include "m2vd_syntax.h" #include "m2vd_com.h" diff --git a/mpp/codec/dec/mpg4/mpg4d_api.c b/mpp/codec/dec/mpg4/mpg4d_api.c index 33302137..bab24c5a 100644 --- a/mpp/codec/dec/mpg4/mpg4d_api.c +++ b/mpp/codec/dec/mpg4/mpg4d_api.c @@ -19,8 +19,6 @@ #include -#include "rk_mpi.h" - #include "mpp_log.h" #include "mpp_mem.h" #include "mpp_common.h" diff --git a/mpp/codec/dec/mpg4/mpg4d_parser.c b/mpp/codec/dec/mpg4/mpg4d_parser.c index 6a502da5..2853e644 100644 --- a/mpp/codec/dec/mpg4/mpg4d_parser.c +++ b/mpp/codec/dec/mpg4/mpg4d_parser.c @@ -22,10 +22,8 @@ #include "mpp_env.h" #include "mpp_log.h" #include "mpp_mem.h" -#include "mpp_packet.h" -#include "mpp_common.h" - #include "mpp_bitread.h" + #include "mpg4d_parser.h" #include "mpg4d_syntax.h" diff --git a/mpp/codec/dec/vp8/vp8d_parser.h b/mpp/codec/dec/vp8/vp8d_parser.h index 20e23d29..b1a7c96c 100644 --- a/mpp/codec/dec/vp8/vp8d_parser.h +++ b/mpp/codec/dec/vp8/vp8d_parser.h @@ -19,11 +19,9 @@ #define __VP8D_PARSER_H__ #include "mpp_bitread.h" -#include "mpp_common.h" -#include "mpp_frame.h" #include "mpp_mem.h" + #include "mpp_dec.h" -#include "mpp_packet.h" #include "vp8d_syntax.h" #include "vp8d_data.h" diff --git a/mpp/codec/dec/vp9/vp9d_api.c b/mpp/codec/dec/vp9/vp9d_api.c index 70b2c5df..c985ca26 100644 --- a/mpp/codec/dec/vp9/vp9d_api.c +++ b/mpp/codec/dec/vp9/vp9d_api.c @@ -21,11 +21,10 @@ #include #include -//#include "common.h" -#include "mpp_packet.h" -#include "mpp_packet_impl.h" #include "mpp_mem.h" #include "mpp_log.h" +#include "mpp_packet_impl.h" + #include "vp9d_codec.h" #include "vp9d_parser.h" #include "vp9d_api.h" diff --git a/mpp/codec/dec/vp9/vp9d_codec.h b/mpp/codec/dec/vp9/vp9d_codec.h index 7623ec76..a6122780 100644 --- a/mpp/codec/dec/vp9/vp9d_codec.h +++ b/mpp/codec/dec/vp9/vp9d_codec.h @@ -16,14 +16,13 @@ */ #ifndef __VP9D_CODEC_H__ #define __VP9D_CODEC_H__ + #include -#include "rk_type.h" -#include "mpp_packet.h" -#include "vp9d_syntax.h" -#include "mpp_frame.h" -#include "mpp_mem.h" + #include "hal_task.h" +#include "vp9d_syntax.h" + typedef struct VP9ParseContext { RK_S32 n_frames; // 1-8 RK_S32 size[8]; diff --git a/mpp/codec/dec/vp9/vp9d_parser.c b/mpp/codec/dec/vp9/vp9d_parser.c index 480c984a..59467cbc 100644 --- a/mpp/codec/dec/vp9/vp9d_parser.c +++ b/mpp/codec/dec/vp9/vp9d_parser.c @@ -15,17 +15,20 @@ * limitations under the License. */ #include -#include "mpp_packet.h" -#include "mpp_packet_impl.h" + +#include + +#include "mpp_env.h" #include "mpp_mem.h" #include "mpp_log.h" +#include "mpp_common.h" +#include "mpp_bitread.h" +#include "mpp_packet_impl.h" + #include "vp9data.h" #include "vp9d_codec.h" #include "vp9d_parser.h" -#include "mpp_common.h" -#include "mpp_bitread.h" -#include "mpp_env.h" -#include "string.h" + /** * Clip a signed integer into the -(2^p),(2^p-1) range. * @param a value to clip diff --git a/mpp/codec/dec/vp9/vp9d_parser.h b/mpp/codec/dec/vp9/vp9d_parser.h index 29975581..cb3eca59 100644 --- a/mpp/codec/dec/vp9/vp9d_parser.h +++ b/mpp/codec/dec/vp9/vp9d_parser.h @@ -16,17 +16,17 @@ */ #ifndef __VP9D_PARSER_H__ #define __VP9D_PARSER_H__ + #include -#include "rk_type.h" + +#include "mpp_mem.h" +#include "mpp_bitread.h" +#include "mpp_dec.h" + #include "vpx_rac.h" #include "vp9.h" #include "vp9data.h" -#include "mpp_packet.h" #include "vp9d_syntax.h" -#include "mpp_bitread.h" -#include "mpp_frame.h" -#include "mpp_mem.h" -#include "mpp_dec.h" extern RK_U32 vp9d_debug; diff --git a/mpp/codec/dec/vp9/vpx_rac.h b/mpp/codec/dec/vp9/vpx_rac.h index c2075260..62a16283 100644 --- a/mpp/codec/dec/vp9/vpx_rac.h +++ b/mpp/codec/dec/vp9/vpx_rac.h @@ -24,9 +24,10 @@ #define VPX_RAC_H #include -#include "mpp_common.h" #include +#include "mpp_common.h" + #define DECLARE_ALIGNED(n,t,v) t v typedef struct Vpxmv { @@ -55,4 +56,5 @@ int vpx_rac_get_prob_branchy(VpxRangeCoder *c, int prob); // rounding is different than vpx_rac_get, is vpx_rac_get wrong? int vpx_rac_get(VpxRangeCoder *c); int vpx_rac_get_uint(VpxRangeCoder *c, int bits); + #endif /* VPX_RAC_H */ diff --git a/mpp/codec/enc/vp8/vp8e_rc.h b/mpp/codec/enc/vp8/vp8e_rc.h index 305bc785..f6e535df 100644 --- a/mpp/codec/enc/vp8/vp8e_rc.h +++ b/mpp/codec/enc/vp8/vp8e_rc.h @@ -17,8 +17,6 @@ #ifndef __VP8E_RC_H__ #define __VP8E_RC_H__ -#include "rk_mpi.h" - #include "vp8e_syntax.h" #ifdef __cplusplus diff --git a/mpp/codec/inc/encoder_codec_api.h b/mpp/codec/inc/encoder_codec_api.h index 42d5f685..2d996825 100644 --- a/mpp/codec/inc/encoder_codec_api.h +++ b/mpp/codec/inc/encoder_codec_api.h @@ -17,7 +17,6 @@ #ifndef __CONTROL_API_H__ #define __CONTROL_API_H__ -#include "rk_mpi.h" #include "mpp_buf_slot.h" #include "hal_task.h" diff --git a/mpp/codec/inc/h264d_api.h b/mpp/codec/inc/h264d_api.h index 50b92677..ccba3564 100644 --- a/mpp/codec/inc/h264d_api.h +++ b/mpp/codec/inc/h264d_api.h @@ -19,8 +19,6 @@ #include "parser_api.h" - - typedef enum mpp_decmtd_type { MPP_DEC_NULL = 0, MPP_DEC_BY_SLICE = 0x1, diff --git a/mpp/codec/inc/mpp_enc.h b/mpp/codec/inc/mpp_enc.h index 6b1456f2..fecdfa70 100644 --- a/mpp/codec/inc/mpp_enc.h +++ b/mpp/codec/inc/mpp_enc.h @@ -17,8 +17,6 @@ #ifndef __MPP_ENC_H__ #define __MPP_ENC_H__ -#include "rk_mpi.h" - #include "mpp_thread.h" #include "mpp_controller.h" #include "mpp_hal.h" diff --git a/mpp/codec/inc/mpp_rc.h b/mpp/codec/inc/mpp_rc.h index 63d0669b..ab2027af 100644 --- a/mpp/codec/inc/mpp_rc.h +++ b/mpp/codec/inc/mpp_rc.h @@ -18,7 +18,7 @@ #define __MPP_RC__ #include "rk_mpi.h" -#include "mpp_err.h" + #include "mpp_log.h" #include "mpp_list.h" diff --git a/mpp/codec/inc/parser_api.h b/mpp/codec/inc/parser_api.h index 548ecd1c..9f2ce804 100644 --- a/mpp/codec/inc/parser_api.h +++ b/mpp/codec/inc/parser_api.h @@ -17,7 +17,6 @@ #ifndef __PARSER_API_H__ #define __PARSER_API_H__ -#include "rk_mpi.h" #include "mpp_packet.h" #include "mpp_buf_slot.h" #include "hal_task.h" diff --git a/mpp/codec/mpp_dec.cpp b/mpp/codec/mpp_dec.cpp index 40f173b5..b9bc8ef0 100644 --- a/mpp/codec/mpp_dec.cpp +++ b/mpp/codec/mpp_dec.cpp @@ -22,10 +22,8 @@ #include "mpp_mem.h" #include "mpp_log.h" #include "mpp_time.h" -#include "mpp_common.h" #include "mpp.h" -#include "mpp_frame.h" #include "mpp_buffer_impl.h" #include "mpp_packet_impl.h" #include "mpp_frame_impl.h" diff --git a/mpp/codec/mpp_enc.cpp b/mpp/codec/mpp_enc.cpp index 3c04242d..ea1c160d 100644 --- a/mpp/codec/mpp_enc.cpp +++ b/mpp/codec/mpp_enc.cpp @@ -21,12 +21,10 @@ #include "mpp_env.h" #include "mpp_log.h" #include "mpp_mem.h" -#include "mpp_common.h" + +#include "mpp_packet_impl.h" #include "mpp.h" -#include "mpp_frame_impl.h" -#include "mpp_packet.h" -#include "mpp_packet_impl.h" #include "hal_h264e_api.h" #define MPP_ENC_DBG_FUNCTION (0x00000001) diff --git a/mpp/common/h265e_syntax.h b/mpp/common/h265e_syntax.h index f6b4a1d2..686ff2eb 100644 --- a/mpp/common/h265e_syntax.h +++ b/mpp/common/h265e_syntax.h @@ -17,8 +17,6 @@ #ifndef __H265E_SYNTAX_H__ #define __H265E_SYNTAX_H__ -#include "mpp_frame.h" - typedef struct H265eSyntax_t { RK_S32 idr_request; // RK_S32 eos; diff --git a/mpp/hal/common/h264/hal_h264e_com.h b/mpp/hal/common/h264/hal_h264e_com.h index c2371a6e..a0462cce 100644 --- a/mpp/hal/common/h264/hal_h264e_com.h +++ b/mpp/hal/common/h264/hal_h264e_com.h @@ -17,9 +17,8 @@ #ifndef __HAL_H264E_H__ #define __HAL_H264E_H__ -#include "rk_mpi_cmd.h" -#include "mpp_packet.h" #include "mpp_log.h" + #include "mpp_hal.h" #include "mpp_rc.h" #include "mpp_device.h" diff --git a/mpp/hal/vpu/h264e/hal_h264e_header.c b/mpp/hal/vpu/h264e/hal_h264e_header.c index f3bd3382..bd8bf561 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_header.c +++ b/mpp/hal/vpu/h264e/hal_h264e_header.c @@ -18,7 +18,6 @@ #include #include -#include "rk_mpi.h" #include "mpp_mem.h" #include "mpp_common.h" diff --git a/mpp/hal/vpu/h264e/hal_h264e_header.h b/mpp/hal/vpu/h264e/hal_h264e_header.h index 6ffa217c..b623a245 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_header.h +++ b/mpp/hal/vpu/h264e/hal_h264e_header.h @@ -20,7 +20,6 @@ #include #include -#include "rk_mpi.h" #include "hal_h264e_com.h" MPP_RET h264e_vpu_init_extra_info(void *extra_info); diff --git a/mpp/hal/vpu/h264e/hal_h264e_rc.c b/mpp/hal/vpu/h264e/hal_h264e_rc.c index 1f544065..a7dc8ce2 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_rc.c +++ b/mpp/hal/vpu/h264e/hal_h264e_rc.c @@ -18,7 +18,6 @@ #include #include -#include "rk_mpi.h" #include "mpp_mem.h" #include "mpp_common.h" diff --git a/mpp/hal/vpu/h264e/hal_h264e_rc.h b/mpp/hal/vpu/h264e/hal_h264e_rc.h index 56fbcde8..7b71edbd 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_rc.h +++ b/mpp/hal/vpu/h264e/hal_h264e_rc.h @@ -20,7 +20,6 @@ #include #include -#include "rk_mpi.h" #include "hal_h264e_com.h" extern const RK_S32 h264_q_step[]; diff --git a/mpp/hal/vpu/h264e/hal_h264e_vepu1.c b/mpp/hal/vpu/h264e/hal_h264e_vepu1.c index ab1d8545..ad22f551 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_vepu1.c +++ b/mpp/hal/vpu/h264e/hal_h264e_vepu1.c @@ -18,7 +18,6 @@ #include #include "mpp_device.h" -#include "rk_mpi.h" #include "mpp_rc.h" #include "mpp_env.h" diff --git a/mpp/hal/vpu/h264e/hal_h264e_vepu2.c b/mpp/hal/vpu/h264e/hal_h264e_vepu2.c index 4ac9ef6b..fa14dbe4 100644 --- a/mpp/hal/vpu/h264e/hal_h264e_vepu2.c +++ b/mpp/hal/vpu/h264e/hal_h264e_vepu2.c @@ -19,7 +19,6 @@ #include #include "mpp_device.h" -#include "rk_mpi.h" #include "mpp_env.h" #include "mpp_mem.h" #include "mpp_frame.h" diff --git a/mpp/hal/worker/mpp_device/mpp_device.c b/mpp/hal/worker/mpp_device/mpp_device.c index e43073b2..06723c11 100644 --- a/mpp/hal/worker/mpp_device/mpp_device.c +++ b/mpp/hal/worker/mpp_device/mpp_device.c @@ -24,12 +24,13 @@ #include "mpp_env.h" #include "mpp_log.h" +#include "mpp_mem.h" #include "mpp_time.h" +#include "mpp_common.h" #include "mpp_device.h" #include "mpp_device_patch.h" #include "mpp_platform.h" -#include "mpp_mem.h" #include "vpu.h" diff --git a/mpp/inc/mpp.h b/mpp/inc/mpp.h index 358cb4d1..d467c1a9 100644 --- a/mpp/inc/mpp.h +++ b/mpp/inc/mpp.h @@ -17,11 +17,10 @@ #ifndef __MPP_H__ #define __MPP_H__ -#include "mpp_list.h" #include "mpp_queue.h" + #include "mpp_dec.h" #include "mpp_enc.h" -#include "mpp_task.h" #include "mpp_impl.h" #define MPP_DBG_FUNCTION (0x00000001) diff --git a/mpp/legacy/vpu_api_legacy.h b/mpp/legacy/vpu_api_legacy.h index b958a09c..05b143ac 100644 --- a/mpp/legacy/vpu_api_legacy.h +++ b/mpp/legacy/vpu_api_legacy.h @@ -17,9 +17,10 @@ #ifndef _VPU_API_LEGACY_H_ #define _VPU_API_LEGACY_H_ +#include + #include "vpu_api.h" #include "rk_mpi.h" -#include #define OMX_BUFFERFLAG_EOS 0x00000001 diff --git a/mpp/mpi.cpp b/mpp/mpi.cpp index c0876e7c..2deeda1e 100644 --- a/mpp/mpi.cpp +++ b/mpp/mpi.cpp @@ -18,12 +18,10 @@ #include -#include "rk_mpi.h" - #include "mpp_log.h" #include "mpp_mem.h" + #include "mpi_impl.h" -#include "mpp.h" #include "mpp_info.h" #include "mpp_common.h" #include "mpp_env.h" diff --git a/osal/inc/mpp_common.h b/osal/inc/mpp_common.h index b842d7a8..ac0223a0 100644 --- a/osal/inc/mpp_common.h +++ b/osal/inc/mpp_common.h @@ -162,6 +162,25 @@ #define ARG_N_HELPER(...) ARG_T(ARG_N(__VA_ARGS__)) #define COUNT_ARG(...) ARG_N_HELPER(__VA_ARGS__,4,3,2,1,0) +#define SZ_1K (1024) +#define SZ_2K (SZ_1K*2) +#define SZ_4K (SZ_1K*4) +#define SZ_8K (SZ_1K*8) +#define SZ_16K (SZ_1K*16) +#define SZ_32K (SZ_1K*32) +#define SZ_64K (SZ_1K*64) +#define SZ_128K (SZ_1K*128) +#define SZ_256K (SZ_1K*256) +#define SZ_512K (SZ_1K*512) +#define SZ_1M (SZ_1K*SZ_1K) +#define SZ_2M (SZ_1M*2) +#define SZ_4M (SZ_1M*4) +#define SZ_8M (SZ_1M*8) +#define SZ_16M (SZ_1M*16) +#define SZ_32M (SZ_1M*32) +#define SZ_64M (SZ_1M*64) +#define SZ_80M (SZ_1M*80) +#define SZ_128M (SZ_1M*128) #ifdef __cplusplus extern "C" { diff --git a/osal/inc/mpp_log.h b/osal/inc/mpp_log.h index 896122d5..acd9c5e7 100644 --- a/osal/inc/mpp_log.h +++ b/osal/inc/mpp_log.h @@ -17,10 +17,11 @@ #ifndef __MPP_LOG_H__ #define __MPP_LOG_H__ -#include "rk_type.h" #include #include +#include "rk_type.h" + /* * mpp runtime log system usage: * mpp_err is for error status message, it will print for sure. diff --git a/osal/inc/mpp_platform.h b/osal/inc/mpp_platform.h index 1b3593c9..44d09555 100644 --- a/osal/inc/mpp_platform.h +++ b/osal/inc/mpp_platform.h @@ -17,7 +17,6 @@ #ifndef __MPP_PLATFORM__ #define __MPP_PLATFORM__ -#include "rk_type.h" #include "rk_mpi.h" /* diff --git a/osal/inc/mpp_runtime.h b/osal/inc/mpp_runtime.h index 7606f364..908d31c9 100644 --- a/osal/inc/mpp_runtime.h +++ b/osal/inc/mpp_runtime.h @@ -17,7 +17,7 @@ #ifndef __MPP_RUNTIME__ #define __MPP_RUNTIME__ -#include "rk_mpi.h" +#include "mpp_buffer.h" #ifdef __cplusplus extern "C" { diff --git a/osal/mpp_allocator.cpp b/osal/mpp_allocator.cpp index 21c515ab..dc3ff450 100644 --- a/osal/mpp_allocator.cpp +++ b/osal/mpp_allocator.cpp @@ -18,6 +18,7 @@ #include "mpp_log.h" #include "mpp_mem.h" +#include "mpp_common.h" #include "mpp_allocator.h" #include "mpp_allocator_impl.h" diff --git a/test/mpi_test.c b/test/mpi_test.c index ed8c3120..98693347 100644 --- a/test/mpi_test.c +++ b/test/mpi_test.c @@ -24,7 +24,7 @@ #include "rk_mpi.h" #include "mpp_log.h" #include "mpp_env.h" - +#include "mpp_common.h" #define MPI_DEC_LOOP_COUNT 4 #define MPI_ENC_LOOP_COUNT 4 diff --git a/utils/utils.h b/utils/utils.h index 5fa6389e..98bc5c9c 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -19,7 +19,6 @@ #include -#include "mpp_err.h" #include "mpp_frame.h" typedef struct OptionInfo_t {