Go to the documentation of this file.
37 #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
38 #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
41 #define PIXEL_MAX ((1 << BIT_DEPTH)-1)
48 const pixel *pix2, intptr_t stride2,
53 for( z = 0; z < 2; z++ )
55 uint32_t
s1 = 0,
s2 = 0,
ss = 0, s12 = 0;
56 for( y = 0; y < 4; y++ )
57 for(
x = 0;
x < 4;
x++ )
59 int a = pix1[
x+y*stride1];
60 int b = pix2[
x+y*stride2];
94 type vars = fss*64 - fs1*fs1 - fs2*fs2;
95 type covar = fs12*64 - fs1*fs2;
96 return (
float)(2*fs1*fs2 + ssim_c1) * (
float)(2*covar + ssim_c2)
97 / ((
float)(fs1*fs1 + fs2*fs2 + ssim_c1) * (
float)(
vars + ssim_c2));
106 ssim +=
ssim_end1( sum0[
i][0] + sum0[
i+1][0] + sum1[
i][0] + sum1[
i+1][0],
107 sum0[
i][1] + sum0[
i+1][1] + sum1[
i][1] + sum1[
i+1][1],
108 sum0[
i][2] + sum0[
i+1][2] + sum1[
i][2] + sum1[
i+1][2],
109 sum0[
i][3] + sum0[
i+1][3] + sum1[
i][3] + sum1[
i+1][3] );
114 pixel *pix1, intptr_t stride1,
115 pixel *pix2, intptr_t stride2,
121 int (*sum0)[4] = buf;
122 int (*sum1)[4] = sum0 + (
width >> 2) + 3;
125 for( y = 1; y <
height; y++ )
129 FFSWAP(
void*, sum0, sum1 );
131 ssim_4x4x2_core( &pix1[4*(
x+z*stride1)], stride1, &pix2[4*(
x+z*stride2)], stride2, &sum0[
x] );
147 int d = pix1[
i] - pix2[
i];
155 return -10*log((
double)ssd/(denom*255*255))/log(10);
160 return 10*(log(
weight)/log(10)-log(
weight-ssim)/log(10));
165 printf(
"PSNR Y:%.3f U:%.3f V:%.3f All:%.3f | ",
170 printf(
"SSIM Y:%.5f U:%.5f V:%.5f All:%.5f (%.5f)",
174 (ssim[0]*4 + ssim[1] + ssim[2]) / (
frames*6),
178 int main(
int argc,
char* argv[])
183 uint64_t ssd[3] = {0,0,0};
184 double ssim[3] = {0,0,0};
189 if( argc<4 || 2 != sscanf(argv[3],
"%dx%d", &
w, &
h) )
191 printf(
"tiny_ssim <file1.yuv> <file2.yuv> <width>x<height> [<seek>]\n");
195 f[0] = fopen(argv[1],
"rb");
196 f[1] = fopen(argv[2],
"rb");
197 sscanf(argv[3],
"%dx%d", &
w, &
h);
199 if (
w<=0 ||
h<=0 ||
w*(int64_t)
h >= INT_MAX/3 || 2LL*
w+12 >= INT_MAX /
sizeof(*
temp)) {
200 fprintf(stderr,
"Dimensions are too large, or invalid\n");
208 plane[
i][0] = buf[
i];
209 plane[
i][1] = plane[
i][0] +
w*
h;
210 plane[
i][2] = plane[
i][1] +
w*
h/4;
213 seek = argc<5 ? 0 : atoi(argv[4]);
214 fseek(
f[seek<0], seek < 0 ? -seek : seek, SEEK_SET);
220 if( fread(buf[0],
frame_size, 1,
f[0]) != 1)
break;
221 if( fread(buf[1],
frame_size, 1,
f[1]) != 1)
break;
228 ssd[
i] += ssd_one[
i];
229 ssim[
i] += ssim_one[
i];
static void print_results(uint64_t ssd[3], double ssim[3], int frames, int w, int h)
float ssim_plane(pixel *pix1, intptr_t stride1, pixel *pix2, intptr_t stride2, int width, int height, void *buf, int *cnt)
#define FFSWAP(type, a, b)
if it could not because there are no more frames
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define ss(width, name, subs,...)
int main(int argc, char *argv[])
static const uint8_t vars[2][12]
static double ssim_db(double ssim, double weight)
static int weight(int i, int blen, int offset)
printf("static const uint8_t my_array[100] = {\n")
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
uint64_t ssd_plane(const uint8_t *pix1, const uint8_t *pix2, int size)
static double ssd_to_psnr(uint64_t ssd, uint64_t denom)
#define i(width, name, range_min, range_max)
static float ssim_end4(int sum0[5][4], int sum1[5][4], int width)
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
static void ssim_4x4x2_core(const pixel *pix1, intptr_t stride1, const pixel *pix2, intptr_t stride2, int sums[2][4])
static float ssim_end1(int s1, int s2, int ss, int s12)