[FFmpeg-devel] [PATCH] fix 422 sse computation

Baptiste Coudurier baptiste.coudurier
Wed Aug 6 03:58:57 CEST 2008


Michael Niedermayer wrote:
> On Mon, Aug 04, 2008 at 05:50:09PM -0700, Baptiste Coudurier wrote:
>> Hi,
>>
>> $subject, I believe the patch is correct.
>>
>> -- 
>> Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
>> Smartjog USA Inc.                                http://www.smartjog.com
>> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> 
>> Index: libavcodec/mpegvideo_enc.c
>> ===================================================================
>> --- libavcodec/mpegvideo_enc.c	(revision 14539)
>> +++ libavcodec/mpegvideo_enc.c	(working copy)
>> @@ -1901,6 +1901,7 @@
>>  static int sse_mb(MpegEncContext *s){
>>      int w= 16;
>>      int h= 16;
>> +    int mb_h= 16>>s->chroma_y_shift;
> 
> i think chr_h is a better name
> 
> 
> [...]
>> @@ -2012,6 +2013,7 @@
>>  static int encode_thread(AVCodecContext *c, void *arg){
>>      MpegEncContext *s= arg;
>>      int mb_x, mb_y, pdif = 0;
>> +    int mb_h= 16>>s->chroma_y_shift;
> 
> same
> 
> and iam  ok with the patch provided that it has been tested and works
> 

Changed:

422.m2v on mplayerhq.

Before (with psnr 422 patch):
ffmpeg -i 422.m2v -pix_fmt yuv422p -mbd rd -psnr -b 6000k test.m2v

frame=  608 fps= 53 q=2.0 LPSNR=Y:49.09 U:48.74 V:50.21 *:49.20 size=
12587kB time=24.28 bitrate=4246.8kbits/s
video:12587kB audio:0kB global headers:0kB muxing overhead 0.000000%

After:
frame=  608 fps= 54 q=2.0 LPSNR=Y:49.12 U:49.02 V:50.53 *:49.31 size=
12351kB time=24.28 bitrate=4167.2kbits/s
video:12351kB audio:0kB global headers:0kB muxing overhead 0.000000%

Code is not so obvious, and I understand this might need careful review.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_422_sse.patch
Type: text/x-diff
Size: 3672 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080805/8ff7fb40/attachment.patch>



More information about the ffmpeg-devel mailing list