> Ok, then your nested loops should not have any problem. The problem might be 
> with the pointers or the YUV values that you assign to pixels. For example, 
> why do you cast an unsigned char pointer to an unsigned int?

The planes in struct AVFrame are defined as:
uint8_t *data[AV_NUM_DATA_POINTERS];
Hence the cast to uint16_t, as the Y U V values are unsigned 16 bit values, 
true?

Is the following calculation of pointers to the components at pixel line nr. 
aYPos ok?
aPtr = avFrame->data[0] + aYPos * avFrame->linesize[0];
y = (uint16_t *)aPtr;
aPtr = avFrame->data[1] + aYPos * avFrame->linesize[1];
u = (uint16_t *)aPtr;
aPtr = avFrame->data[2] + aYPos * avFrame->linesize[2];
v = (uint16_t *)aPtr;

In VideoCoder::open(), does following instruction allocate the correct buffers?
ret = av_frame_get_buffer(mFrame, 32);
Are this buffers reusable? I do not free/reallocate buffers between encoding
subsequent frames!

Regards
Bernhard Dirr
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to