【发布时间】:2014-11-26 22:09:55
【问题描述】:
我正在使用以下代码:
#include <stdlib.h>
#include <fcntl.h>
int main(int argc, char **argv) {
char *auyvy = malloc(640 * 480 * 2);
char *ay8 = malloc(640 * 480);
int fd = open("input.uyvy", O_RDONLY);
if (fd >= 0) {
read(fd, auyvy, 640 * 480 * 2);
close(fd);
}
__uyvy_luma_extract(640, 480, auyvy, 640 * 2, ay8, 640);
fd = open("output.y8", O_RDWR | O_CREAT);
if (fd >= 0) {
write(fd, ay8, 640 * 480);
close(fd);
}
}
还有两个附加文件: https://github.com/emrainey/DVP/blob/master/libraries/public/yuv/__uyvy_luma_extract.S https://github.com/emrainey/DVP/blob/master/libraries/public/yuv/yuv.inc
我用“gcc -g convert.c __uyvy_luma_extract.S -mfpu=neon”编译
奇怪的是,程序在转换过程中崩溃了。知道我做错了什么吗?
* 首次编辑 * 我已经上传了一个包含各种文件的 zip 文件,以便在 ARM 平台上轻松重现:http://www.gentil.com/tmp/convert.zip
* 第二次编辑 * 我更新了不正确的程序集文件链接。
* 第三次编辑 * gdb 给出以下内容:
Starting program: /home/ai/convert/convert
Program received signal SIGSEGV, Segmentation fault.
0x00008036 in ?? ()
(gdb) bt
#0 0x00008036 in ?? ()
#1 0x000084f2 in __uyvy_luma_extract () at __uyvy_luma_extract.S:38
#2 0x000084f2 in __uyvy_luma_extract () at __uyvy_luma_extract.S:38
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
【问题讨论】: