[Ffmpeg-devel] MPEG4: error in handling interlaced direct-mode macroblocks

Rahul Kumar kr.rahul
Sun Mar 19 22:15:45 CET 2006


Hi everybody,

    Finally I seem to be having some clue as to why this happens. Here
is the story in brief:

FFMPEG directly applies the equations of section 7.7.2.2 (of the
standard), for a interlaced direct-mode macro-block. However since
FFMPEG stores motion vectors as field motion vectors, (for field
macroblocks  mv=mv/2), this prodoces erroneous result. I think the
cleanest way to solve this problem would be to always store the motion
vectors as frame motion-vectos, irrespective of the block-type, and
perform adjustment for field-based macroblocks in mpeg_motion() or
qpel_motion().

Also note that FFMPEG doesn't set the correct field_select parameters
for direct-mode macroblocks.

Hope this would help others (if any) who are trying to debug this stream..

-regards,
rahul


---------- Forwarded message ----------
From: Rahul Kumar <kr.rahul at gmail.com>
Date: Feb 17, 2006 6:11 PM
Subject: MPEG4: handling direct mode prediction for B-frames
To: ffmpeg-devel at mplayerhq.hu


Hi Michael,
  My apologies for souding a false alarm, for the macroblock which I
was debugging doesn't seem to get influenced by that. Here are the
details of my setup and the error which I get:

STREAM: I am debugging an ISO stream which can be downloaded from:
http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_IEC_14496-4_2004_Conformance_Testing/video_conformance/advanced_simple/vcon-asp14L4.bits
(note that you need to rename the extn to .m4v for ffmpeg/ISO code)

REF DEC: The ISO decoder which I am using as refrence can be downloaded from:
http://standards.iso.org/ittf/PubliclyAvailableStandards/c039392_ISO_IEC_14496-5_2001_Amd%205_2004(E)_Reference_Software.zip

FFMPEG VER: Latest Ver downloaded today

Error Desc: I get errors in 13th Macroblock of 3rd decoded frame (1st
B frame), which is the 2nd frame is display order.

###################################
The decoded frame sequence for this stream is:
I_frame    S_frame   B_frame  B_frame....
Display order:
I_frame    B_frame  B_frame  S_frame....
#####################################

The first line of the macroblock of the reference decoder is (in hex):
14 11 13 14 0F 0E 13 11 11 19 ..
where as that decoded by FFMPEG is (in hex):
43 43 4D 51 48 46 4D 47 3F 41....

The remaining lines of the macroblock are decoded correctly (more
reason why the problem cannot be with linesize).

The exact location of start of this mismatch is 0x4A4D0

hopefully you can shed some light on the probable cause of discrepancy.

Warm Regards,
Rahul Kumar





More information about the ffmpeg-devel mailing list