[Libav-user] Copying pixels directly from AVFrame->data, possible alignment error.

Jesper Taxbøl jesper at taxboel.dk
Mon Jun 13 14:43:07 CEST 2016


Thank you for your replies. :)

I ended up using this syntax to make the artifact go away.

b = f->pAVFrame->data[0][f->pAVFrame->linesize[0]*yy+xx*3+0];
g = f->pAVFrame->data[0][f->pAVFrame->linesize[0]*yy+xx*3+1];
r = f->pAVFrame->data[0][f->pAVFrame->linesize[0]*yy+xx*3+2];

I outputted the linesize[0] to 11520 which is 3*3840

The code that failed was:

uint64_t src_i = (xx+(yy*src_camera_width))*3;
r = f->pAVFrame->data[0][src_i+0];
g = f->pAVFrame->data[0][src_i+1];
b = f->pAVFrame->data[0][src_i+2];


When i write them out on paper they are equivalent, so I suspect it has to
do with an overflowing variable.

Regardless, I solved my problem and have moved on.

Kind regards

Jesper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160613/84b241c2/attachment.html>


More information about the Libav-user mailing list