[Ffmpeg-devel] snow MC simplification
Michael Niedermayer
michaelni
Mon Jan 16 00:27:32 CET 2006
Hi
On Mon, Jan 16, 2006 at 12:12:53AM +0100, Michael Niedermayer wrote:
> Hi
>
> On Sun, Jan 15, 2006 at 09:41:54PM +0100, Guillaume POIRIER wrote:
> > Hi,
> >
> > On 1/8/06, Michael Niedermayer <michaelni at gmx.at> wrote:
> > > Hi
> > >
> > > Snow currently uses the h.264 luma MC functions if possible and if not
> > > (1/8 pel) then its own MC functions (mc_block())
> > > the result is that mc_block() is only used for some chroma blocks if qpel is
> > > enabled, so it would be nice if we could et rid of it, the attached patch
> > > does that, but it needs testing (encode stuff with and without and view with
> > > the respective player with and without the patch)
> >
> > File to patch: snow.c
> > patching file snow.c
> > Hunk #1 succeeded at 2509 (offset 11 lines).
> > Hunk #2 FAILED at 2529.
> > 1 out of 2 hunks FAILED -- saving rejects to file snow.c.rej
> >
> > rejected!
> >
> > (sorry, I couldn't resist! ;o) )
> >
> > Now, seriously, it seems this code doesn't apply anymore (even by
> > hand), and I haven't had a chance to test it until now.
> >
> > Michael, can you send an updated patch?
>
> yes i can
>
> (sorry, I couldn't resist either! ;o) )
enough fun, patch attched :)
[...]
--
Michael
-------------- next part --------------
--- /home/michael/losto 2006-01-16 00:23:00.000000000 +0100
+++ /home/michael/mpc2/home/michael/ffmpeg2/ffmpeg/libavcodec/list 2006-01-16 00:10:00.000000000 +0100
@@ -1,11 +1,11 @@
-Index: libavcodec/snow.c
+Index: snow.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/snow.c,v
-retrieving revision 1.78
-diff -u -r1.78 snow.c
---- libavcodec/snow.c 8 Jan 2006 01:50:34 -0000 1.78
-+++ libavcodec/snow.c 8 Jan 2006 17:32:21 -0000
-@@ -2498,9 +2498,14 @@
+retrieving revision 1.81
+diff -u -r1.81 snow.c
+--- snow.c 12 Jan 2006 22:43:16 -0000 1.81
++++ snow.c 15 Jan 2006 23:10:29 -0000
+@@ -2509,9 +2509,14 @@
const int scale= plane_index ? s->mv_scale : 2*s->mv_scale;
int mx= block->mx*scale;
int my= block->my*scale;
@@ -22,16 +22,15 @@
sx += (mx>>4) - 2;
sy += (my>>4) - 2;
src += sx + sy*stride;
-@@ -2513,9 +2518,9 @@
+@@ -2524,9 +2529,8 @@
assert(!(b_w&(b_w-1)));
assert(b_w>1 && b_h>1);
- assert(tab_index>=0 && tab_index<4);
+ assert(tab_index>=0 && tab_index<4 || b_w==32);
- if((dx&3) || (dy&3))
- mc_block(dst, src, tmp, stride, b_w, b_h, dx, dy);
-- else if(b_w==b_h)
+- else if(b_w==32){
+ assert(!(dx&3) && !(dy&3));
-+
-+ if(b_w==b_h)
- s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst,src + 2 + 2*stride,stride);
- else if(b_w==2*b_h){
- s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst ,src + 2 + 2*stride,stride);
++ if(b_w==32){
+ int y;
+ for(y=0; y<b_h; y+=16){
+ s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + y*stride, src + 2 + (y+2)*stride,stride);
More information about the ffmpeg-devel
mailing list