sws有什么作用

上海塞沃斯户外用品有限公司
塞沃斯(skywards)  恣意臆想的天空(sky)与无限的遐想和向往,便是塞沃斯(skywards)名字的由来。天空、绿草、高山,是我们品牌的诠释;热爱、激情、超越,是我们理想的彰显。背着行囊仰望天空,心田已是风卷云舒;凌众山之巅,巍巍胸怀早已澎湃;融入草海,浓浓绿意悄已在心扉化开。一路走来,塞沃斯与你一路同行。苛刻的要求,造就了塞沃斯专业的品质。从产品的设计,材料的选择,后期的加工,每一细节都注入了我们的缜密,我们的创新。人性化的设计,丰富了塞沃斯人文的内涵。在追求产品更高品质,更多功能,更趋舒适的基础上,我们更多的是给予人性化考虑,使件件产品与您贴得更近,更紧。时尚的引领,赋予了塞沃斯时尚的风格。我们时时把握最前沿的时尚导向,个性与流行,时尚与品味,经典与智慧,演绎于塞沃斯的每件产品。塞沃斯,来自天空的向往,与你一路相伴。
上海塞沃斯户外用品
中国上海华池路58弄1号1502
王永雷 (业务)
浏览人次 :&
修改日期 : 2008 - 01 - 23
:, & , & , & , &
Powered bydocument.write('&&&&');
请输入你要查询的地址:
更新TKD缓存
三月平均:&&ALEXA数据预估流量:相关数据不充分,无法统计。
PR &&&&&&百度权重 &&&&&&&&&&&&&&首页位置 &&&&&&外链
百度索引量:-&&预计来路:&IP&&&&&&出站链接:2个
首页内链:4个
本站反链:--条
该网站IP:-- 地址:-- 有约 -- 个站点运行在此服务器上
一般不超过80个字符
网站关键词
一般不超过100个字符
一般不超过200个字符
关键词排名分析
数据载入中,请稍候。
数据载入中,请稍候。
Alexa排名趋势
最近查询:
其他功能:
& 爱站网 版权所有
About Aizhan/**//*&*&Copyright&(C)&2003&Michael&Niedermayer&&michaelni@gmx.at&&&*&*&This&file&is&part&of&FFmpeg.&*&*&FFmpeg&is&free&&you&can&redistribute&it&and/or&*&modify&it&under&the&terms&of&the&GNU&Lesser&General&Public&*&License&as&published&by&the&Free&Software&F&either&*&version&2.1&of&the&License,&or&(at&your&option)&any&later&version.&*&*&FFmpeg&is&distributed&in&the&hope&that&it&will&be&useful,&*&but&WITHOUT&ANY&WARRANTY;&without&even&the&implied&warranty&of&*&MERCHANTABILITY&or&FITNESS&FOR&A&PARTICULAR&PURPOSE.&&See&the&GNU&*&Lesser&General&Public&License&for&more&details.&*&*&You&should&have&received&a&copy&of&the&GNU&Lesser&General&Public&*&License&along&with&FF&if&not,&write&to&the&Free&Software&*&Foundation,&Inc.,&51&Franklin&Street,&Fifth&Floor,&Boston,&MA&&USA&*/#include&&stdio.h&#include&&stdlib.h&#include&&string.h&#include&&inttypes.h&#include&&stdarg.h&#undef&HAVE_AV_CONFIG_H#include&"libavutil/avutil.h"#include&"swscale.h"#include&"swscale_internal.h"static&uint64_t&getSSD(uint8_t&*src1,&uint8_t&*src2,&int&stride1,&int&stride2,&int&w,&int&h){&&&&int&x,y;&&&&uint64_t&ssd=<span style="color: #;//printf("%d&%d/n",&w,&h);&&&&for&(y=<span style="color: #;&y&h;&y++){&&&&&&&&for&(x=<span style="color: #;&x&w;&x++){&&&&&&&&&&&&int&d=&src1[x&+&y*stride1]&-&src2[x&+&y*stride2];&&&&&&&&&&&&ssd+=&d*d;//printf("%d",&abs(src1[x&+&y*stride1]&-&src2[x&+&y*stride2])/26&);&&&&&&&&}//printf("/n");&&&&}&&&&return&}//&test&by&ref&-&&src&-&&dst&-&&out&&&compare&out&against&ref//&ref&&&out&are&YV12static&int&doTest(uint8_t&*ref[<span style="color: #],&int&refStride[<span style="color: #],&int&w,&int&h,&int&srcFormat,&int&dstFormat,&&&&&&&&&&&&&&&&&&int&srcW,&int&srcH,&int&dstW,&int&dstH,&int&flags){&&&&uint8_t&*src[<span style="color: #];&&&&uint8_t&*dst[<span style="color: #];&&&&uint8_t&*out[<span style="color: #];&&&&int&srcStride[<span style="color: #],&dstStride[<span style="color: #];&&&&int&i;&&&&uint64_t&ssdY,&ssdU,&ssdV;&&&&struct&SwsContext&*srcContext,&*dstContext,&*outC&&&&int&&&&&res&=&<span style="color: #;&&&&for&(i=<span style="color: #;&i&<span style="color: #;&i++){&&&&&&&&//&avoid&stride&%&bpp&!=&0&&&&&&&&if&(srcFormat==PIX_FMT_RGB24&||&srcFormat==PIX_FMT_BGR24)&&&&&&&&&&&&srcStride[i]=&srcW*<span style="color: #;&&&&&&&&else&&&&&&&&&&&&srcStride[i]=&srcW*<span style="color: #;&&&&&&&&if&(dstFormat==PIX_FMT_RGB24&||&dstFormat==PIX_FMT_BGR24)&&&&&&&&&&&&dstStride[i]=&dstW*<span style="color: #;&&&&&&&&else&&&&&&&&&&&&dstStride[i]=&dstW*<span style="color: #;&&&&&&&&src[i]=&(uint8_t*)&malloc(srcStride[i]*srcH);&&&&&&&&dst[i]=&(uint8_t*)&malloc(dstStride[i]*dstH);&&&&&&&&out[i]=&(uint8_t*)&malloc(refStride[i]*h);&&&&&&&&if&(!src[i]&||&!dst[i]&||&!out[i])&{&&&&&&&&&&&&perror("Malloc");&&&&&&&&&&&&res&=&-<span style="color: #;&&&&&&&&&&&&goto&&&&&&&&&}&&&&}&&&&dstContext&=&outContext&=&NULL;&&&&srcContext=&sws_getContext(w,&h,&PIX_FMT_YUV420P,&srcW,&srcH,&srcFormat,&flags,&NULL,&NULL,&NULL);&&&&if&(!srcContext)&{&&&&&&&&fprintf(stderr,&"Failed&to&get&%s&---&&%s/n",&&&&&&&&&&&&&&&&sws_format_name(PIX_FMT_YUV420P),&&&&&&&&&&&&&&&&sws_format_name(srcFormat));&&&&&&&&res&=&-<span style="color: #;&&&&&&&&goto&&&&&}&&&&dstContext=&sws_getContext(srcW,&srcH,&srcFormat,&dstW,&dstH,&dstFormat,&flags,&NULL,&NULL,&NULL);&&&&if&(!dstContext)&{&&&&&&&&fprintf(stderr,&"Failed&to&get&%s&---&&%s/n",&&&&&&&&&&&&&&&&sws_format_name(srcFormat),&&&&&&&&&&&&&&&&sws_format_name(dstFormat));&&&&&&&&res&=&-<span style="color: #;&&&&&&&&goto&&&&&}&&&&outContext=&sws_getContext(dstW,&dstH,&dstFormat,&w,&h,&PIX_FMT_YUV420P,&flags,&NULL,&NULL,&NULL);&&&&if&(!outContext)&{&&&&&&&&fprintf(stderr,&"Failed&to&get&%s&---&&%s/n",&&&&&&&&&&&&&&&&sws_format_name(dstFormat),&&&&&&&&&&&&&&&&sws_format_name(PIX_FMT_YUV420P));&&&&&&&&res&=&-<span style="color: #;&&&&&&&&goto&&&&&}//&&&&printf("test&%X&%X&%X&-&&%X&%X&%X/n",&(int)ref[0],&(int)ref[1],&(int)ref[2],//&&&&&&&&(int)src[0],&(int)src[1],&(int)src[2]);&&&&sws_scale(srcContext,&ref,&refStride,&<span style="color: #,&h&&&,&src,&srcStride);&&&&sws_scale(dstContext,&src,&srcStride,&<span style="color: #,&srcH,&dst,&dstStride);&&&&sws_scale(outContext,&dst,&dstStride,&<span style="color: #,&dstH,&out,&refStride);&&&&ssdY=&getSSD(ref[<span style="color: #],&out[<span style="color: #],&refStride[<span style="color: #],&refStride[<span style="color: #],&w,&h);&&&&ssdU=&getSSD(ref[<span style="color: #],&out[<span style="color: #],&refStride[<span style="color: #],&refStride[<span style="color: #],&(w+<span style="color: #)&&<span style="color: #,&(h+<span style="color: #)&&<span style="color: #);&&&&ssdV=&getSSD(ref[<span style="color: #],&out[<span style="color: #],&refStride[<span style="color: #],&refStride[<span style="color: #],&(w+<span style="color: #)&&<span style="color: #,&(h+<span style="color: #)&&<span style="color: #);&&&&if&(srcFormat&==&PIX_FMT_GRAY8&||&dstFormat==PIX_FMT_GRAY8)&ssdU=ssdV=<span style="color: #;&//FIXME&check&that&output&is&really&gray&&&&ssdY/=&w*h;&&&&ssdU/=&w*h/<span style="color: #;&&&&ssdV/=&w*h/<span style="color: #;&&&&printf("&%s&%dx%d&-&&%s&%4dx%4d&flags=%2d&SSD=%5lld,%5lld,%5lld/n",&&&&&&&&&&&sws_format_name(srcFormat),&srcW,&srcH,&&&&&&&&&&&sws_format_name(dstFormat),&dstW,&dstH,&&&&&&&&&&&flags,&ssdY,&ssdU,&ssdV);&&&&fflush(stdout);&&&&end:&&&&sws_freeContext(srcContext);&&&&sws_freeContext(dstContext);&&&&sws_freeContext(outContext);&&&&for&(i=<span style="color: #;&i&<span style="color: #;&i++){&&&&&&&&free(src[i]);&&&&&&&&free(dst[i]);&&&&&&&&free(out[i]);&&&&}&&&&return&}static&void&selfTest(uint8_t&*src[<span style="color: #],&int&stride[<span style="color: #],&int&w,&int&h){&&&&enum&PixelFormat&srcFormat,&dstF&&&&int&srcW,&srcH,&dstW,&dstH;&&&&int&&&&&for&(srcFormat&=&<span style="color: #;&srcFormat&&&PIX_FMT_NB;&srcFormat++)&{&&&&&&&&for&(dstFormat&=&<span style="color: #;&dstFormat&&&PIX_FMT_NB;&dstFormat++)&{&&&&&&&&&&&&printf("%s&-&&%s/n",&&&&&&&&&&&&&&&&&&&sws_format_name(srcFormat),&&&&&&&&&&&&&&&&&&&sws_format_name(dstFormat));&&&&&&&&&&&&fflush(stdout);&&&&&&&&&&&&srcW=&w;&&&&&&&&&&&&srcH=&h;&&&&&&&&&&&&for&(dstW=w&-&w/<span style="color: #;&dstW&=&<span style="color: #*w/<span style="color: #;&dstW+=&w/<span style="color: #){&&&&&&&&&&&&&&&&for&(dstH=h&-&h/<span style="color: #;&dstH&=&<span style="color: #*h/<span style="color: #;&dstH+=&h/<span style="color: #){&&&&&&&&&&&&&&&&&&&&for&(flags=<span style="color: #;&flags&<span style="color: #;&flags*=<span style="color: #)&{&&&&&&&&&&&&&&&&&&&&&&&&int&&&&&&&&&&&&&&&&&&&&&&&&&res&=&doTest(src,&stride,&w,&h,&srcFormat,&dstFormat,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&srcW,&srcH,&dstW,&dstH,&flags);&&&&&&&&&&&&&&&&&&&&&&&&if&(res&&&<span style="color: #)&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&dstW&=&<span style="color: #&*&w&/&<span style="color: #;&&&&&&&&&&&&&&&&&&&&&&&&&&&&dstH&=&<span style="color: #&*&h&/&<span style="color: #;&&&&&&&&&&&&&&&&&&&&&&&&&&&&flags&=&<span style="color: #;&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&}&&&&&&&&&&&&}&&&&&&&&}&&&&}}#define&W&96#define&H&96int&main(int&argc,&char&**argv){&&&&uint8_t&*rgb_data&=&malloc&(W*H*<span style="color: #);&&&&uint8_t&*rgb_src[<span style="color: #]=&{rgb_data,&NULL,&NULL};&&&&int&rgb_stride[<span style="color: #]={<span style="color: #*W,&<span style="color: #,&<span style="color: #};&&&&uint8_t&*data&=&malloc&(<span style="color: #*W*H);&&&&uint8_t&*src[<span style="color: #]=&{data,&data+W*H,&data+W*H*<span style="color: #};&&&&int&stride[<span style="color: #]={W,&W,&W};&&&&int&x,&y;&&&&struct&SwsContext&*&&&&sws=&sws_getContext(W/<span style="color: #,&H/<span style="color: #,&PIX_FMT_RGB32,&W,&H,&PIX_FMT_YUV420P,&<span style="color: #,&NULL,&NULL,&NULL);&&&&for&(y=<span style="color: #;&y&H;&y++){&&&&&&&&for&(x=<span style="color: #;&x&W*<span style="color: #;&x++){&&&&&&&&&&&&rgb_data[&x&+&y*<span style="color: #*W]=&random();&&&&&&&&}&&&&}&&&&sws_scale(sws,&rgb_src,&rgb_stride,&<span style="color: #,&H,&src,&stride);&&&&selfTest(src,&stride,&W,&H);&&&&return&<span style="color: #3;}sws有什么作用_百度知道
sws有什么作用
我有更好的答案
这是个单词?
其他类似问题
为您推荐:
sws的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁2843人阅读
ffmpeg中的sws_scale()函数调用的有:
1,图像如果要缩放的话,调用swScale.c中的函数(文件中有初始化,调用。处理等函数)
举例调用的有:
hScale8To15_c------123
hScale8To15_c------123
hyscale------260
hScale8To15_c------123
hyscale------260
hScale8To15_c------123
hyscale------260
hScale8To15_c------123
hyscale------260
hScale8To15_c------123
hcscale------314
hScale8To15_c------123
hScale8To15_c------123
hyscale------260
hScale8To15_c------123
hyscale------260
hScale8To15_c------123
2,图像如果不缩放的话,调用swScale_unscaled.c(文件内一切处理函数。)
举例调用的有:
static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
& & & & & & & & & & & & & & &int srcStride[], int srcSliceY, int srcSliceH,
& & & & & & & & & & & & & & &uint8_t *dst[], int dstStride[])
printf(&%s & line %d&&&&&\n&, __FUNCTION__,__LINE__);
3,其中缩放或不缩放在中设置。
关于这个函数的说明:
&&(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat,
int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)Returns an SwsContext to be used in&&.
srcW, srcH, srcFormat&: source width, height, and pix format
dstW, dstH, dstFormat&: destination width, height, and pix format
flags&: Method of scaling to use. Choices are SWS_FAST_BILINEAR, SWS_BILINEAR, SWS_BICUBIC, SWS_X, SWS_POINT, SWS_AREA, SWS_BICUBLIN, SWS_GAUSS, SWS_SINC, SWS_LANCZOS, SWS_SPLINE. Other flags include CPU capability flags: SWS_CPU_CAPS_MMX,
SWS_CPU_CAPS_MMX2, SWS_CPU_CAPS_3DNOW, SWS_CPU_CAPS_ALTIVEC. Other flags include (currently not completely implemented) SWS_FULL_CHR_H_INT, SWS_FULL_CHR_H_INP, and SWS_DIRECT_BGR. Finally we have SWS_ACCURATE_RND and perhaps the most useful for beginners,
SWS_PRINT_INFO. I have no idea what most of these do. Maybe email me?
srcFilter, dstFilter&: SwsFilter for source and destination. SwsFilter involves chroma/luminsence filtering. A value of NULL sets these to the default.
param&: should be a pointer to an int[2] buffer with coefficients. Not documented. Looks like it's used to alter the default scaling algorithms slightly. A value of NULL sets this to the default. Experts only!
使用方法如下:
#define W 96
#define H 96
struct SwsContext *
sws= sws_getContext(W/12, H/12, PIX_FMT_RGB32, W, H, PIX_FMT_YUV420P, 2, NULL, NULL, NULL);
sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);
4.函数的举例:
10:02:27|&&分类:&字号&
版权声明:本文为博主原创文章,未经博主允许不得转载。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:409386次
积分:5577
积分:5577
排名:第2324名
原创:102篇
转载:311篇
评论:45条
(1)(1)(1)(1)(1)(1)(2)(12)(3)(1)(2)(3)(20)(18)(11)(4)(8)(6)(17)(12)(17)(11)(11)(6)(15)(16)(16)(4)(6)(1)(17)(11)(9)(9)(14)(11)(20)(18)(67)(9)}

我要回帖

更多关于 吃伟哥有副作用吗 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信