projectNe10 / Ne10

An open optimized software library project for the ARM® Architecture
Other
1.46k stars 408 forks source link

Using boxfilter function dealing with image, output image is error! #223

Open zhangcaihongHIK opened 5 years ago

zhangcaihongHIK commented 5 years ago

I test the boxfilter function, but the output image have vertical grains ! Next is my code! Please help me! char dataFile = "srcYUV.yuv"; char dataOut = "outYUV.yuv"; unsigned char dataY = NULL, dataY_out = NULL; int img_w = 341; int img_h = 436; int y_size = img_h * img_w; int uv_size = y_size / 2;

FILE *fpt = NULL;
dataY = (unsigned char*) malloc(y_size);
dataY_out = (unsigned char*) malloc(y_size);

fpt = fopen(dataFile, "rb");
if(NULL == fpt)
{
    printf("file is Null!\n");
    return -1;
}
fread(dataY, 1, y_size, fpt);   
fclose(fpt);

src_sz_ne10.x = img_w;
src_sz_ne10.y = img_h;
kernel_ne10.x = 5;
kernel_ne10.y = 5;
src_stride_ne10 = (ne10_int32_t)img_w;
dst_stride_ne10 = (ne10_int32_t)img_w;

ne10_img_boxfilter_rgba8888_neon (src_ne10, dst_ne10, src_sz_ne10, src_stride_ne10, dst_stride_ne10, kernel_ne10);
printf("OUT\n");
for(i = 0; i < src_size.size_y; i ++)
{
    for(j = 0; j < src_size.size_x; j ++)
    {
        printf("%d," , *(dst + i * dst_stride + j));
    }
    printf("\n");
}
free(dataY_out);
free(dataY);