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

Michael Niedermayer michaelni
Tue Apr 14 22:10:33 CEST 2009


On Tue, Apr 14, 2009 at 03:36:49PM -0400, David Conrad wrote:
> On Apr 14, 2009, at 7:51 AM, Michael Niedermayer wrote:
>
>> 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
>
> How about optimizing the function instead? Also I'll rename them to 

well, if you want ...


> (put|avg)_no_rnd_vc1_chroma* afterwards (or before if you prefer.)

before commit

[...]
-- 
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/20090414/7330dac9/attachment.pgp>



More information about the ffmpeg-devel mailing list