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

Ramiro Polla ramiro.polla
Sun Sep 26 22:40:01 CEST 2010


On Fri, Sep 17, 2010 at 9:10 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> 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?

No, and it's not supposed to. There's planarCopyWrapper() for >8bps.
This one's only used by nv12 (mix of planar/packed so it needs its own
function) and yvu9ToYv12.



More information about the ffmpeg-devel mailing list