summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a10937)
raw | patch | inline | side by side (parent: 5a10937)
author | Djordje Senicic <d-senicic1@ti.com> | |
Wed, 23 Mar 2016 11:15:25 +0000 (07:15 -0400) | ||
committer | Djordje Senicic <d-senicic1@ti.com> | |
Wed, 23 Mar 2016 11:15:25 +0000 (07:15 -0400) |
index 525c7684c048536ae5bedae9b4b55b2203931c8b..48c7764870e7f6c96362c4341c2cee5623b09adb 100644 (file)
static const GEnumValue dsp66_video_kernel_filtersizes[] = {
{GST_DSP66_VIDEO_KERNEL_FILTERSIZE_5, "Kernel of 5 neighbour pixels", "5"},
{GST_DSP66_VIDEO_KERNEL_FILTERSIZE_9, "Kernel of 9 neighbour pixels", "9"},
+ {GST_DSP66_VIDEO_KERNEL_FILTERSIZE_25, "Kernel of 25 neighbour pixels", "25"},
{0, NULL, NULL},
};
static const GEnumValue dsp66_video_kerneltype[] = {
{GST_DSP66_VIDEO_KERNELTYPE_MEDIAN, "Kernel median", "0"},
{GST_DSP66_VIDEO_KERNELTYPE_SOBEL, "Kernel sobel", "1"},
+ {GST_DSP66_VIDEO_KERNELTYPE_CONV, "Kernel conv", "2"},
{0, NULL, NULL},
};
index 7cb2c72958ff6091f5fd0a90aede0caa14d697ae..9d79b1550635c4ed51c5c70e3f8cbd00c66c76c9 100644 (file)
{
GST_DSP66_VIDEO_KERNEL_FILTERSIZE_5 = 5,
GST_DSP66_VIDEO_KERNEL_FILTERSIZE_9 = 9,
+ GST_DSP66_VIDEO_KERNEL_FILTERSIZE_25 = 25
} GstDsp66VideoKernelFilterSize;
typedef enum {
GST_DSP66_VIDEO_KERNELTYPE_MEDIAN = 0,
- GST_DSP66_VIDEO_KERNELTYPE_SOBEL
+ GST_DSP66_VIDEO_KERNELTYPE_SOBEL = 1,
+ GST_DSP66_VIDEO_KERNELTYPE_CONV = 2
} GstDsp66VideoKernelType;
struct _GstDsp66VideoKernel {
index bc9aceddccd6f754d304df733ba2fede20c1e230..6c86e52298b655debf3ea443d719b014a115d567 100644 (file)
#define PIX_SWAP(a,b) { unsigned char temp=(a);(a)=(b);(b)=temp; }
void IMG_median_3x3_8 (const unsigned char *restrict in_data, int cols, unsigned char * restrict out_data);
-void IMG_sobel_3x3_8 (const unsigned char *restrict in_data, unsigned char * restrict out_data, int rows, int cols);
+void IMG_sobel_3x3_8 (const unsigned char *restrict in_data, unsigned char *restrict out_data, int rows, int cols);
+void IMG_conv_3x3_i8_c8s (const unsigned char *restrict in_data, unsigned char *restrict out_data, int cols, const char *restrict mask, int shift);
kernel void Median3x3(global const uchar* src, global uchar *dest,
const int width, const int height,
IMG_sobel_3x3_8((const unsigned char *)src, (const unsigned char *)dest, width, height);
}
+kernel void Conv5x5(global const uchar* src, global uchar *dest,
+ const int width, const int height,
+ const int dstride, const int sstride)
+{
+ int i;
+ const char conv_mask5x5[25] = {
+ 1, 4, 6, 4, 1,
+ 4,16,24,16, 4,
+ 6,24,36,24, 6,
+ 4,16,24,16, 4,
+ 1, 4, 6, 4, 1
+ };
+ for (i = 0; i < height; i++) {
+ IMG_conv_5x5_i8_c8s ((const unsigned char *)src, (unsigned char *)dest, width, sstride, conv_mask5x5, 8);
+ src += sstride;
+ dest += dstride;
+ }
+}
+
kernel void Median2x2 (global const uchar* src, global uchar *dest,
const int width, const int height,
const int dstride, const int sstride)
index 601ea32807d43646d94e49d0bb2e35032dd1d1b2..c7b722c99f62207992d525497ec3b9d868c8f0e1 100644 (file)
retval = oclconv_imgproc("Sobel3x3", data_in, data_out, width, height, sstride, dstride);
}
break;
+ case 2: /* conv */
+ if(filter_size == 25) {
+ retval = oclconv_imgproc("Conv5x5", data_in, data_out, width, height, sstride, dstride);
+ return 0;
+ }
+ break;
default:
break;
}