[FFmpeg-devel] [PATCH] VC1: Respect rounding flag for chroma MC in B frames

Michael Niedermayer michaelni
Tue Apr 14 13:51:20 CEST 2009


On Tue, Apr 14, 2009 at 12:09:45AM -0400, David Conrad wrote:
> Hi,
>
> As in subject, this fixes some minor errors in 
> planet-vc1-bframe-bitexact.mkv

[...]
> diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
> index e9c2bfc..0a480ae 100644
> --- a/libavcodec/dsputil.h
> +++ b/libavcodec/dsputil.h
> @@ -319,6 +319,7 @@ typedef struct DSPContext {
>      /* This is really one func used in VC-1 decoding */
>      h264_chroma_mc_func put_no_rnd_h264_chroma_pixels_tab[3];
>      h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
> +    h264_chroma_mc_func avg_no_rnd_h264_chroma_pixels_tab[3];
>  
>      qpel_mc_func put_h264_qpel_pixels_tab[4][16];
>      qpel_mc_func avg_h264_qpel_pixels_tab[4][16];
> diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
> index ef6f8b2..15cb323 100644
> --- a/libavcodec/vc1.c
> +++ b/libavcodec/vc1.c
> @@ -1915,8 +1915,13 @@ static void vc1_interp_mc(VC1Context *v)
>      uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
>      uvmx = (uvmx&3)<<1;
>      uvmy = (uvmy&3)<<1;
> -    dsp->avg_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
> -    dsp->avg_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
> +    if(!v->rnd){
> +        dsp->avg_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
> +        dsp->avg_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
> +    }else{
> +        dsp->avg_no_rnd_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
> +        dsp->avg_no_rnd_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
> +    }

maybe the use of the slower code should be under bitexact (i assume b frames
are never used as references)
also i dont like to have h264 in the name of a function that is never
used by h264

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

I wish the Xiph folks would stop pretending they've got something they
do not.  Somehow I fear this will remain a wish. -- M?ns Rullg?rd
-------------- 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/20090414/d699c39d/attachment.pgp>



More information about the ffmpeg-devel mailing list