dm8148 jpeg合成问题

本文详细记录了解决JPEG合成与编码过程中遇到的几个关键问题,包括YUV数据复制错误导致合成图片质量下降,以及在不同通道解码时的配置错误。通过修正这些问题,最终成功实现了JPEG的正确合成与编码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1)测试8148平台jpeg合成问题,将4张1080p的jpeg图片依次送入到videoM3,依次进行jpeg解码,解码成yuv420sp的数据后,在A8进行yuv420sp的4帧图像合成一帧yuv420sp的3840*2160分辨率的yuv,然后送入到videoM3进行编码,编码成jpeg,在送回A8;保存jpeg;测试结果ok;

测试中出现的问题;
1)开始合成的jpeg图片有问题,将中间结果1080p的yuv420sp数据保存下来,使用yuv查看工具进行播放,发现中间结果没有问题;
2)然后查找原因,发现是yuv数据copy有问题,应该拷贝到一个buff中;
3)修改完后,发现保存的jpeg数据还是有问题,将合成后的yuv数据保存下来用yuv工具查看没有问题;最后定位发现是将yuv数据copy到


    vidBufList.frames[0].addr[0][1] = bufs[0].vir_addr+iWidth*iHeight;          //g_ImageWidth*g_ImageHeight;
    vidBufList.frames[0].phyAddr[0][1] =bufs[0].phys_addr+iWidth*iHeight;       //g_ImageWidth*g_ImageHeight;
    原来是g_ImageWidth(1920)*g_ImageHeight(1080);改成(iWidth(3840)*iHeight(2160))
问题解决;

4)在送入2帧1080p的图片到videoM3不同的通道进行解码时,遇到的问题;
第2个通道送入不了图片,定位发现时调用ipcbitsoutLink时,通道设置错误,示意代码如下:错误时,对第2个buff,也是设置成第0个通道了;

                for(i = 0;i < emptyBitsBufList.numBufs;i++)
  {
    emptyBitsBufList.bufs[i]->channelNum = i;//0
  }
    
5)修改完后,第2个通道videoM3解码还是有问题;报错;

错误码:200000 第21位为1表示 :Not supported output chroma format set by the application to the codec
图片问题;

获取USB摄像头的1080p的JPEG格式的图片20180608_1806.7z 电脑上的系统:ubuntu14.04 // http://www.linuxidc.com/Linux/2011-03/33020.htm // V4L2摄像头获取单幅图片测试程序(MMAP模式) // [日期:2011-03-06] 来源:Linux社区 作者:aokikyon [字体:大 中 小] // // #加了点注释 // // #Rockie Cheng // printf #include #include // memset #include #include #include #include // close write usleep read #include #include #include #include #include #include // mmap #include #include #include #include // pthread_create pthread_join #include #define CLEAR(x) memset (&(x), 0, sizeof (x)) #define REQ_COUNT 6 #define uchar unsigned char struct buffer { void * start; size_t length; }; static char * dev_name = "/dev/video0";//摄像头设备名 static int fd = -1; struct buffer * buffers = NULL; // static unsigned int n_buffers = 0; // 2012-7-13 11:33 camera flag // static int iFlagCamera = 0; volatile int iFlagCamera = 0; // 函数名称:thread1 // 函数功能:用于接受键盘的输入,之后通知thread2抓图 // 参数列表: // 返回值 : void thread1(void) { char ch; printf("\n !!!!Warning!!!!\n Max 1000 color bmp\n Input the char: \n"); printf("\n !!!!press o an capture 1 frame picture! \n"); printf("\n !!!!press t an capture 10 frame picture! \n"); printf("\n !!!!press h an capture 100 frame picture! \n"); while(1) { while((ch=getchar()) != '\n') { printf("%c\n", ch); if('o'==ch) { iFlagCamera = 1; printf("thread1=%d\n", iFlagCamera); } else if('t'==ch) { iFlagCamera = 10; printf("thread1=%d\n", iFlagCamera); } else if('h'==ch) { iFlagCamera = 101; printf("thread1=%d\n", iFlagCamera); } else if('q'==ch) { iFlagCamera = 10001; printf("thread1=%d\n", iFlagCamera
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值