" line_step=ctwo;\n"\r
"}\n"\r
" if (upper_half) {\n"\r
- " ypos_temp1=vec4(out_yblockpos_x.z,out_yblockpos_y.z,out_yblockpos_x.w,out_yblockpos_y.w);\n"\r
+ " ypos_temp1=vec4(out_yblockpos_x.z,out_yblockpos_y.z,out_yblockpos_x.w,out_yblockpos_y.w);\n"\r
" } else {\n"\r
" ypos_temp1=vec4(out_yblockpos_x.x,out_yblockpos_y.x,out_yblockpos_x.y,out_yblockpos_y.y);\n"\r
" }\n"\r
" ypos_temp2.xy*=c1over1024;\n"\r
" ypos_temp1=texture2D(blocks,ypos_temp2.xy);\n" // now select the right data\r
"if (subsample){\n"\r
- " ypos_temp2.xy=ypos_temp1.zw;\n"\r
+ " ypos_temp3.xy=ypos_temp1.zw;\n"\r
//" ypos_temp2=vec2(cone,0.);\n"\r
" }else {\n"\r
- " ypos_temp2.xy=ypos_temp1.xy;\n"\r
+ " ypos_temp3.xy=ypos_temp1.xy;\n"\r
" }\n"\r
- " our_fragcol.r=unpack_short(ypos_temp2.rg);\n"\r
+ " our_fragcol.r=unpack_short(ypos_temp3.xy);\n"\r
\r
//now uv\r
" ypos_temp3=floor(out_block_edge*acht);\n"\r
" ypos_temp2.yw=floor(out_uvblockpos_xy.zw);\n"\r
" ypos_temp2.xz=(ypos_temp3.x+(ypos_temp3.y+acht*(out_uvblockpos_xy.xy))*acht);\n"\r
- //" bool subsample=(mod(ypos_temp2.x,ctwo)>halfst);\n"\r
+ //" subsample=(mod(ypos_temp2.x,ctwo)>halfst);\n"\r
" subsample=mod(ypos_temp3.x,ctwo)==cone;\n"\r
" ypos_temp2.xz*=halfst;\n"\r
" ypos_temp2*=c1over1024;\n"\r
\r
" ypos_temp1=texture2D(blocks,ypos_temp2.xy);\n" // now select the right data\r
" if (subsample){\n"\r
- " ypos_temp2.xy=ypos_temp1.zw;\n"\r
+ " ypos_temp3.xy=ypos_temp1.zw;\n"\r
" }else {\n"\r
- " ypos_temp2.xy=ypos_temp1.xy;\n"\r
+ " ypos_temp3.xy=ypos_temp1.xy;\n"\r
" }\n"\r
- " our_fragcol.g=unpack_short(ypos_temp2.rg);\n"\r
+ " our_fragcol.g=unpack_short(ypos_temp3.xy);\n"\r
\r
" ypos_temp1=texture2D(blocks,ypos_temp2.zw);\n" // now select the right data\r
- " if (subsample){\n"\r
- " ypos_temp2.xy=ypos_temp1.zw;\n"\r
- " }else {\n"\r
- " ypos_temp2.xy=ypos_temp1.xy;\n"\r
- " }\n"\r
- " our_fragcol.b=unpack_short(ypos_temp2.rg);\n"\r
+ //" if (subsample){\n"\r
+ " ypos_temp3.xy=ypos_temp1.zw;\n"\r
+ //" }else {\n"\r
+ " ypos_temp3.xy=ypos_temp1.xy;\n"\r
+ //" }\n"\r
+ " our_fragcol.b=unpack_short(ypos_temp3.rg);\n"\r
+\r
//MOCO\r
// decide if it is top or bottom\r
" vec4 moco_work;\n"\r
" c11=texture2D(backward_pic,(moco_temp.zw+vec2(ctwo,ctwo*out_misc_info.y))*pict_size);\n"\r
" our_fragcol.gb+=mix(mix(c00.gb,c10.gb,subpixel.z),mix(c01.gb,c11.gb,subpixel.z),subpixel.w)*out_moco_pos.w;\n"\r
\r
- " gl_FragColor.rgb=vec3(our_fragcol.r,halfst,halfst);\n"\r
- " if (out_unsupported==1.) {\n"\r
- " gl_FragColor.gb=vec2(cone,0.0);\n"\r
- "}else if (out_unsupported==2.) {\n"\r
- " gl_FragColor.gb=vec2(0.0,cone);\n"\r
- "}\n"\r
+ " gl_FragColor.rgb=our_fragcol.rgb;\n"\r
+// " gl_FragColor.rgb=vec3(our_fragcol.r,halfst,halfst);\n"\r
+// " if (out_unsupported==1.) {\n"\r
+// " gl_FragColor.gb=vec2(cone,0.0);\n"\r
+// "}else if (out_unsupported==2.) {\n"\r
+// " gl_FragColor.gb=vec2(0.0,cone);\n"\r
+// "}\n"\r
\r
\r
//" ypos_temp2=mix(ypos_temp1.rg,ypos_temp1.ba,step(c1over2047,mod(ypos_temp2.x,c1over1023)));\n" //activate this\r
#ifdef BENCHMARK_FPS
time_in_decoder=0;
num_frames=0;
+ time_in_decoder_gl=0;
+ num_frames_gl=0;
#endif
}
xvmc_pix_fmt * pix_fmt=(xvmc_pix_fmt *)dec_frame_libav_uploading_framebuf->data[2];
if (moco_shader && pix_fmt) {
+#ifdef BENCHMARK_FPS
+ int cur_time=getTimeMS();
+#endif
moco_shader->uploadDataBlocks(pix_fmt->data_blocks,pix_fmt->next_free_data_block_num,
pix_fmt->mv_blocks , pix_fmt->filled_mv_blocks_num );
// Log::getInstance()->log("Video", Log::WARN, "Pictnum %d Forward %d Backward %d ",pix_fmt->p_surface,
moco_shader->doMoCo(out_frame,(((int)pix_fmt->p_past_surface)!=0)? ogl_forward_ref_frame:NULL,
(((int)pix_fmt->p_future_surface)!=0)? ogl_backward_ref_frame:NULL);
+#ifdef BENCHMARK_FPS
+ time_in_decoder_gl+=getTimeMS()-cur_time;
+ num_frames_gl++;
+ if ((num_frames_gl%100)==0) {
+ float fps=1000./(float)(time_in_decoder_gl);
+ fps*=((float)num_frames_gl);
+ Log::getInstance()->log("Video", Log::NOTICE, "Current GL Decoding FPS %g", fps);
+ }
+#endif
+
//Log::getInstance()->log("Video", Log::WARN, "Pictnum mark4");
// Excute motion compensation
} else {