[FFmpeg-devel] [PATCH] swscale: factorize plane copying code out of 2 functions

Michael Niedermayer michaelni
Fri Sep 17 14:10:28 CEST 2010


On Thu, Sep 16, 2010 at 11:19:22AM -0300, Ramiro Polla wrote:
> On Thu, Sep 16, 2010 at 11:08 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Wed, Sep 15, 2010 at 10:14:30PM -0300, Ramiro Polla wrote:
> >> ?swscale.c | ? ?2 +-
> >> ?1 file changed, 1 insertion(+), 1 deletion(-)
> >> 711561766d150bb05875d28bc61a1f3419d18cd3 ?copyPlane_width_stride.diff
> >> Index: swscale.c
> >> ===================================================================
> >> --- swscale.c (revision 32258)
> >> +++ swscale.c (working copy)
> >> @@ -1313,7 +1313,7 @@
> >> ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *dst, int dstStride)
> >> ?{
> >> ? ? ?dst += dstStride * srcSliceY;
> >> - ? ?if (dstStride == srcStride && srcStride > 0) {
> >> + ? ?if (width == dstStride == srcStride && srcStride > 0) {
> >
> > that does not work
> 
> heh, late at night I sometimes forget C syntax doesn't work like
> normal math. but is this the correct idea?

>  swscale.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> da7fc52b2199dce621c4bbe6080369eeac9b2cae  copyPlane_width_stride_2.diff
> Index: swscale.c
> ===================================================================
> --- swscale.c	(revision 32265)
> +++ swscale.c	(working copy)
> @@ -1313,7 +1313,7 @@
>                        uint8_t *dst, int dstStride)
>  {
>      dst += dstStride * srcSliceY;
> -    if (dstStride == srcStride && srcStride > 0) {
> +    if (width == dstStride && width == srcStride && srcStride > 0) {

can this code be called with >8bps <8bps formats?

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- 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/20100917/54496afc/attachment.pgp>



More information about the ffmpeg-devel mailing list