[XviD-devel] Re: xvid bug report

suxen_drol suxen_drol at hotmail.com
Mon Oct 4 12:49:09 CEST 2004


hello,

xvid does not actually support decoding (or encoding) of field 
predicted material. the MACROBLOCK fields you mentioned are not
really used. none the less, xvid should at least parse the backwards-
predication field flags, to prevent loosing sync with the bitstream.

cheers,
-- pete

On Sun, 3 Oct 2004 23:37:13 +0200 "Stanislav Ocovaj" <socovaj at EUnet.yu>
wrote:
> Dear Mr. Ross,
> 
>    I was examining the xvidcore source code and found something that looks like
> a bug to me. The particular code is in the function decoder_bframe() in decoder.c:
> 
>     if (mb->field_pred) {
>       mb->field_for_top = BitstreamGetBit(bs);
>       DPRINTF(XVID_DEBUG_MB,"decp: field_for_top: %i\n", mb->field_for_top);
>       mb->field_for_bot = BitstreamGetBit(bs);
>       DPRINTF(XVID_DEBUG_MB,"decp: field_for_bot: %i\n", mb->field_for_bot);
>     }
> 
> The MPEG-4 spec (ISO IEC 14496-2, section 6.2.6.3 - Interlaced information) says:
> 
>     if (field_prediction) {
>       if (vop_coding_type == "P" ||
>           (vop_coding_type == "B" &&
>           mb_type != "001")) {
>           forward_top_field_reference
>           forward_bottom_field_reference
>       }
>       if ((vop_coding_type == "B") &&
>           (mb_type != "0001")) {
>           backward_top_field_reference
>           backward_bottom_field_reference
>       }
> 
>   So, according to the MPEG-4 spec, for bidirectionaly field-predicted macroblock of a B-VOP
> (field_prediction == "1", vop_coding_type == "B", and mb_type == "01"), there
> are supposed to be two sets of two field select flags present in the bitstream, but in xvid code, only
> one set is read. The MACROBLOCK structure itself also supports only one set of field select flags
> which is used for both forward and backward references in bidirectionaly coded mb's. I've also noticed
> that the output string in DPRINTF function call starts with "decp:", so I suspect that this code was
> just copy-pasted from the decoder_pframe() function. Is this a bug in xvid code or I misunderstood
> the code or MPEG-4 spec?
> 
> Sincerely Yours,
> 
> Stanislav Ocovaj
> 

-- pete



More information about the XviD-devel mailing list