This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// compare | |
// | |
// Created by Allan on 27/7/2019. | |
// Copyright © 2019 Allan. All rights reserved. | |
// | |
#import "ViewController.h" | |
#include <arm_neon.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "AppDelegate.h" | |
#include <stdio.h> | |
@interface AppDelegate () | |
@end | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// [self namolData]; | |
// [self test]; | |
// [self test2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "AppDelegate.h" | |
@interface AppDelegate () | |
@end | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
[self neonCommandTest]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AVFoundation | |
import Accelerate | |
var customPreviewLayer: AVCaptureVideoPreviewLayer? | |
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate { | |
var captureSession: AVCaptureSession? | |
var dataOutput: AVCaptureVideoDataOutput? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
void create_mat(int height, int width, float *outMat){ | |
for (int h=0; h<height; h++){ | |
for (int w=0; w<width; w++){ | |
float value = h * width + (w+1); | |
int int_value = (int) value -1; | |
outMat[int_value] = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* How to use this funtion | |
*/ | |
- (void)videoCaptureCallback:(CVPixelBufferRef)pixelBuffer{ | |
// [self test_yuv_to_rgb:pixelBuffer]; | |
CVPixelBufferLockBaseAddress(pixelBuffer, 0); | |
int width = (int)CVPixelBufferGetWidth(pixelBuffer); | |
int height = (int)CVPixelBufferGetHeight(pixelBuffer); | |
unsigned char *yBuffer = (unsigned char*)CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 0); //ybuffer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void resize_bilinear_c4(uint8_t *dst, const uint8_t *src, | |
uint64_t dst_h, uint64_t dst_w, uint64_t src_h, | |
uint64_t src_w) { | |
float scale_y = static_cast<float>(src_h) / static_cast<float>(dst_h); | |
float scale_x = static_cast<float>(src_w) / static_cast<float>(dst_w); | |
for (int h = 0; h < dst_h; h++) { | |
const int y = (int)MIN(static_cast<uint64_t>(h * scale_y), src_h - 1); | |
for (int w = 0; w < dst_w; w++) { | |
const int x = (int)MIN(static_cast<uint64_t>(w * scale_x), src_w - 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewCtrl_CPUEasyImageProcessing.m | |
// demo_ios | |
// | |
// Created by yyuser on 2018/10/19. | |
// | |
#import "ViewCtrl_CPUEasyImageProcessing.h" | |
#import "vn_core.h" | |
#import "vn_yuvconverter.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//int ArmSkySegPreprocessor::resize_cpp(const VN_Image *__input, const VN_Image *__out) { | |
// const uint8_t *src = (uint8_t *) __input->data; | |
// uint8_t *dst = (uint8_t *) __out->data; | |
// uint64_t src_h = (uint64_t) __input->height; | |
// uint64_t src_w = (uint64_t) __input->width; | |
// uint64_t dst_h = (uint64_t) __out->height; | |
// uint64_t dst_w = (uint64_t) __out->width; | |
// | |
// float scale_y = static_cast<float>(src_h) / static_cast<float>(dst_h); | |
// float scale_x = static_cast<float>(src_w) / static_cast<float>(dst_w); |