func: static int planarCopyWrapper(SwsContext *c, const uint8_t int srcStride[], int srcSliceY, int uint8_t *dst[], int dstStride[]) const AVPixFmtDescriptor * desc_src = av_pix_fmt_desc_get ( c -> srcFormat ) ; int plane , i , j ; for (plane = 0; plane < 4; plane++) int length = ( plane == 0 || plane == 3 ) ? c -> srcW : FF_CEIL_RSHIFT ( c -> srcW , c -> chrDstHSubSample ) ; int y = ( plane == 0 || plane == 3 ) ? srcSliceY : FF_CEIL_RSHIFT ( srcSliceY , c -> chrDstVSubSample ) ; int height = ( plane == 0 || plane == 3 ) ? srcSliceH : FF_CEIL_RSHIFT ( srcSliceH , c -> chrDstVSubSample ) ; const uint8_t * srcPtr = src [ plane ] ; uint8_t * dstPtr = dst [ plane ] + dstStride [ plane ] * y ; if ( ! dst [ plane ] )  if ( plane == 1 && ! dst [ 2 ] )  if ( ! src [ plane ] || ( plane == 1 && ! src [ 2 ] ) )  if ( isNBPS ( c -> srcFormat ) || isNBPS ( c -> dstFormat ) || ( is16BPS ( c -> srcFormat ) != is16BPS ( c -> dstFormat ) ) )  if ( is16BPS ( c -> srcFormat ) && is16BPS ( c -> dstFormat ) && isBE ( c -> srcFormat ) != isBE ( c -> dstFormat ) )  if ( dstStride [ plane ] == srcStride [ plane ] && srcStride [ plane ] > 0 && srcStride [ plane ] == length )  if ( is16BPS ( c -> srcFormat ) && is16BPS ( c -> dstFormat ) )  length *= 2; if ( ! desc_src -> comp [ 0 ] . depth_minus1 )  length >>= 3; for (i = 0; i < height; i++) memcpy ( dstPtr , srcPtr , length ); srcPtr += srcStride [ plane ]; dstPtr += dstStride [ plane ]; 