[Ffmpeg-devel] [PATCH] lowres chroma bug

Michael Niedermayer michaelni
Wed Feb 7 04:01:34 CET 2007


Hi

On Wed, Feb 07, 2007 at 11:30:10AM +0900, Oleg Metelitsa wrote:
> Hello Michael,
> 
> >> Please find attached a patch, that solves an
> >> "extreme chroma bug" problem in lowres=2 mode
> >> reported by Reimar Doffinger 6 months ago:
> >>
> >> Is the proposed patch OK ?
> 
> MN> no because it slows the non lowres code down
> 
> Sorry, I did not mean old Reimar's patch which might slow down the non
> lowres code. I am trying to propose the new patch that solves the same
> problem.  I  think it must not affect the speed of FFMPEG code because
> it really adds only one extra register-to register move instruction.

not all registers are equal, mmx and integer
registers can be quite seperate on a cpu, the p4 for example will
need 6 cpu cycles for that extra instruction


[...]
> As  a  result, we have garbage at the beginning of every second row of
> an image.
> 
> There are 3 possible ways to solve the problem:
> 
> 1)  See the new proposed patch above. It works in the following way: I
> changed  a  32-bit movd instruction to a 16-bit mov. As a result there
> will be no garbage  written in the picture any more.
> 
> 2)  We  can  add  to our 16-bit another 16 bit that were can read from
> picture and than write 16+16=32 bit. I tried this solution too, but it
> was slower than solution 1)
> 
> 3)  We can add two extra pixels to image in lowres=2 mode:
> image_stride =  image_width  +  2
> chroma_stride = image_width/2 + 2
> Then  the garbage will be written to those extra (dummy) pixels rather
> than to the beginning of the next row.
> 
> The  last  solution is also OK, and I can send the patch containing 3)
> if you like.

if its clean sure iam happy with 3.

there are also many more solutions like saving and restioring the pixels of
the left column, though that would be ugly i must admit ...

also the problematic function could be duplicated one with the move for lowres
and one without for h.264

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

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070207/3f19e071/attachment.pgp>



More information about the ffmpeg-devel mailing list