[FFmpeg-devel] [PATCH] Add one spatial prediction mode for RV3/4

Michael Niedermayer michaelni
Sun Dec 16 15:53:45 CET 2007


On Sun, Dec 16, 2007 at 04:05:57PM +0200, Kostya wrote:
> I've omitted this special case of spatial prediction fo RV30/40.
> It is a bit braindamaged but needed to work as specified.

[...]
> Index: libavcodec/h264pred.c
> ===================================================================
> --- libavcodec/h264pred.c	(revision 11230)
> +++ libavcodec/h264pred.c	(working copy)
> @@ -292,6 +292,7 @@
>      LOAD_TOP_EDGE
>      LOAD_TOP_RIGHT_EDGE
>      LOAD_LEFT_EDGE
> +    LOAD_DOWN_LEFT_EDGE
>  
>      src[0+0*stride]=(2*t0 + 2*t1 + l1 + 2*l2 + l3 + 4)>>3;
>      src[1+0*stride]=
> @@ -301,6 +302,29 @@
>      src[3+0*stride]=
>      src[2+2*stride]=(t3 + t4+ 1)>>1;
>      src[3+2*stride]=(t4 + t5+ 1)>>1;
> +    src[0+1*stride]=(t0 + 2*t1 + t2 + l2 + 2*l3 + l4 + 4)>>3;
> +    src[1+1*stride]=
> +    src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
> +    src[2+1*stride]=
> +    src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
> +    src[3+1*stride]=
> +    src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
> +    src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
> +}
> +
> +static void pred4x4_vertical_left_rv40_nodown_c(uint8_t *src, uint8_t *topright, int stride){
> +    LOAD_TOP_EDGE
> +    LOAD_TOP_RIGHT_EDGE
> +    LOAD_LEFT_EDGE
> +
> +    src[0+0*stride]=(2*t0 + 2*t1 + l1 + 2*l2 + l3 + 4)>>3;
> +    src[1+0*stride]=
> +    src[0+2*stride]=(t1 + t2 + 1)>>1;
> +    src[2+0*stride]=
> +    src[1+2*stride]=(t2 + t3 + 1)>>1;
> +    src[3+0*stride]=
> +    src[2+2*stride]=(t3 + t4+ 1)>>1;
> +    src[3+2*stride]=(t4 + t5+ 1)>>1;
>      src[0+1*stride]=(t0 + 2*t1 + t2 + l2 + 2*l3 + l3 + 4)>>3;
                                              ^^^^^^^^
3*l3
and the code looks quite similar, i guess the common part can be factored
out into a function

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071216/3d15ce85/attachment.pgp>



More information about the ffmpeg-devel mailing list