git clone https://github.com/rockchip-linux/mpp.git
cmake_minimum_required( VERSION 2.6.3 ) SET(TOOLCHAIN_HOME "/opt/zlg/m1126-sdk-v1.8.0-ga/host") SET(TOOLCHAIN_SYSTEM_ROOT "${TOOLCHAIN_HOME}/arm-buildroot-linux-gnueabihf/sysroot") SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_C_COMPILER ${TOOLCHAIN_HOME}/bin/arm-linux-gnueabihf-gcc) SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_HOME}/bin/arm-linux-gnueabihf-g ) #SET(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc") #SET(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g ") #SET(CMAKE_SYSTEM_PROCESSOR "armv7-a") SET(CMAKE_SYSTEM_PROCESSOR "armv7-a_hardfp") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${TOOLCHAIN_SYSTEM_ROOT}") SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} --sysroot=${TOOLCHAIN_SYSTEM_ROOT}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${TOOLCHAIN_SYSTEM_ROOT}") SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} --sysroot=${TOOLCHAIN_SYSTEM_ROOT}") add_definitions(-fPIC) add_definitions(-DARMLINUX) add_definitions(-D__gnu_linux__)
yanz@yanz-virtual-machine:~/ws/m1126-ws/mpp/build/linux/arm$ git diff ../../../test/mpi_dec_test.c diff --git a/test/mpi_dec_test.c b/test/mpi_dec_test.c index db54aa9a..6e1bfbdd 100644 --- a/test/mpi_dec_test.c b/test/mpi_dec_test.c @@ -631,7 631,7 @@ int dec_decode(MpiDecTestCmd *cmd) ret = mpi->control(ctx, MPP_DEC_GET_CFG, cfg); if (ret) { mpp_err("%p failed to get decoder cfg ret %d\n", ctx, ret); - goto MPP_TEST_OUT; //goto MPP_TEST_OUT; }
$ ./make-Makefiles.bash $ make
[root@M1126:/userdata/work]# ./mpi_enc_test mpp[2595]: mpi_enc_utils: usage: ./mpi_enc_test [options] mpp[2595]: mpi_enc_utils: -i input_file input frame file mpp[2595]: mpi_enc_utils: -o output_file output encoded bitstream file mpp[2595]: mpi_enc_utils: -w width the width of input picture mpp[2595]: mpi_enc_utils: -h height the height of input picture mpp[2595]: mpi_enc_utils: -hstride hor_stride the horizonal stride of input picture
mpp[2595]: mpi_enc_utils: -vstride ver_stride the vertical stride of input picture
mpp[2595]: mpi_enc_utils: -f format the format of input picture
mpp[2595]: mpi_enc_utils: -t type output stream coding type
mpp[2595]: mpi_enc_utils: -tsrc source type input file source coding type
mpp[2595]: mpi_enc_utils: -n max frame number max encoding frame number
mpp[2595]: mpi_enc_utils: -g gop reference mode gop_mode:gop_len:vi_len
mpp[2595]: mpi_enc_utils: -rc rate control mode set rc_mode
mpp[2595]: mpi_enc_utils: -bps bps target:min:max set tareget/min/max bps and rc_mode
mpp[2595]: mpi_enc_utils: -fps in/output fps set input and output frame rate
mpp[2595]: mpi_enc_utils: -qc quality control set qp_init/min/max/min_i/max_i
mpp[2595]: mpi_enc_utils: -s instance_nb number of instances
mpp[2595]: mpi_enc_utils: -v trace option q - quiet f - show fps
mpp[2595]: mpi_enc_utils: -l loop count loop encoding times for each frame
mpp[2595]: mpi_enc_utils: -ini ini file encoder extra ini config file
mpp[2595]: mpi_enc_utils: -slt slt file slt verify data file
mpp[2595]: mpi: mpp coding type support list:
mpp[2595]: mpi: type: dec id 0 coding: mpeg2 id 2
mpp[2595]: mpi: type: dec id 0 coding: mpeg4 id 4
mpp[2595]: mpi: type: dec id 0 coding: h.263 id 3
mpp[2595]: mpi: type: dec id 0 coding: h.264/AVC id 7
mpp[2595]: mpi: type: dec id 0 coding: h.265/HEVC id 16777220
mpp[2595]: mpi: type: dec id 0 coding: vp8 id 9
mpp[2595]: mpi: type: dec id 0 coding: VP9 id 10
mpp[2595]: mpi: type: dec id 0 coding: avs+ id 16777221
mpp[2595]: mpi: type: dec id 0 coding: jpeg id 8
mpp[2595]: mpi: type: enc id 1 coding: h.264/AVC id 7
mpp[2595]: mpi: type: enc id 1 coding: jpeg id 8
mpp[2595]: mpi: type: enc id 1 coding: h265 id 16777220
mpp[2595]: mpi: type: enc id 1 coding: vp8 id 9
mpp[2595]: mpi: mpp color support list:
mpp[2595]: mpi: color: id 0 0x00000 YUV420SP, NV12
mpp[2595]: mpi: color: id 1 0x00001 YUV420SP-10bit
mpp[2595]: mpi: color: id 2 0x00002 YUV422SP, NV24
mpp[2595]: mpi: color: id 3 0x00003 YUV422SP-10bit
mpp[2595]: mpi: color: id 4 0x00004 YUV420P, I420
mpp[2595]: mpi: color: id 5 0x00005 YUV420SP, NV21
mpp[2595]: mpi: color: id 6 0x00006 YUV422P, 422P
mpp[2595]: mpi: color: id 7 0x00007 YUV422SP, NV42
mpp[2595]: mpi: color: id 8 0x00008 YUV422-YUYV, YUY2
mpp[2595]: mpi: color: id 10 0x0000a YUV422-UYVY, UYVY
mpp[2595]: mpi: color: id 12 0x0000c YUV400-Y8, Y800
mpp[2595]: mpi: color: id 65536 0x10000 RGB565
mpp[2595]: mpi: color: id 65537 0x10001 BGR565
mpp[2595]: mpi: color: id 65538 0x10002 RGB555
mpp[2595]: mpi: color: id 65539 0x10003 BGR555
mpp[2595]: mpi: color: id 65542 0x10006 RGB888
mpp[2595]: mpi: color: id 65543 0x10007 BGR888
mpp[2595]: mpi: color: id 65546 0x1000a ARGB8888
mpp[2595]: mpi: color: id 65547 0x1000b ABGR8888
mpp[2595]: mpi: color: id 65548 0x1000c BGRA8888
mpp[2595]: mpi: color: id 65549 0x1000d RGBA8888
[root@M1126:/userdata/work]# ./mpi_enc_test -i /nfsroot/out.yuv -w 1280 -h 720 -f 0 -t 7 -o test.h264
mpp[2769]: mpi_enc_utils: cmd parse result:
mpp[2769]: mpi_enc_utils: input file name: /nfsroot/out.yuv
mpp[2769]: mpi_enc_utils: output file name: test.h264
mpp[2769]: mpi_enc_utils: width : 1280
mpp[2769]: mpi_enc_utils: height : 720
mpp[2769]: mpi_enc_utils: format : 0
mpp[2769]: mpi_enc_utils: type : 7
mpp[2769]: mpi_enc_test: ./mpi_enc_test start
mpp[2769]: mpp_rt: NOT found ion allocator
mpp[2769]: mpp_rt: found drm allocator
mpp[2769]: mpp_info: mpp version: unknown mpp version for missing VCS info
mpp[2769]: mpi_enc_test: 0xa6200f00 encoder test start w 1280 h 720 type 7
mpp[2769]: mpp_enc: MPP_ENC_SET_RC_CFG bps 3456000 [216000 : 3672000] fps [30:30] gop 60
mpp[2769]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [1280:720] stride [1280:720]
mpp[2769]: mpp_enc: send header for set cfg change input/format
mpp[2769]: mpp_enc: mode cbr bps [216000:3456000:3672000] fps fix [30/1] -> fix [30/1] gop i [60] v [0]
mpp[2769]: mpi_enc_test: chn 0 encoded frame 0 size 67565 qp 26
mpp[2769]: mpi_enc_test: chn 0 encoded frame 1 size 1122 qp 30
mpp[2769]: mpi_enc_test: chn 0 encoded frame 2 size 1828 qp 30
mpp[2769]: mpi_enc_test: chn 0 encoded frame 3 size 2268 qp 29
mpp[2769]: mpi_enc_test: chn 0 encoded frame 4 size 2214 qp 29
mpp[2769]: mpi_enc_test: chn 0 encoded frame 5 size 2808 qp 29
mpp[2769]: mpi_enc_test: chn 0 encoded frame 6 size 4411 qp 28
mpp[2769]: mpi_enc_test: chn 0 encoded frame 7 size 631 qp 28
mpp[2769]: mpi_enc_test: chn 0 encoded frame 8 size 3603 qp 28
mpp[2769]: mpi_enc_test: chn 0 encoded frame 9 size 5419 qp 27
mpp[2769]: mpi_enc_test: chn 0 encoded frame 10 size 4928 qp 27
mpp[2769]: mpi_enc_test: chn 0 encoded frame 11 size 5452 qp 27
mpp[2769]: mpi_enc_test: chn 0 encoded frame 12 size 7863 qp 26
mpp[2769]: mpi_enc_test: chn 0 encoded frame 13 size 8061 qp 26
mpp[2769]: mpi_enc_test: chn 0 encoded frame 14 size 7968 qp 26
mpp[2769]: mpi_enc_test: chn 0 encoded frame 15 size 10017 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 16 size 9626 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 17 size 9871 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 18 size 12122 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 19 size 11564 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 20 size 11743 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 21 size 12041 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 22 size 11708 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 23 size 12281 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 24 size 12371 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 25 size 12603 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 26 size 14447 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 27 size 14318 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 28 size 14128 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 29 size 13517 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 30 size 14285 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 31 size 15166 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 32 size 9709 qp 22
mpp[2769]: mpi_enc_test: chn 0 encoded frame 33 size 14751 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 34 size 16242 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 35 size 14935 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 36 size 20178 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 37 size 15628 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 38 size 17645 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 39 size 17803 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 40 size 18825 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 41 size 15040 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 42 size 18533 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 43 size 14788 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 44 size 15739 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 45 size 15090 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 46 size 14987 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 47 size 14316 qp 25
mpp[2769]: mpi_enc_test: chn 0 encoded frame 48 size 14175 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 49 size 14945 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 50 size 14401 qp 24
mpp[2769]: mpi_enc_test: chn 0 encoded frame 51 size 13822 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 52 size 13300 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 53 size 12938 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 54 size 12677 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 55 size 11675 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 56 size 11612 qp 23
mpp[2769]: mpi_enc_test: chn 0 encoded frame 57 size 5309 qp 22
mpp[2769]: mpi_enc_test: chn 0 encoded frame 58 size 12733 qp 22
mpp[2769]: mpi_enc_test: chn 0 encoded frame 59 size 13769 qp 21
mpp[2769]: mpi_enc_test: chn 0 encoded frame 60 size 87415 qp 22
mpp[2769]: mpi_enc_test: chn 0 encoded frame 61 size 13774 qp 21
mpp[2769]: mpi_enc_test: chn 0 encoded frame 62 size 12703 qp 21
mpp[2769]: mpi_enc_test: chn 0 encoded frame 63 size 12538 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 64 size 12033 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 65 size 11838 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 66 size 11369 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 67 size 11696 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 68 size 11482 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 69 size 12053 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 70 size 11180 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 71 size 11334 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 72 size 11111 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 73 size 11590 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 74 size 11024 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 75 size 11298 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 76 size 11227 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 77 size 11929 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 78 size 9830 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 79 size 13323 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 80 size 12235 qp 20
mpp[2769]: mpi_enc_test: chn 0 encoded frame 81 size 10322 qp 19
mpp[2769]: mpi_enc_test: chn 0 encoded frame 82 size 5105 qp 19
mpp[2769]: mpi_enc_test: chn 0 encoded frame 83 size 9695 qp 19
mpp[2769]: mpi_enc_test: chn 0 encoded frame 84 size 10840 qp 19
mpp[2769]: mpi_enc_test: chn 0 encoded frame 85 size 6981 qp 19
mpp[2769]: mpi_enc_test: chn 0 encoded frame 86 size 11858 qp 18
mpp[2769]: mpi_enc_test: chn 0 encoded frame 87 size 9534 qp 18
mpp[2769]: mpi_enc_test: chn 0 encoded frame 88 size 11070 qp 18
mpp[2769]: mpi_enc_test: chn 0 encoded frame 89 size 6388 qp 18
mpp[2769]: mpi_enc_test: chn 0 encoded frame 90 size 13718 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 91 size 9659 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 92 size 6635 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 93 size 14026 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 94 size 10668 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 95 size 7827 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 96 size 8041 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 97 size 11100 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 98 size 14170 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 99 size 13168 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 100 size 13566 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 101 size 11765 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 102 size 11228 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 103 size 13167 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 104 size 15722 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 105 size 17212 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 106 size 18401 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 107 size 8797 qp 15
mpp[2769]: mpi_enc_test: chn 0 encoded frame 108 size 15333 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 109 size 15713 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 110 size 16291 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 111 size 16249 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 112 size 15000 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 113 size 15626 qp 17
mpp[2769]: mpi_enc_test: chn 0 encoded frame 114 size 13236 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 115 size 11941 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 116 size 13356 qp 16
mpp[2769]: mpi_enc_test: chn 0 encoded frame 117 size 9908 qp 15
mpp[2769]: mpi_enc_test: chn 0 encoded frame 118 size 13896 qp 15
mpp[2769]: mpi_enc_test: chn 0 encoded frame 119 size 15244 qp 15
mpp[2769]: mpi_enc_test: chn 0 encoded frame 120 size 179532 qp 15
mpp[2769]: mpi_enc_test: chn 0 encoded frame 121 size 5584 qp 19
mpp[2769]: mpi_enc_test: chn 0 encoded frame 122 size 4825 qp 18
mpp[2769]: mpi_enc_test: chn 0 encoded frame 123 size 4350 qp 18
mpp[2769]: mpi_enc_test: chn 0 encoded frame 124 size 3935 qp 18
mpp[2769]: mpi_enc_test: chn 0 found last frame. feof 1
mpp[2769]: mpi_enc_test: chn 0 encoded frame 125 size 3935
mpp[2769]: mpi_enc_test: chn 0 found last packet
mpp[2769]: mpi_enc_test: chn 0 encode 126 frames time 1297 ms delay 6 ms fps 97.09 bps 3316405
mpp[2769]: mpi_enc_test: ./mpi_enc_test average frame rate 97.09