[FFmpeg-devel] Corrupted blocks and seeking issues in H264 disc sources

Michael Niedermayer michaelni
Tue Jul 24 12:29:40 CEST 2007


Hi

On Tue, Jul 24, 2007 at 12:18:32PM +0200, Andreas ?man wrote:
> Andreas ?man wrote:
> > Hi
> > 
> > Michael Niedermayer wrote:
> >> Hi
> >>
> >> fill_caches()
> >> does
> >>             h->ref_cache[list][scan8[5 ]+1] =
> >>             h->ref_cache[list][scan8[7 ]+1] =
> >>             h->ref_cache[list][scan8[13]+1] =  //FIXME remove past 3 (init somewhere else)
> >>             h->ref_cache[list][scan8[4 ]] =
> >>             h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE;
> >>
> >> why doesnt this suffice to mark them as unavailable?
> >>
> > 
> > I believe it is cause pred_direct_motion() overwrites
> > all this will zeroes.
> > 
> > 
> 
> FWIW, in pred_direct_motion()..
> 
> h->direct_spatial_mv_pred is set
> 
> and
> 
> at the end, the following loop,
> 
> 	int v;
> 	for(v = 0; v < 16; v+=4) {
> 	tprintf(s->avctx, "%2d %2d %2d %2d\n",
> 		h->ref_cache[0][scan8[v+0]],
> 		h->ref_cache[0][scan8[v+1]],
> 		h->ref_cache[0][scan8[v+2]],
> 		h->ref_cache[0][scan8[v+3]]);
> 
> 
> prints:
> 
> [h264 @ 0x84aff08] 0  0  0  0
> [h264 @ 0x84aff08] 0  0  0  0
> [h264 @ 0x84aff08] 0  0  0  0
> [h264 @ 0x84aff08] 0  0  0  0

cavlc contains:
                pred_direct_motion(h, &mb_type);
                h->ref_cache[0][scan8[4]] =
                h->ref_cache[1][scan8[4]] =
                h->ref_cache[0][scan8[12]] =
                h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
...
                if(IS_DIRECT(h->sub_mb_type[i])) {
                    h->ref_cache[list][ scan8[4*i] ] = h->ref_cache[list][ scan8[4*i]+1 ];
                    continue;
                }

cabac does:
                pred_direct_motion(h, &mb_type);
                if( h->ref_count[0] > 1 || h->ref_count[1] > 1 ) {
                    for( i = 0; i < 4; i++ )
                        if( IS_DIRECT(h->sub_mb_type[i]) )
                            fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, 1, 1 );
                }
            }

id say this is suspicious

the cabac case looks buggy and should be fixed
seperate of that, your change which does this in pred_motion should be
benchmarked with all the other then redundant PART_NOT_AVAILABLE/ref_cache
code removed ...
maybe its faster

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070724/bd1a2b29/attachment.pgp>



More information about the ffmpeg-devel mailing list