页次: 1
https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/simd/arm/aarch32/jsimd_neon.S
这里有 neno 指令加速的 RGB YUV 互转的代码, 可以参考一下.
arm9没有NENO的吧。。。。
f1c100_ 说:哦豁哦豁 说:楼主真是一个神奇的存在, 膜拜大神.
请问可以提供一个荔枝派nano或者widora tiny200的固件吗?
DD了个nano的TF固件出来
https://whycan.com/files/members/5219/nano-tf.rarroot目录下执行./demo jpg文件就行了
例如:
./demo ./123.jpg感谢大佬分享, 请问是用哪组串口呢?我用widora tiny200测试了一下,发现串口没有输出呢。
好像nano默认的0串口输出,tiny200是1串口
楼主真是一个神奇的存在, 膜拜大神.
请问可以提供一个荔枝派nano或者widora tiny200的固件吗?
DD了个nano的TF固件出来
https://whycan.com/files/members/5219/nano-tf.rar
root目录下执行./demo jpg文件就行了
例如:
./demo ./123.jpg
自己来填完这个坑吧。
后面又继续跑了.264硬解,还是有这个问题,首先硬解是肯定能用的,那估计就是哪里的转换格式出问题了。
找了一番源码目录,看到xplayer下有个配置文件:vd_output_fmt = mb32,感觉格式问题八九不离十了。
仔细阅读了源码,videodecoder的格式是由vconfig中的eOutputPixelFormat控制的,有以下格式可选:
但是很可惜,我测试了下,f1c100/200不管怎么设置都没用,只能使用yuv_mb32,mb32是个什么鬼格式?谷歌翻箱倒柜找到全志文档:
简单的说就是以tile为单位进行扫描,一般一个tile为32x32,知道原理就好办了,修改下转换,这是结果:
源图:
转换后:
bingo,成功转换,但是能看到有不小的色差,这应该是yuv->rgb的转换公式问题,后面修改下校正就行了,关键的问题已经解决了
.264视频的硬解应该也要这样搞
还是这个解码库
https://github.com/EmperG/lindenis-v536-package
jpeg硬解码研究了好久没搞起来,想跑一下.264解码但是cedarx编译不起来,提示没有cdxlist.i也不知道咋搞,希望有大神能研究下跑起来
使用主线5.2,按照这个教程成功安装了cedar,dev出现了cedar和ion设备,下面的cedarx也装一下,这样就不用拷so库了
https://github.com/aodzip/cedar/
编译链要用这个:
https://pan.baidu.com/s/1-WXlwxLoQNzKGDdIJ5JDpw
buildroot里的cedarc要改一下
主要看lindenis-v536-package里面的
tina_multimedia和tina_multimedia_demo两个文件夹,
先编译tina_multimedia/cedarc,按照里面的readme说明编译,平台选arm-none-linux-gnueabi,注意编译的时候统一编译链,configure和make都带上CC=/...你的编译链路径
jpeg和.264硬编码的demo在/tina_multimedia_demo/encodertest/src,修改makefile文件如下:
Target = demo
SourceIncludePath := -I/work/tina_multimedia/libcedarx/libcore/base/include -I/work/tina_multimedia/libcedarc/include -L/work/libcedarc/lib -L/work/tina_multimedia/libcedarc/library/arm-none-linux-gnueabi
CompileFlags = $(CFLAGS) $(SourceIncludePath)
LoadFlags += -lvencoder -lMemAdapter -lpthread -ldl -lm
CC=/work/arm-2014.05/bin/arm-none-linux-gnueabi-gcc
LDFLAGS= -Wl,-rpath-link /work/tina_multimedia/libcedarc/library/arm-none-linux-gnueabi -Wl,-rpath-link /work/tina_multimedia/libcedarc/base/.libs
$(Target): encodertest.c
$(CC) -o $@ $^ $(CompileFlags) $(LDFLAGS) $(LoadFlags)
路径名字对应改就行,其中/work/libcedarc/lib路径是编译tina_multimedia时的输出安装路径
然后make就生成程序了,直接拷到板子就能运行(前面buildroot已经安装了库所以不用拷)
测试程序,支持jpg和.264编码,前面的1表示编码成jpg,后面的1表示1帧
./demo 1 YUV420 800 480 800 480 1 ./123.yuv /root
debug : cedarc <VeSetSpeed:1559>: *** set ve freq to 300 Mhz ***
debug : cedarc <VeInitialize:1198>: ve init ok
debug : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
debug : ionAlloc <ion_alloc_open:134>:begin ion_alloc_open
debug : cedarc <VeSetSpeed:1559>: *** set ve freq to 300 Mhz ***
debug : cedarc <VeInitialize:1198>: ve init ok
debug : ionAlloc <ion_alloc_open:175>:** phy offset = 40000000
debug : cedarc <VeRelease:1253>: ve release ok
debug : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
debug : ionAlloc <ion_alloc_open:134>:begin ion_alloc_open
debug : cedarc <VideoEncInit:195>: (f:VideoEncInit, l:195)
debug : cedarc <VideoEncInit:210>: (f:VideoEncInit, l:210)
debug : cedarc <BitStreamCreate:102>: BitStreamCreate OK
encode frame 0 use time is 5263us...
the average encode time is 5263us...
debug : cedarc <VeRelease:1253>: ve release ok
output file is saved:/root
编码结果,5ms一帧,还是挺快的。
这里提供个YUV420文件供测试:
https://whycan.com/files/members/5219/yuv.rar
到此f1c200/100 的硬编码基本论证了,就剩解码了
继续研究lindenis-v536-package这个库ING......
我用f1c100s试了下出现这个错误:
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0: Could not initialize supporting library.
Additional debug info:
gstvideodecoder.c(2530): gst_video_decoder_change_state (): /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
Failed to open decoder
Setting pipeline to NULL ...
Freeing pipeline
我在builroot没有看到gst1-plugins-bayer2rgb-neon这个选项,跟这个有关系吗
嵌入式小白一个,跑这个demo搞了好久,搞了两天终于跑起demo,主要是编译链的问题搞了好久
使用主线5.2,按照这个教程成功安装了cedar,dev出现了cedar和ion设备
https://github.com/aodzip/cedar/
编译链要用这个:
https://pan.baidu.com/s/1-WXlwxLoQNzKGDdIJ5JDpw
测试了几个编译链都不行,各种问题,用上面的就可以,buildroot根文件系统也要统一用这个
下载这个解码库,里面有f1c200s的配置,所以应该是可以用的
https://github.com/EmperG/lindenis-v536-package
主要看里面的
tina_multimedia和tina_multimedia_demo两个文件夹
进入libcedarc按照里面的说明文件编译,平台选arm-none-linux-gnueabi,注意编译的时候统一编译链,configure和make都带上CC=/...你的编译链路径
进入tina_multimedia/jpegdecode,继续make,注意带编译链路径
进入tina_multimedia_demo/jpegdecodedemo,makefile文件可以借鉴一下改成我这个:
Target = demo
SourceIncludePath := -I/tina_multimedia/jpegdecode -I/tina_multimedia/libcedarc/include -L/tina_multimedia/jpegdecode -L/output/libcedarc/lib -L/tina_multimedia/libcedarc/library/arm-none-linux-gnueabi
CompileFlags = $(CFLAGS) $(SourceIncludePath)
LoadFlags += -ljpegdecode -lvdecoder -lVE \
-lMemAdapter -lcdc_base -ldl
CC=/opt/arm-2014.05/bin/arm-none-linux-gnueabi-gcc
LDFLAGS= -Wl,-rpath-link /tina_multimedia/libcedarc/library/arm-none-linux-gnueabi
$(Target): jpegdecodedemo.c
$(CC) -o $@ $^ $(CompileFlags) $(LDFLAGS) $(LoadFlags)
路径名字对应改就行,很好看懂,其中/output/libcedarc/lib路径是编译tina_multimedia时的输出路径
然后make就有程序生成了,用arm-none-linux-gnueabi-readelf命令看一下依赖库,把对应的库拷到板子的/lib文件夹,如libvideoengine.so这些可能没显示,但是运行出错会提示缺什么的,缺就都拷进去就行了
这是运行效果:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tina_multimedia <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
tag : tina3.5
branch: tina-dev
date : Mon Jul 15 19:04:59 2019 +0800
Change-Id: I5f6c8a88d7b387a312b7744797a0d5f8ab07ee7a
-------------------------------------------------------------------------------
debug : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
debug : ionAlloc <ion_alloc_open:134>:begin ion_alloc_open
debug : cedarc <VeSetSpeed:1559>: *** set ve freq to 300 Mhz ***
debug : cedarc <VeInitialize:1198>: ve init ok
debug : ionAlloc <ion_alloc_open:175>:** phy offset = 40000000
debug : cedarc <VeRelease:1253>: ve release ok
DEBUG : jpegdecode <JpegDecoderCreate:406>: AddVDPlugin first
warning: cedarc <AddVDPlugin:1538>: 1117 get local path: /lib/
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawh265.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawh265.so
warning: cedarc <VDecoderRegister:127>: register codec: '116:h265' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmpeg4h263.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawmpeg4h263.so
warning: cedarc <VDecoderRegister:127>: register codec: '104:mpeg4H263' success.
warning: cedarc <VDecoderRegister:127>: register codec: '10b:mpeg4H263' success.
warning: cedarc <VDecoderRegister:127>: register codec: '10d:mpeg4H263' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawavs.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawavs.so
warning: cedarc <VDecoderRegister:127>: register codec: '117:avs' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmjpeg.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawmjpeg.so
warning: cedarc <VDecoderRegister:127>: register codec: '101:mjpeg' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmpeg4normal.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawmpeg4normal.so
warning: cedarc <VDecoderRegister:127>: register codec: '10a:mpeg4Normal' success.
warning: cedarc <VDecoderRegister:127>: register codec: '10c:mpeg4Normal' success.
warning: cedarc <VDecoderRegister:127>: register codec: '108:mpeg4Normal' success.
warning: cedarc <VDecoderRegister:127>: register codec: '109:mpeg4Normal' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmjpegplus.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawmjpegplus.so
warning: cedarc <VDecoderRegister:127>: register codec: '101:mjpegplus' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawh264.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawh264.so
warning: cedarc <VDecoderRegister:127>: register codec: '115:h264' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawvp9Hw.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawvp9Hw.so
warning: cedarc <VDecoderRegister:127>: register codec: '113:Vp9Hw' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawwmv3.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawwmv3.so
warning: cedarc <VDecoderRegister:127>: register codec: '110:vc1' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmpeg4dx.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawmpeg4dx.so
warning: cedarc <VDecoderRegister:127>: register codec: '105:mpeg4dx' success.
warning: cedarc <VDecoderRegister:127>: register codec: '106:mpeg4dx' success.
warning: cedarc <VDecoderRegister:127>: register codec: '107:mpeg4dx' success.
warning: cedarc <VDecoderRegister:127>: register codec: '10e:mpeg4dx' success.
warning: cedarc <VDecoderRegister:127>: register codec: '10f:mpeg4dx' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmpeg4vp6.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawmpeg4vp6.so
warning: cedarc <VDecoderRegister:127>: register codec: '111:Mpeg4Vp6' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmpeg2.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawmpeg2.so
warning: cedarc <VDecoderRegister:127>: register codec: '102:mpeg2' success.
warning: cedarc <VDecoderRegister:127>: register codec: '103:mpeg2' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawvp8.so
debug : cedarc <AddVDPluginSingle:1501>: vdecoder open lib: /lib/libawvp8.so
warning: cedarc <VDecoderRegister:127>: register codec: '112:vp8' success.
warning: cedarc <AddVDPlugin:1548>: 1117 load so: /lib/libawmpeg4base.so
warning: cedarc <AddVDPluginSingle:1498>: Invalid plugin, CedarPluginVDInit not found.
srcBuf = 0x1a7e8,srcBufLen = 25676
JpegDecoderSetDataSource end
debug : cedarc <LogVersionInfo:40>:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Cedar Codec <<<<<<<<<<<<<<<<<<<<<<<<<<<<
tag : CedarC-v1.1.9
branch: master
commit: 1951abe1456450ea48bfd446e801861a1354e93c
date : Wed May 30 18:59:36 2018 +0800
author: jenkins8080
patch :
----------------------------------------------------------------------
debug : cedarc <CreateVideoDecoder:215>:CreateVideoDecoder ****
debug : cedarc <InitializeVideoDecoder:344>:*** pVconfig->nVeFreq = 0
debug : ionAlloc <__GetIonMemOpsS:985>:*** get __GetIonMemOpsS ***
debug : ionAlloc <ion_alloc_open:134>:begin ion_alloc_open
warning: cedarc <InitializeVideoDecoder:422>:warning: the nDecodeSmoothFrameBufferNum is 0
warning: cedarc <InitializeVideoDecoder:428>:warning: the nDeInterlaceHoldingFrameBufferNum is 0
warning: cedarc <InitializeVideoDecoder:434>:warning: the nDisplayHoldingFrameBufferNum is 0
debug : cedarc <DecideStreamBufferSize:1897>:nBufferSize=2097152
debug : cedarc <VeSetSpeed:1559>: *** set ve freq to 300 Mhz ***
debug : cedarc <VeInitialize:1198>: ve init ok
debug : cedarc <VideoEngineCreate:388>: *** pEngine->nIcVeVersion = 1663, decIpVersion = 0
debug : cedarc <CreateSpecificDecoder:1209>: Create decoder '101:mjpeg'
debug : cedarc <VideoEngineCreate:481>: **************eCtlAfcbMode = 0
debug : cedarc <GetSbmInterface:1705>:*********GetSbmInterface, nType=0
debug : cedarc <GetSbmInterfaceStream:732>:******* sbm-type: Stream*******
DEBUG : jpegdecode <JpegDecoderGetFrame:616>: Request Video Stream Buffer ok
DEBUG : jpegdecode <JpegDecoderGetFrame:636>: Copy Video Stream Data ok!
DEBUG : jpegdecode <JpegDecoderGetFrame:652>: Submit Video Stream Data ok!
debug : fbm.c <FbmCreateBuffer:133>:FbmCreate, total fbm number: 2, decoder needed: 2, nWidth=200, nHeight=200 nAlignStride = 0
debug : fbm.c <FbmCreateBuffer:226>:** call allocate pic buf, i = 0, maxNum = 2
debug : fbm.c <FbmCreateBuffer:379>:*** finish fbmCreateBuffer
decode time = 4194 us
DEBUG : jpegdecode <JpegDecoderGetFrame:680>: decoder one pic...
DEBUG : jpegdecode <JpegDecoderGetFrame:681>: pic nWidth is 224,nHeight is 224
DEBUG : jpegdecode <JpegDecoderGetFrame:682>: videoPicture->nWidth = 224,videoPicture->nHeight = 224,videoPicture->nLineStride = 224
DEBUG : jpegdecode <JpegDecoderGetFrame:684>: videoPicture->nTopOffset = 0,videoPicture->nLeftOffset = 0,videoPicture->nBottomOffset = 200,videoPicture->nRightOffset = 200
DEBUG : jpegdecode <JpegDecoderGetFrame:704>: ready flush YUV cache
ready save yuvDEBUG : jpegdecode <saveYuvPic:184>: acturalWidth = 200,height = 200
DEBUG : jpegdecode <saveYuvPic:225>: save yuv data successfully,path = /root/yuv200_200_nv21.dat
DEBUG : jpegdecode <JpegDecoderGetFrame:774>: free jpeg data
JpegDecoderGetFrame successfully,imgFrame->mWidth = 224,imgFrame->mHeight = 224,imgFrame->mYuvData = 0x3cc40,imgFrame->mYuvSize = 60000
imgFrame->mRGB565Data = (nil),imgFrame->mRGB565Size = 0
debug : cedarc <VeRelease:1253>: ve release ok
想自己画个f1c100s的板子,看荔枝派这些都是rgb666的,想改成rgb888的,要改的话就把引脚连上,然后在suniv.dtsi文件中(如下)增加引脚就可以了吗?这样内核就能自动识别哪个脚是哪个脚?还是要在哪个文件中规定下如pd0~pd7是r数据之类的?小白刚入门,劳烦各位路过的大神帮帮忙:)
lcd_rgb666_pins: lcd-rgb666-pins {
pins = "PD0", "PD1", "PD2", "PD3", "PD4",
"PD5", "PD6", "PD7", "PD8", "PD9",
"PD10", "PD11", "PD12", "PD13", "PD14",
"PD15", "PD16", "PD17", "PD18", "PD19",
"PD20", "PD21";
function = "lcd";
};
页次: 1