[FFmpeg-devel] [PATCH] improve yuv422p to rgb in libswscale

Michael Niedermayer michaelni
Wed Dec 1 03:15:07 CET 2010


On Tue, Nov 30, 2010 at 05:20:42PM -0800, Baptiste Coudurier wrote:
> On 11/30/2010 05:13 PM, Michael Niedermayer wrote:
>> On Tue, Nov 30, 2010 at 04:07:20AM -0800, Baptiste Coudurier wrote:
>>> Hi
>>>
>>> $subject, use full vertical data when convert 422p, improve quality a lot.
>>>
>>> --
>>> Baptiste COUDURIER
>>> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
>>> FFmpeg maintainer                                  http://www.ffmpeg.org
>>
>>>   x86/yuv2rgb_template.c |   25 ++++-------
>>>   yuv2rgb.c              |  109 ++++++-------------------------------------------
>>>   2 files changed, 26 insertions(+), 108 deletions(-)
>>> 16f384c9b114c76572a539511c42267ce2942c67  yuv422p_to_rgb.patch
>>
>> this looks like it would make 420p->rgb quite a bit slower.
>
> Do you think changing >>1 to >>vshift would make is quite a bit slower ?

no but that stuff:
@@ -152,134 +144,102 @@
 YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0)
     LOADCHROMA(0);
     PUTRGB48(dst_1,py_1,0);
-    PUTRGB48(dst_2,py_2,0);

     LOADCHROMA(1);
-    PUTRGB48(dst_2,py_2,1);
     PUTRGB48(dst_1,py_1,1);

     LOADCHROMA(2);
     PUTRGB48(dst_1,py_1,2);
-    PUTRGB48(dst_2,py_2,2);

     LOADCHROMA(3);
-    PUTRGB48(dst_2,py_2,3);
     PUTRGB48(dst_1,py_1,3);
 ENDYUV2RGBLINE(48)
     LOADCHROMA(0);
     PUTRGB48(dst_1,py_1,0);
-    PUTRGB48(dst_2,py_2,0);

     LOADCHROMA(1);
-    PUTRGB48(dst_2,py_2,1);
     PUTRGB48(dst_1,py_1,1);
 ENDYUV2RGBFUNC()

and then running the code twice


>
>> If so thats a problem.
>> making 422p->rgb slower isnt a real problem as it can be changed to 420p
>> by manipulating linesizes
>
> That's what I want to avoid, this produces crap.

It produces crap when misused on interlaced material.
Of course the user should have the option to use the perfect slow variant and
the faster (correct) optimized variant.



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

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101201/769a6002/attachment.pgp>



More information about the ffmpeg-devel mailing list