『漫游』酷论坛>『影音数码技术学习交流』>[原创]dshow2raw工具发布 ..

roozhou@2010-08-17 13:12

me-prepass是干什么的?一般我不会加入第三方的补丁。
引用

amfilica@2010-08-17 15:46

Description: Runs an ME prepass on the predictors before actually doing the motion search. Somewhat bugged--it can probably be a lot better than it currently is.


这里是帖子 下面有讲解
http://forum.doom9.org/showthread.php?t=130364

5楼有fixed 补丁

具体是自己不会打补丁的说 假如roozhou 没有做的打算教下我怎么打补丁吧谢谢了
引用

roozhou@2010-08-17 15:55

打补丁windows下很方便
我的方法是用tortoiseSVN里的apply patch功能
引用

amfilica@2010-08-17 17:36

打patch 的时候说148行有问题的说

--------------------------------------------------------------------------------------


引用
Index: common/common.c
===================================================================
--- common/common.c (revision 675)
+++ common/common.c (working copy)
@@ -441,6 +441,8 @@
p->analyse.i_mv_range_thread = atoi(value);
OPT2("subme", "subq")
p->analyse.i_subpel_refine = atoi(value);
+ OPT2("me-prepass", "meprepass")
+ p->analyse.i_me_prepass = atobool(value);
OPT("bime")
p->analyse.b_bidir_me = atobool(value);
OPT("chroma-me")
@@ -879,6 +881,7 @@
s += sprintf( s, " analyse=%#x:%#x", p->analyse.intra, p->analyse.inter );
s += sprintf( s, " me=%s", x264_motion_est_names[ p->analyse.i_me_method ] );
s += sprintf( s, " subme=%d", p->analyse.i_subpel_refine );
+ s += sprintf( s, " me-prepass=%d", p->analyse.i_me_prepass );
s += sprintf( s, " brdo=%d", p->analyse.b_bframe_rdo );
s += sprintf( s, " mixed_ref=%d", p->analyse.b_mixed_references );
s += sprintf( s, " me_range=%d", p->analyse.i_me_range );
Index: encoder/me.c
===================================================================
--- encoder/me.c (revision 675)
+++ encoder/me.c (working copy)
@@ -61,6 +61,23 @@
COPY3_IF_LT( bpred_cost, cost, bpred_mx, mx, bpred_my, my ); \
}

+#define COST_MV_HPEL2( mx, my, cost ) \
+{ \
+ int stride = 16; \
+ uint8_t *src = h->mc.get_ref( m->p_fref, m->i_stride[0], pix, &stride, mx, my, bw, bh ); \
+ cost = h->pixf.fpelcmp[i_pixel]( m->p_fenc[0], FENC_STRIDE, src, stride ) \
+ + p_cost_mvx[ mx ] + p_cost_mvy[ my ]; \
+}
+
+#define COST_MV_HPEL3( mx, my) \
+{ \
+ int stride = 16; \
+ uint8_t *src = h->mc.get_ref( m->p_fref, m->i_stride[0], pix, &stride, mx, my, bw, bh ); \
+ int cost = h->pixf.fpelcmp[i_pixel]( m->p_fenc[0], FENC_STRIDE, src, stride ) \
+ + p_cost_mvx[ mx ] + p_cost_mvy[ my ]; \
+ COPY3_IF_LT( bestcost, cost, bestx, mx, besty, my ); \
+}
+
#define COST_MV_X3_DIR( m0x, m0y, m1x, m1y, m2x, m2y, costs )\
{\
uint8_t *pix_base = p_fref + bmx + bmy*m->i_stride[0];\
@@ -177,18 +194,85 @@
pmx = ( bmx + 2 ) >> 2;
pmy = ( bmy + 2 ) >> 2;
bcost = COST_MAX;
-
+
/* try extra predictors if provided */
if( h->mb.i_subpel_refine >= 3 )
{
COST_MV_HPEL( bmx, bmy );
- for( i = 0; i < i_mvc; i++ )
+ if(!h->param.analyse.i_me_prepass)
{
- const int mx = x264_clip3( mvc[0], mv_x_min*4, mv_x_max*4 );
- const int my = x264_clip3( mvc[1], mv_y_min*4, mv_y_max*4 );
- if( mx != bpred_mx || my != bpred_my )
- COST_MV_HPEL( mx, my );
+ for( i = 0; i < i_mvc; i++ )
+ {
+ const int mx = x264_clip3( mvc[0], mv_x_min*4, mv_x_max*4 );
+ const int my = x264_clip3( mvc[1], mv_y_min*4, mv_y_max*4 );
+ if( mx != bpred_mx || my != bpred_my )
+ COST_MV_HPEL( mx, my );
+ }
+ }
+ else
+ {
+ for( i = 0; i < i_mvc; i++ )
+ {
+ const int mx = x264_clip3( mvc[0], mv_x_min*4, mv_x_max*4 );
+ const int my = x264_clip3( mvc[1], mv_y_min*4, mv_y_max*4 );
+ int doSearch = 1;
+ int j;
+ for(j = 0; j < i; j++)
+ {
+ if(mvc[0] == mvc[j][0] && mvc[1] == mvc[j][1]) doSearch = 0;
+ }
+ if( ( mx != bpred_mx || my != bpred_my ) && doSearch)
+ {
+ int bestcost;
+ int bestx = mx;
+ int besty = my;
+ COST_MV_HPEL2( mx, my, bestcost );
+ COPY3_IF_LT( bpred_cost, bestcost, bpred_mx, bestx, bpred_my, besty );
+ if(bestcost < 2*bpred_cost)
+ {
+ int n;
+ int dir = -2;
+ COST_MV_HPEL2(bestx-4,besty,costs[0]);
+ COST_MV_HPEL2(bestx-2,besty+4,costs[1]);
+ COST_MV_HPEL2(bestx+2,besty+4,costs[2]);
+ COST_MV_HPEL2(bestx+4,besty,costs[3]);
+ COST_MV_HPEL2(bestx+2,besty-4,costs[4]);
+ COST_MV_HPEL2(bestx-2,besty-4,costs[5]);
+ COPY2_IF_LT( bestcost, costs[0], dir, 0 );
+ COPY2_IF_LT( bestcost, costs[1], dir, 1 );
+ COPY2_IF_LT( bestcost, costs[2], dir, 2 );
+ COPY2_IF_LT( bestcost, costs[3], dir, 3 );
+ COPY2_IF_LT( bestcost, costs[4], dir, 4 );
+ COPY2_IF_LT( bestcost, costs[5], dir, 5 );
+ if( dir != -2 )
+ {
+ static const int hex2[8][2] = {{-2,-4}, {-4,0}, {-2,4}, {2,4}, {4,0}, {2,-4}, {-2,-4}, {-4,0}};
+ bestx += hex2[dir+1][0];
+ besty += hex2[dir+1][1];
+ for( n = 1; n < i_me_range && CHECK_MVRANGE4(bestx, besty); n++ )
+ {
+ static const int mod6[8] = {5,0,1,2,3,4,5,0};
+ const int odir = mod6[dir+1];
+ COST_MV_HPEL2(hex2[odir+0][0]+bestx,hex2[odir+0][1]+besty,costs[0]);
+ COST_MV_HPEL2(hex2[odir+1][0]+bestx,hex2[odir+1][1]+besty,costs[1]);
+ COST_MV_HPEL2(hex2[odir+2][0]+bestx,hex2[odir+2][1]+besty,costs[2]);
+ dir = -2;
+ COPY2_IF_LT( bestcost, costs[0], dir, odir-1 );
+ COPY2_IF_LT( bestcost, costs[1], dir, odir );
+ COPY2_IF_LT( bestcost, costs[2], dir, odir+1 );
+ if( dir == -2 )
+ break;
+ bestx += hex2[dir+1][0];
+ besty += hex2[dir+1][1];
+ }
+ }
+ COST_MV_HPEL3(bestx+2,besty-2);
+ COST_MV_HPEL3(bestx+2,besty);
+ COST_MV_HPEL3(bestx+2,besty+2);
+ COST_MV_HPEL3(bestx,besty-2);
+ COST_MV_HPEL3(bestx,besty+2);
+ COST_MV_HPEL3(bestx-2,besty-2);
+ COST_MV_HPEL3(bestx-2,besty);
+ COST_MV_HPEL3(bestx-2,besty+2);
+ COPY3_IF_LT(bpred_cost,bestcost,bpred_mx,bestx,bpred_my,besty);
+ }
+ }
+ }
}
bmx = ( bpred_mx + 2 ) >> 2;
bmy = ( bpred_my + 2 ) >> 2;
COST_MV( bmx, bmy );
}
Index: x264.c
===================================================================
--- x264.c (revision 675)
+++ x264.c (working copy)
@@ -232,7 +232,8 @@
H1( " --mvrange-thread Minimum buffer between threads [-1 (auto)]\n" );
H0( " -m, --subme Subpixel motion estimation and partition\n"
" decision quality: 1=fast, 7=best. [%d]\n", defaults->analyse.i_subpel_refine );
- H0( " --b-rdo RD based mode decision for B-frames. Requires subme 6.\n" );
+ H0( " --me-prepass Run an ME prepass on predictors. Requires subme 3 or higher.\n");
+ H0( " --b-rdo RD based mode decision for B-frames. Requires subme 6 or higher.\n" );
H0( " --mixed-refs Decide references on a per partition basis\n" );
H1( " --no-chroma-me Ignore chroma in motion estimation\n" );
H1( " --bime Jointly optimize both MVs in B-frames\n" );
@@ -398,6 +399,7 @@
{ "mvrange", required_argument, NULL, 0 },
{ "mvrange-thread", required_argument, NULL, 0 },
{ "subme", required_argument, NULL, 'm' },
+ { "me-prepass", no_argument, NULL, 0 },
{ "b-rdo", no_argument, NULL, 0 },
{ "mixed-refs", no_argument, NULL, 0 },
{ "no-chroma-me", no_argument, NULL, 0 },
Index: x264.h
===================================================================
--- x264.h (revision 675)
+++ x264.h (working copy)
@@ -220,6 +220,7 @@
int i_mv_range; /* maximum length of a mv (in pixels). -1 = auto, based on level */
int i_mv_range_thread; /* minimum space between threads. -1 = auto, based on number of threads. */
int i_subpel_refine; /* subpixel motion estimation quality */
+ int i_me_prepass; /* run an ME prepass on predictors */
int b_bidir_me; /* jointly optimize both MVs in B-frames */
int b_chroma_me; /* chroma ME for subpel and mode decision in P-frames */
int b_bframe_rdo; /* RD based mode decision for B-frames */
引用

roozhou@2010-08-17 18:10

patch时遇到问题冲突一律手动解决冲突
不大的patch即使全手动操作也用不了几分钟

我merge x264的官方版到自己版本时经常是几千行的patch,一半以上都需要手动
引用

amfilica@2010-08-17 23:26

我对编程一无所知的说...roozhou 帮我打个补丁吧
引用

roozhou@2010-08-18 10:53

引用
最初由 amfilica 发布
我对编程一无所知的说...roozhou 帮我打个补丁吧

如果真的一无所知,帮你打了补丁你也编译不了啊
引用

amfilica@2010-08-19 13:35

我想要个现成的 听说这个真的是好东西的说
引用

ki。曲奇@2010-08-31 18:42

引用
最初由 roozhou 发布
.avs文件默认不使用dshow模式的,你要用的话必须加-demuxer dshow

最新那版本好像没法指定 --demuxer dshow
引用

amfilica@2010-09-01 02:03

来了来了 神器来了 顶 无得谈
引用

upyzl@2010-09-01 11:14

最新版BUG反馈
如图



最后的 frames fps 均不能显示
更为严重的是,这样生成的mp4无论mp4box还是ffmpeg均无法封装成正常的视频…………(也试过endtime, 一样异常)
引用

amfilica@2010-09-01 11:57

对了假如我的x264 也stop working 的话要用什么方法才可以生成错误文件以便让roozhou 大您更加完善下一个dshow的说 ps 我发现 把 rc lookahed 开250 有那个一定程度几率会有 x264 stop working 的情况的说
引用

upyzl@2010-09-01 12:29

又编了一次
这次把Debug后的信息弄过来
不知道有没有用
  1. Unhandled exception at 0x77532913 in x264.exe: 0xC0000374: A heap has been corrupted.
  2. 775328D9 push 0
  3. 775328DB push 65h
  4. 775328DD call 7749087E
  5. 775328E2 add esp,10h
  6. 775328E5 int 3
  7. 775328E6 and dword ptr [ebp-4],0
  8. 775328EA mov eax,dword ptr [ebp+8]
  9. 775328ED mov dword ptr [ebp-68h],eax
  10. 775328F0 xor eax,eax
  11. 775328F2 inc eax
  12. 775328F3 mov dword ptr [ebp-64h],eax
  13. 775328F6 and dword ptr [ebp-60h],0
  14. 775328FA mov dword ptr [ebp-5Ch],774B6508h
  15. 77532901 mov dword ptr [ebp-58h],eax
  16. 77532904 mov eax,dword ptr [ebp+0Ch]
  17. 77532907 mov dword ptr [ebp-54h],eax
  18. 7753290A lea eax,[ebp-68h]
  19. 7753290D push eax
  20. 7753290E call 774B6508
  21. -->77532913 jmp 77532927
  22. 77532915 mov eax,dword ptr [ebp-14h]
  23. 77532918 mov ecx,dword ptr [eax]
  24. 7753291A mov ecx,dword ptr [ecx]
  25. 7753291C push eax
  26. 7753291D push ecx
  27. 7753291E call 77532892
  28. 77532923 ret
引用

roozhou@2010-09-01 13:10

楼上,我无法再现。请提供sample和解码器设置情况。
引用

upyzl@2010-09-01 13:45

压任何视频(试了至少3个)都是出问题
所以应该不会是Sample的问题
不过还是传一下吧
http://u.115.com/file/f88aabe81e

压制的时候跟0702一样
自动弹出Haali和ffdshow小图标

ffdshow信息没有变化
Input:libavcodec mpeg4
Output:YV12,adj
版本

很奇怪的是0702没有问题(刚用了下0702压)
但0831必顶出问题
我还怀疑不能覆盖又新建文件夹压制,还是不行……
引用

«2829303132333435»共35页

| TOP