Skip to content

Instantly share code, notes, and snippets.

View astarasikov's full-sized avatar
🐈
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈

Alexander Tarasikov astarasikov

🐈
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈
View GitHub Profile
@astarasikov
astarasikov / opencv_patch_aravis_y422_color.patch
Created March 2, 2018 20:33
Y422 Color Capture support for Aravis in OpenCV
From ceb9d548a6ed86e5f20f3f0605872145097bfbb6 Mon Sep 17 00:00:00 2001
From: Alexander Tarasikov <[email protected]>
Date: Fri, 2 Mar 2018 21:32:01 +0100
Subject: [PATCH] NOMERGE: Add Y422 color format support to Aravis
---
modules/videoio/src/cap_aravis.cpp | 12 ++++++++++++
samples/cpp/videocapture_basic.cpp | 15 +++++++++++----
2 files changed, 23 insertions(+), 4 deletions(-)
@astarasikov
astarasikov / clang_cfu.c
Last active March 15, 2018 23:49
some macros to taint data with clang static analyzer without modifying and rebuilding llvm source
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef __CLANG_GHETTO_TAINT__H__
#define __CLANG_GHETTO_TAINT__H__
/******************************************************************************
* Define prototypes for referenced symbols
commit 6887d0432b148b85592538bbff8941d6d5a9ab16
Author: Alexander Tarasikov <[email protected]>
Date: Tue Oct 3 14:08:10 2017 +0300
XXX: try assigning func pointers to struct member
diff --git a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
index caf86b26b6..32587624bf 100644
--- a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
#include <metal_stdlib>
using namespace metal;
kernel void stripe_Kernel(texture2d<float, access::write> outTexture [[ texture(0) ]],
device const float *inBuffer [[ buffer(0) ]],
device const ushort * imageWidth [[ buffer(1) ]],
device const ushort * imageHeight [[ buffer(2) ]],
device float *outBuffer [[ buffer(3) ]],
uint2 gid [[ thread_position_in_grid ]])
{
@astarasikov
astarasikov / GraphicBufferHack.java
Created May 2, 2017 00:54
creating Android GraphicBuffer via Reflection
try {
Class c_GraphicBuffer = Class.forName("android.view.GraphicBuffer");
Log.e(LOG_TAG, "GraphicBuffer " + c_GraphicBuffer);
Method GraphicBuffer_create = c_GraphicBuffer.getMethod("create", new Class[] { int.class, int.class, int.class, int.class, });
Log.e(LOG_TAG, "Method GraphicBuffer_create " + GraphicBuffer_create);
Object hGraphicBuffer = GraphicBuffer_create.invoke(null, 1920, 1080, 1, 0x3 | 0x30 | 0x100);
Log.e(LOG_TAG, "Created GraphicBuffer " + hGraphicBuffer);
Method GraphicBuffer_lockCanvas = c_GraphicBuffer.getMethod("lockCanvas", new Class[] {});
Log.e(LOG_TAG, "Method GraphicBuffer_lockCanvas " + GraphicBuffer_lockCanvas);
diff --git a/configure.ac b/configure.ac
index 75b1de4..5d1f7ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2179,7 +2179,7 @@ if test "x$enable_gallium_llvm" = xyes; then
if test -n "${LLVM_VERSION_MAJOR}"; then
LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
else
- LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
+ LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\).*/\10\2/g'`
From 10dfeb9833be69dae8b3fd6e8cf7081cbda6fb46 Mon Sep 17 00:00:00 2001
From: Alexander Tarasikov <[email protected]>
Date: Tue, 6 Sep 2016 14:38:06 +0300
Subject: [PATCH] Fix compilation with LLVM 4.0.0
---
generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl | 2 +-
generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl | 2 +-
generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl | 2 +-
generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl | 2 +-
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
/**
* Supported features:
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
struct Octree;
typedef struct Octree Octree;
enum {
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
#include <unistd.h>
#if 0
#define YO do { printf("%s:%d\n", __func__, __LINE__); } while (0)
#else
#define YO do {} while (0)