[Ffmpeg-devel] BlackFin lowlevel pixel operations PATCH
Marc Hoffman
mmh
Mon Apr 2 03:37:11 CEST 2007
Diego Biurrun writes:
> On Sun, Apr 01, 2007 at 04:36:26PM -0400, Marc Hoffman wrote:
> >
> > I took the time to rewrite the comments and most of the broken english
> > has been replaced with something a little more useful. Thanks
>
> Much better, thank you.
>
:-)
> Patch applied along with some spelling/wording corrections.
>
> One more question:
>
> > --- bfin/dsputil_bfin.c (revision 8581)
> > +++ bfin/dsputil_bfin.c (working copy)
> > @@ -18,38 +21,296 @@
> >
> > +#if 0
> > +void pblk (uint8_t *p, int w, int h, int s)
> > {
> > + int i,j;
> > + av_log (0,0,"0x%08x:\n", p);
> > + for (i = 0;i<h;i++) {
> > + for (j=0;j<w;j++)
> > + av_log (0,0,"%3d ", p[j]);
> > + p+=s;
> > + av_log (0,0,"\n");
> > + }
> > + av_log (0,0,"\n");
> > }
> > +#endif
>
> What for? And why the unintuitive name?
>
This is just a debug tool that prints a block of memory, I guess I got
very use to it and thats why the strange name p for print blk for
block. Nothing to smart at all.
I use these now all the time actually I have a whole family of these
which make it easier to debug some class of algorithms typically
video. BTW would the group be interested in these as part of .gdbinit
environment for debugging?
define pblks
set $p = (short *)$arg0
set $w = $arg1
set $h = $arg2
set $s = $arg3
set $y = 0
printf "%08x\n", $p
while ($y < $h)
set $x = 0
while ($x < $w)
set $c = *$p
printf "%4d ", $c
set $p = $p + 1
set $x = $x + 1
end
printf "\n"
if ($s)
set $p = $p + ($s-$w)
end
set $y = $y+1
end
printf "\n"
end
define pblk
set $p = (unsigned char *)$arg0
set $w = $arg1
set $h = $arg2
set $s = $arg3
set $y = 0
printf "%08x\n", $p
while ($y < $h)
set $x = 0
while ($x < $w)
set $c = *$p
printf "%4d ", $c
set $p = $p + 1
set $x = $x + 1
end
printf "\n"
if ($s)
set $p = $p + ($s-$w)
end
set $y = $y+1
end
printf "\n"
end
define clrblk
set $p = (unsigned char *)$arg0
set $w = $arg1
set $h = $arg2
set $s = $arg3
set $y = 0
printf "%08x\n", $p
while ($y < $h)
set $x = 0
while ($x < $w)
set *$p = 0
set $p = $p + 1
set $x = $x + 1
end
if ($s)
set $p = $p + ($s-$w)
end
set $y = $y+1
end
end
More information about the ffmpeg-devel
mailing list