From 7f62a36f9b004ea35de52ecf99a695f90efb495c Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sun, 30 Oct 2016 15:37:32 +0900 Subject: [PATCH 1/2] specify const to promise no write accsess --- SigColorFastAviUtl/sigcolorfastaviutl.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SigColorFastAviUtl/sigcolorfastaviutl.cpp b/SigColorFastAviUtl/sigcolorfastaviutl.cpp index 33cb797..23240ab 100644 --- a/SigColorFastAviUtl/sigcolorfastaviutl.cpp +++ b/SigColorFastAviUtl/sigcolorfastaviutl.cpp @@ -196,7 +196,7 @@ BOOL func_proc_con(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image if (prevIsYC_Con) { /* Scan Y channel data */ - int fh = fpip->h; + const int fh = fpip->h; #pragma loop( hint_parallel(0) ) #pragma loop( ivdep ) @@ -212,8 +212,8 @@ BOOL func_proc_con(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image } else //RGB mode { - int fh = fpip->h; - int fw = fpip->w; + const int fh = fpip->h; + const int fw = fpip->w; #pragma loop( hint_parallel(0) ) #pragma loop( ivdep ) for (int r = 0; r < fh; r++) @@ -449,7 +449,7 @@ BOOL func_proc_sd(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image if (prevIsYC_SD) { /* Scan Y channel data */ - int fh = fpip->h; + const int fh = fpip->h; #pragma loop( hint_parallel(0) ) #pragma loop( ivdep ) @@ -465,8 +465,8 @@ BOOL func_proc_sd(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image } else //RGB mode { - int fh = fpip->h; - int fw = fpip->w; + const int fh = fpip->h; + const int fw = fpip->w; #pragma loop( hint_parallel(0) ) #pragma loop( ivdep ) for (int r = 0; r < fh; r++) From d74a3b874997d852c8933fe72a00ce97414b7d7e Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sun, 30 Oct 2016 15:41:54 +0900 Subject: [PATCH 2/2] allocate buffer pixel out side loop auto-parallelizer's auto storage is very heavy. so, allocate buffer on heap as same as before but allocate only one time per thread --- SigColorFastAviUtl/sigcolorfastaviutl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SigColorFastAviUtl/sigcolorfastaviutl.cpp b/SigColorFastAviUtl/sigcolorfastaviutl.cpp index 23240ab..908cad2 100644 --- a/SigColorFastAviUtl/sigcolorfastaviutl.cpp +++ b/SigColorFastAviUtl/sigcolorfastaviutl.cpp @@ -218,11 +218,11 @@ BOOL func_proc_con(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image #pragma loop( ivdep ) for (int r = 0; r < fh; r++) { + PIXEL* rgb = new PIXEL; #pragma loop( no_vector ) for (int c = 0; c < fw; c++) { PIXEL_YC* px = fpip->ycp_edit + r* fpip->max_w + c; - PIXEL* rgb= new PIXEL; fp->exfunc->yc2rgb(rgb, px, 1); // transform each channel is needed //PIXEL t_rgb{ 0 }; @@ -243,8 +243,8 @@ BOOL func_proc_con(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image } // convert back fp->exfunc->rgb2yc(px, rgb, 1); - delete rgb; } + delete rgb; } } #ifdef USECLOCK @@ -471,11 +471,11 @@ BOOL func_proc_sd(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image #pragma loop( ivdep ) for (int r = 0; r < fh; r++) { + PIXEL* rgb = new PIXEL; #pragma loop( no_vector ) for (int c = 0; c < fw; c++) { PIXEL_YC* px = fpip->ycp_edit + r* fpip->max_w + c; - PIXEL* rgb = new PIXEL; fp->exfunc->yc2rgb(rgb, px, 1); // transform each channel is needed //PIXEL t_rgb{ 0 }; @@ -496,8 +496,8 @@ BOOL func_proc_sd(FILTER *fp, FILTER_PROC_INFO *fpip) // This is the main image } // convert back fp->exfunc->rgb2yc(px, rgb, 1); - delete rgb; } + delete rgb; } } #ifdef USECLOCK