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

David Conrad lessen42
Tue Apr 14 21:36:49 CEST 2009


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  
(put|avg)_no_rnd_vc1_chroma* afterwards (or before if you prefer.)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vc1-chroma-no-rnd2.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090414/6e08a8a7/attachment.txt>
-------------- next part --------------




More information about the ffmpeg-devel mailing list