There is an if condition "FFALIGN(linesize[i], align) == linesize[i] && src_linesize[i] == linesize[i]". When src's linesize equals to dst, it has no padding in this case I think. If has padding, it will execute previous process. As a result, we could ignore the situation of padding in this case. Thank you //frank   ------------------ Original ------------------ From: "FFmpeg development discussions and patches"