| 尝试翻译一段 图片镜像的代码,neon优化的代码运行时间,只有C代码的一半,但远低于loop循环计算出来的理论值,为什么会有这么大落差?? C代码:
 void C_Nv21YSelfMirror(char output,char  input,int width,int height)
 {
 int i,j=0;\nfor(j=0; j<height;j++){
 int index = j*width;
 for(i=0;i<width;i++)
 {
 *(output+index+i) = *(input+index+width-i-1);}
 }
 }
 neon代码:
 ;------------------------------------------------------
 ; # r0: Ptr to destination data
 ; # r1: Ptr to source data
 ; # r2: width count:
 ; # r3: height count:
 Nv21YSelfMirror
 push {R0-R10,LR}\n      mov r9,#0 ;i\n      mov r10,#0 ;j\n      BIC r2,r2,#0x0f ;width /16mirror_y_lpj
 MLA R6,R10,R2,R1 ;int index = j*width + input_data;\n      mov r4,r2 ;widthmirror_y_lpi
 subs r4,r4,#32 ;-32\n      add r7,r6,r4 ;0st in_line\n      vld1.32 {d0,d1,d2,d3},[r7]\n      vrev64.8 d7,d0\n     vrev64.8 d6,d1\n      vrev64.8 d5,d2\n     vrev64.8 d4,d3\n     vst1.32 {d4,d5,d6,d7},[r0]!bne mirror_y_lpi
 add r10,#01\n    cmp r10,r3 ;j<height\n    blo mirror_y_lpjmirror_y_ret
 pop {R0-R10,PC}
 |