"const float c1over2048=1./2048.;\n"\r
"const float c1over1024=1./1024.;\n"\r
"const float c255=255.;\n"\r
+ "const float c1over255=1./255.;\n"\r
"const float c65280=65280.;\n"\r
"const float c65536=65536.;\n"\r
"const float cstep=32767.;\n"\r
"float unpack_short(vec2 income) {\n"\r
" float temp=income.y*c65280+income.x*c255;\n"\r
" temp-=step(cstep,temp)*c65536;\n"\r
- " return temp/c255;\n"\r
+ " return temp*c1over255;\n"\r
+ "}"\r
+ "vec2 unpack_short2(vec4 income) {\n"\r
+ " vec2 temp=income.yw*c65280+income.xz*c255;\n"\r
+ " temp-=step(cstep,temp)*c65536;\n"\r
+ " return temp*c1over255;\n"\r
"}"\r
// "uniform sampler2D textureV;\n"\r
// "uniform sampler2D textureY;\n"\r
" ypos_temp2.xy=ypos_temp1.xy;\n"\r
" }\n"\r
//now get the intra 8x8 Block coordinates\r
- " vec2 ypos_temp3=floor(mod(out_block_edge*vec2(ctwo,line_step),cone)*acht);\n"\r
+ " vec4 ypos_temp3;\n"\r
+ " ypos_temp3.xy=floor(mod(out_block_edge*vec2(ctwo,line_step),cone)*acht);\n"\r
" ypos_temp2.x=(ypos_temp3.x+(ypos_temp3.y+acht*(ypos_temp2.x))*acht);\n"\r
//" bool subsample=(mod(ypos_temp2.x,ctwo)>halfst);\n"\r
" bool subsample=mod(ypos_temp3.x,ctwo)==cone;\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_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
//" subsample=(mod(ypos_temp2.x,ctwo)>halfst);\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
+ " 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
+ " ypos_temp3.xy=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
+ //" 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//82\r
+ " ypos_temp3=texture2D(blocks,ypos_temp2.zw);\n" // now select the right data\r
+ // " if (subsample){\n"\r
+ //" ypos_temp3.zw=ypos_temp3.zw;\n"\r
+ //" ypos_temp3.xy=ypos_temp1.zw;\n"\r
+ //" ypos_temp3=vec4(ypos_temp1.zw,ypos_temp3.zw);\n"\r
+\r
+ // " }else {\n"\r
+ " ypos_temp3=vec4(ypos_temp1.xy,ypos_temp3.xy);\n"\r
+ // " }\n"\r
+ " our_fragcol.gb=unpack_short2(ypos_temp3);\n"\r
+ //" our_fragcol.g=unpack_short(ypos_temp3.xy);\n"\r
+ //" our_fragcol.b=unpack_short(ypos_temp3.zw);\n"\r
+\r
+\r
+ /* " if (subsample){\n"\r
" ypos_temp3.xy=ypos_temp1.zw;\n"\r
- //" }else {\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
+ " }\n"\r
+ " our_fragcol.b=unpack_short(ypos_temp3.rg);\n"*/\r
\r
//MOCO\r
// decide if it is top or bottom\r
" moco_work=vec4(out_moco_forward.zw,out_moco_backward.zw);\n"\r
"}\n"\r
// now we handle the y fetching\r
- " vec4 moco_temp;\n"\r
- " vec4 subpixel=floor(mod(moco_work,ctwo))*halfst; \n"\r
- " moco_temp=floor(moco_work*halfst)+floor(vec4(out_moco_pos.xy,out_moco_pos.xy));\n"\r
+ " vec4 moco_temp1;\n"\r
+ " vec4 moco_temp2;\n"\r
+ " vec4 subpixel1=floor(mod(moco_work,ctwo))*halfst; \n"\r
+ " vec4 subpixel2=floor(mod(moco_work*halfst,ctwo))*halfst; \n"\r
+ " moco_temp1=floor(moco_work*halfst)+floor(vec4(out_moco_pos.xy,out_moco_pos.xy));\n"\r
+ " moco_temp2=(floor(moco_work*halfst*halfst)+floor(vec4(out_moco_pos.xy,out_moco_pos.xy)*halfst))*ctwo;\n"\r
" vec4 c00,c01,c10,c11;\n"\r
\r
- " c00=texture2D(forward_pic,moco_temp.xy*pict_size);\n"\r
- " c01=texture2D(forward_pic,(moco_temp.xy+vec2(czero,out_misc_info.y))*pict_size);\n"\r
- " c10=texture2D(forward_pic,(moco_temp.xy+vec2(cone,czero))*pict_size);\n"\r
- " c11=texture2D(forward_pic,(moco_temp.xy+vec2(cone,out_misc_info.y))*pict_size);\n"\r
- " our_fragcol.r+=mix(mix(c00.r,c10.r,subpixel.x),mix(c01.r,c11.r,subpixel.x),subpixel.y)*out_moco_pos.z;\n"\r
+ " c00.r=texture2D(forward_pic,moco_temp1.xy*pict_size).r;\n"\r
+ " c01.r=texture2D(forward_pic,(moco_temp1.xy+vec2(czero,out_misc_info.y))*pict_size).r;\n"\r
+ " c10.r=texture2D(forward_pic,(moco_temp1.xy+vec2(cone,czero))*pict_size).r;\n"\r
+ " c11.r=texture2D(forward_pic,(moco_temp1.xy+vec2(cone,out_misc_info.y))*pict_size).r;\n"\r
+ " c00.gb=texture2D(forward_pic,moco_temp2.xy*pict_size).gb;\n"\r
+ " c01.gb=texture2D(forward_pic,(moco_temp2.xy+vec2(czero,ctwo*out_misc_info.y))*pict_size).gb;\n"\r
+ " c10.gb=texture2D(forward_pic,(moco_temp2.xy+vec2(ctwo,czero))*pict_size).gb;\n"//106\r
+ " c11.gb=texture2D(forward_pic,(moco_temp2.xy+vec2(ctwo,ctwo*out_misc_info.y))*pict_size).gb;\n"\r
+ " vec3 tmp_sub1=vec3(subpixel1.x,subpixel2.xx);"\r
+ " vec3 tmp_sub2=vec3(subpixel1.y,subpixel2.yy);"\r
+ " our_fragcol.rgb+=mix(mix(c00.rgb,c10.rgb,tmp_sub1),mix(c01.rgb,c11.rgb,tmp_sub1),tmp_sub2)*out_moco_pos.z;\n"\r
+\r
+ // " our_fragcol.r+=mix(mix(c00.r,c10.r,subpixel1.x),mix(c01.r,c11.r,subpixel1.x),subpixel1.y)*out_moco_pos.z;\n"\r
+\r
+\r
+ // " our_fragcol.gb+=mix(mix(c00.gb,c10.gb,subpixel2.x),mix(c01.gb,c11.gb,subpixel2.x),subpixel2.y)*out_moco_pos.z;\n"\r
+\r
+\r
+ " c00.r=texture2D(backward_pic,moco_temp1.zw*pict_size).r;\n"//backward\r
+ " c01.r=texture2D(backward_pic,(moco_temp1.zw+vec2(czero,out_misc_info.y))*pict_size).r;\n"\r
+ " c10.r=texture2D(backward_pic,(moco_temp1.zw+vec2(cone,czero))*pict_size).r;\n"\r
+ " c11.r=texture2D(backward_pic,(moco_temp1.zw+vec2(cone,out_misc_info.y))*pict_size).r;\n"\r
+ " c00.gb=texture2D(backward_pic,moco_temp2.zw*pict_size).gb;\n"\r
+ " c01.gb=texture2D(backward_pic,(moco_temp2.zw+vec2(czero,ctwo*out_misc_info.y))*pict_size).gb;\n"\r
+ " c10.gb=texture2D(backward_pic,(moco_temp2.zw+vec2(ctwo,czero))*pict_size).gb;\n"\r
+ " c11.gb=texture2D(backward_pic,(moco_temp2.zw+vec2(ctwo,ctwo*out_misc_info.y))*pict_size).gb;\n"\r
\r
+ " tmp_sub1=vec3(subpixel1.z,subpixel2.zz);"\r
+ " tmp_sub2=vec3(subpixel1.w,subpixel2.ww);"\r
+ " our_fragcol.rgb+=mix(mix(c00.rgb,c10.rgb,tmp_sub1),mix(c01.rgb,c11.rgb,tmp_sub1),tmp_sub2)*out_moco_pos.w;\n"\r
\r
- " c00=texture2D(backward_pic,moco_temp.zw*pict_size);\n"//backward\r
- " c01=texture2D(backward_pic,(moco_temp.zw+vec2(czero,out_misc_info.y))*pict_size);\n"\r
- " c10=texture2D(backward_pic,(moco_temp.zw+vec2(cone,czero))*pict_size);\n"\r
- " c11=texture2D(backward_pic,(moco_temp.zw+vec2(cone,out_misc_info.y))*pict_size);\n"\r
- " our_fragcol.r+=mix(mix(c00.r,c10.r,subpixel.z),mix(c01.r,c11.r,subpixel.z),subpixel.w)*out_moco_pos.w;\n"\r
+ //" our_fragcol.r+=mix(mix(c00.r,c10.r,subpixel1.z),mix(c01.r,c11.r,subpixel1.z),subpixel1.w)*out_moco_pos.w;\n"\r
// now handle UV\r
- " subpixel=floor(mod(moco_work*halfst,ctwo))*halfst; \n"\r
- " moco_temp=(floor(moco_work*halfst*halfst)+floor(vec4(out_moco_pos.xy,out_moco_pos.xy)*halfst))*ctwo;\n"\r
\r
- " c00=texture2D(forward_pic,moco_temp.xy*pict_size);\n"\r
- " c01=texture2D(forward_pic,(moco_temp.xy+vec2(czero,ctwo*out_misc_info.y))*pict_size);\n"\r
- " c10=texture2D(forward_pic,(moco_temp.xy+vec2(ctwo,czero))*pict_size);\n"\r
- " c11=texture2D(forward_pic,(moco_temp.xy+vec2(ctwo,ctwo*out_misc_info.y))*pict_size);\n"\r
- " our_fragcol.gb+=mix(mix(c00.gb,c10.gb,subpixel.x),mix(c01.gb,c11.gb,subpixel.x),subpixel.y)*out_moco_pos.z;\n"\r
\r
- " c00=texture2D(backward_pic,moco_temp.zw*pict_size);\n"\r
- " c01=texture2D(backward_pic,(moco_temp.zw+vec2(czero,ctwo*out_misc_info.y))*pict_size);\n"\r
- " c10=texture2D(backward_pic,(moco_temp.zw+vec2(ctwo,czero))*pict_size);\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
+ //" our_fragcol.gb+=mix(mix(c00.gb,c10.gb,subpixel2.z),mix(c01.gb,c11.gb,subpixel2.z),subpixel2.w)*out_moco_pos.w;\n"\r
\r
" gl_FragColor.rgb=our_fragcol.rgb;\n"\r
-// " gl_FragColor.rgb=vec3(our_fragcol.r,halfst,halfst);\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
dec_frame_libav_uploading_framebuf=NULL;
dec_frame_libav_decoding=NULL;
ogl_frame_outside=false;
- //decoding_mode=VPE_NO_XVMC;
- decoding_mode=VPE_XVMC_MOCOMP;
- //decoding_mode=VPE_XVMC_IDCT;
+ decoding_mode=VPE_NO_XVMC;
+ //decoding_mode=VPE_XVMC_MOCOMP;
+// decoding_mode=VPE_XVMC_IDCT;
framebuf_framenum=0;
moco_shader=NULL;
#endif
dec_frame_libav_uploading_int=dec_frame_libav_upload_and_view_pending.front();
dec_frame_libav_uploading_framebuf=(VPE_FrameBuf*)dec_frame_libav_uploading_int->base[0];
- //Log::getInstance()->log("Video", Log::WARN, "threadMethod u and view %d %lld %x",(dec_frame_libav_uploading_framebuf)->pict_num,run,
+ // Log::getInstance()->log("Video", Log::WARN, "threadMethod u and view %d %lld %x",(dec_frame_libav_uploading_framebuf)->pict_num,run,
// dec_frame_libav_uploading_framebuf);
// if (dec_frame_libav_upload_only_pending.size()>0) Log::getInstance()->log("Video", Log::WARN, "threadMethod u and view2 %d",
// ((VPE_FrameBuf*)dec_frame_libav_upload_only_pending.front())->pict_num);
if (!view && dec_frame_libav_upload_only_pending.size()>0) { //this is for uploading reference frames ahead
dec_frame_libav_uploading_framebuf=dec_frame_libav_upload_only_pending.front();
- //Log::getInstance()->log("Video", Log::WARN, "threadMethod u %d %lld %x",((VPE_FrameBuf*)dec_frame_libav_uploading_framebuf)->pict_num,run,
- // dec_frame_libav_uploading_framebuf);
+ // Log::getInstance()->log("Video", Log::WARN, "threadMethod u %d %lld %x",((VPE_FrameBuf*)dec_frame_libav_uploading_framebuf)->pict_num,run,
+ // dec_frame_libav_uploading_framebuf);
dec_frame_libav_upload_only_pending.pop_front();
view=false;
upload=true;
dec_frame_libav_uploading_framebuf->data[2]);
} else {
//XVMC case
+ // Log::getInstance()->log("Video", Log::WARN, "XVMC mark1");
xvmc_pix_fmt * pix_fmt=(xvmc_pix_fmt *)dec_frame_libav_uploading_framebuf->data[2];
if (moco_shader && pix_fmt) {
ogl_frame_mutex.Unlock();
- if (decoding_mode==VPE_XVMC_MOCOMP) {
+ if (decoding_mode==VPE_XVMC_MOCOMP || decoding_mode==VPE_XVMC_IDCT) {
OsdOpenGL* osd=(OsdOpenGL*)osd->getInstance();
osd->BeginPainting(); // get OpenGl context
moco_shader=new GLMocoShader();