I'm using DVSDK 4 and the DM368 to encode, stream to network, and decode interlaced std definition h264. I having a problem with what seems to be the decoder. The decoded video appears to have the temporal order of the fields flipped. When things move horizontal I get jittery images. And when there is an instant scene flip it looks like a flash of the old picture with the new,
The first thing that came to mind was the field order of the encoder was swapped, so I encoded the frame by sending the bottom field to the encoder first, then the top. That fixed my temporal problem with the decoder. Horizontal motion produced smooth images. However, the fields are visibly flipped. Any horizontal edges are messed up and diagonals are obviously field flipped. The field flipping is obvious when using VideoLan client to view the video. So clearly swapping the fields at encoder is not the solution to this problem.
Logically I can't seem to figure out how this could be happening, If the order of field display is reversed then I would expect it to be both spacial and temporal.
Now, I'm focusing on the possibility that I'm feeding the decoder the coded information improperly. In the h264dec users guide there is a statement that you must feed the decoder at least one whole frame. However, I am only feeding the decoder a field per Vdec1_process call. The coded video is in byte stream format. I tried feeding it a complete frame of two fields, but the decoder fails to operate correctly when I do this.
Feeding the decoder a complete frame of two fields would be easier for me because I can easily ensure that the first and second field order never get swapped. When I feed it separate fields I send each RTP sequence (i.e. seq of packets terminated with a marker) as a complete field. It's possible for the top and bottom fields to get confused without extra work on my part. When I send the decoder a complete frame then I put both fields in one RTP sequence.
It seems like if I sent the decoder a complete frame of two fields that I should never get the Dmai_EFIRSTFIELD return code and it should handle the whole frame. Oh yeah, I'm using DMAI.
Does anyone have any comments on this?
Thanks,
John A